You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Key pairs
DescribeKeyPairs - Queries key pair list
Copy page
Download PDF
DescribeKeyPairs - Queries key pair list
Call the DescribeKeyPairs operation to query the list of key pairs.​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
Only the request parameters specific to this operation and some common parameters are listed below. For more information, refer to Common parameters.​
Action string required Sample value: DescribeKeyPairs​
The action that you want to perform. Value: DescribeKeyPairs.​
​
Version string required Sample value: 2020-04-01​
The version of the API. Valid value: 2020-04-01.​
​
FingerPrint string Optional Sample value: 4158f40dbc0814eb04f0dcac4e******​
The fingerprint of the key pair. The fingerprint of the key pair is generated based on the MD5 message-digest algorithm in the RFC4716-defined format for public key fingerprints.​
​
KeyPairIds.N string[] Optional Sample value: KeyPairIds.1=kp-ybp0x6i30gep29******​
The key pair ID. A maximum of 100 key pair IDs are supported.​
  • Argument - N: specifies the serial number of the key pair ID.​
  • Separate multiple key pair IDs with &.​
​
KeyPairName string Optional Sample value: ssh-asfas​
The key pair name. Fuzzy search is supported.​
​
KeyPairNames.N string[] Optional Sample value: KeyPairNames.1=ssh_key_pair​
The key pair name. A maximum of 100 key pair names are supported.​
  • Argument - N: specifies the serial number of the key pair.​
  • Separate multiple key pairs with &.​
​
MaxResults integer Optional Sample value: 10​
The number of entries returned on each page in a pagination query.​
  • Maximum value: 500​
  • Default value: 10​
​
NextToken string Optional Sample value: --​
Pagination token marking the query position. Omit this parameter for initial API requests. In the next query, set the NextToken parameter to the value returned by the previous API call.​
​
ProjectName string Optional Sample value: project_a​
The project to which the resource belongs. A resource can only belong to one project.​
  • Only letters, digits, underscores (_), hyphens (-), and dots (.) are allowed.​
  • The length is limited to 64 characters.​
​
TagFilters.N.Key string[] Optional Sample value: TagFilters.1.Key=k1​
The specified tag key when querying resources based on tags.​
  • Argument - N: Specifies the serial number of the tag key. Valid range: 1–10.​
  • Separate multiple tag keys with ampersands (&).​
  • Tag keys must be unique.​
​
TagFilters.N.Values.N string[] Optional Sample value: TagFilters.1.Values.1=v1&TagFilters.1.Values.2=v2​
The specified tag value when querying resources based on tags.​
  • The first N: specifies the serial number of the tag key. Value range: 1–10.​
  • The second N: specifies the serial number of the tag value. Value range: 1–3. You can query up to three tag values of the same tag key.​
  • Separate multiple tag values with ampersands (&).​
tip​
  • To pass in this parameter, pass in TagFilters.N.Key first.​
  • If you do not pass in the TagFilters.N.Key parameter, all tag values corresponding to the same tag key are queried.​
  • If you specify an empty string, you query tags with an empty tag value.​
​
​
​
Response parameters​
Only the response parameters specific to this operation are listed below. For more information, refer to the response structure.​
KeyPairs object[] Sample value: --​
The key pair information.​
Tags object[] Sample value: --​
Information about tags associated with resources.​
Key string Sample value: k1​
The tag key of the resource.​
​
Value string Sample value: v1​
Tag value of a resource.​
​
​
Key string Sample value: k1​
The tag key of the resource.​
​
Value string Sample value: v1​
Tag value of a resource.​
​
​
CreatedAt string Sample value: 2021-05-21T18:40:43+08:00​
The time when the key pair is created.​
​
Description string Sample value: ssh_key_pair description​
The description of the key pair.​
​
FingerPrint string Sample value: 4158f40dbc0814eb04f0dcac4e******​
This parameter is generated based on the MD5 message-digest algorithm in the RFC4716-defined format for public key fingerprints.​
​
KeyPairId string Sample value: kp-ybp0x6i30gep29******​
The unique ID of the key pair.​
​
KeyPairName string Sample value: ssh_key_pair​
Name of the key pair.​
​
ProjectName string Sample value: project_a​
The project to which the resource belongs.​
​
UpdatedAt string Sample value: 2021-05-21T18:40:55+08:00​
The time when the key pair is updated.​
​
​
NextToken string Sample value: bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******​
The query credentials value returned by this call. If null is returned, this page is the last page.​
​
​
​
Sample request​
​
GET /?Action=DescribeKeyPairs&Version=2020-04-01&MaxResults=1 HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
Service: ecs​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "20241112104303225137085107A08E47",​
"Action": "DescribeKeyPairs",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {​
"KeyPairs": [​
{​
"Tags": [​
{​
"Key": "k1",​
"Value": "v1"​
}​
],​
"CreatedAt": "2021-05-21T18:40:43+08:00",​
"Description": "ssh_key_pair description",​
"FingerPrint": "4158f40dbc0814eb04f0dcac4e******",​
"KeyPairId": "kp-ybp0x6i30gep29******",​
"KeyPairName": "ssh_key_pair",​
"ProjectName": "project_a",​
"UpdatedAt": "2021-05-21T18:40:55+08:00"​
}​
],​
"NextToken": "bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******"​
}​
}​
​
Error codes​
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.​
​
Status code​
Error code​
Error message​
Description​
400​
InvalidArgument​
The specified argument is invalid.​
The specified argument is invalid.​
400​
InvalidTagFilterKey.Malformed​
The specified TagFilterKey is malformed.​
The format of the specified tag key for query is invalid.​
400​
InvalidTagFilterValue.Malformed​
The specified TagFilterValue is malformed.​
The format of the specified tag value for query is invalid.​
400​
LimitExceeded.MaximumKeyPairIds​
You've reached the limit on the number of KeyPairIds that you can set.​
The number of specified key pair IDs exceeds the upper limit.​
400​
LimitExceeded.MaximumKeyPairNames​
You've reached the limit on the number of KeyPairNames that you can set.​
The number of specified key pair names exceeds the upper limit.​
400​
LimitExceeded.MaximumTagFilterKeys​
You've reached the limit on the number of TagFilterKeys that you can set.​
The specified query tag key is out of range.​
400​
LimitExceeded.MaximumTagFilterResults​
You've reached the limit on the number of resources that you can describe by TagFilters.​
The number of resources filtered by tag exceeds the upper limit.​
400​
LimitExceeded.MaximumTagFilterValues​
You've reached the limit on the number of TagFilterValues that you can set.​
The specified query tag value exceeds the valid range.​
409​
InvalidTagFilterKey.Conflict​
The specified TagFilterKey already exists.​
The specified tag filter key already exists.​
429​
FlowLimitExceeded​
You've reached the limit on request rate of resources.​
Resource request rate exceeds the limit.​
500​
InternalError​
An internal error has occurred.​
An internal error occurred. Try again. If multiple attempts fail, submit a ticket.​
​
​
Last updated: 2026.06.18 17:48:24