Queries one or more SSH key pairs.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeKeyPairs |
get |
KeyPair
KeyPair
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the key pairs. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| KeyPairName |
string |
No |
The name of the key pair. Fuzzy search with regular expressions is supported. You can use an asterisk (*) to match subexpressions. Examples:
|
*SshKey* |
| KeyPairFingerPrint |
string |
No |
The fingerprint of the key pair. The public key fingerprint format is defined in RFC 4716 and uses the MD5 message digest algorithm. For more information, refer to RFC 4716. |
ABC1234567 |
| PageNumber |
integer |
No |
The page number of the key pair list. Minimum value: 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page for a paged query. Maximum value: 50. Default value: 10. |
10 |
| IncludePublicKey |
boolean |
No |
Specifies whether to include PublicKey in the response. Default value: false. |
false |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the key pairs belong. When you use this parameter to filter resources, the resource count cannot exceed 1000. Note
Filtering by the default resource group is not supported. |
rg-amnhr7u7c7hj**** |
| Tag |
array<object> |
No |
The tags. |
|
|
object |
No |
|||
| Key |
string |
No |
The tag key of the key pair. Valid values of N: 1 to 20. If you use a single tag to filter resources, the resource count with the specified tag cannot exceed 1000. If you use multiple tags to filter resources, the resource count of resources that are attached with all specified tags cannot exceed 1000. If the resource count exceeds 1000, call the ListTagResources operation to query resources. |
TestKey |
| Value |
string |
No |
The tag value of the key pair. Valid values of N: 1 to 20. |
TestValue |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| PageSize |
integer |
The number of entries per page. |
10 |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| PageNumber |
integer |
The current page number. |
1 |
| TotalCount |
integer |
The total number of key pairs. |
1 |
| KeyPairs |
object |
||
| KeyPair |
array<object> |
The key pair information. |
|
|
array<object> |
|||
| CreationTime |
string |
The time when the key pair was created. The time follows the ISO 8601 standard in UTC. |
2023-09-04T08:33Z |
| KeyPairName |
string |
The name of the key pair. |
testKeyPairName |
| KeyPairFingerPrint |
string |
The fingerprint of the key pair. |
ABC1234567 |
| ResourceGroupId |
string |
The resource group ID. |
rg-amnhr7u7c7hj**** |
| PublicKey |
string |
The public key content. |
ssh-rsa**** |
| Tags |
object |
||
| Tag |
array<object> |
The tags of the key pair. |
|
|
object |
|||
| TagValue |
string |
The tag value of the key pair. |
TestValue |
| TagKey |
string |
The tag key of the key pair. |
TestKey |
Examples
Success response
JSON format
{
"PageSize": 10,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageNumber": 1,
"TotalCount": 1,
"KeyPairs": {
"KeyPair": [
{
"CreationTime": "2023-09-04T08:33Z",
"KeyPairName": "testKeyPairName",
"KeyPairFingerPrint": "ABC1234567",
"ResourceGroupId": "rg-amnhr7u7c7hj****",
"PublicKey": "ssh-rsa****",
"Tags": {
"Tag": [
{
"TagValue": "TestValue",
"TagKey": "TestKey"
}
]
}
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.