Queries one or more key pairs.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the key pair. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
KeyPairName | string | No | The name of the key pair. You can use the asterisk (*) symbol as a wildcard in regular expressions to perform a fuzzy search for key pairs. Sample patterns:
| *SshKey* |
KeyPairFingerPrint | string | No | The fingerprint of the key pair. The message-digest algorithm 5 (MD5) is used based on the public key fingerprint format defined in RFC 4716. For more information, see RFC 4716. | ABC1234567 |
PageNumber | integer | No | The number of the page to return. Pages start from page 1. Default value: 1. | 1 |
PageSize | integer | No | The number of entries to return on each page. 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. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response. Note
Resources in the default resource group are displayed in the response regardless of how this parameter is set.
| rg-amnhr7u7c7hj**** |
Tag | object [] | No | The tags. | |
Key | string | No | The key of tag N of the key pair. Valid values of N: 1 to 20. If a single tag is specified to query resources, up to 1,000 resources that are bound with this tag can be displayed in the response. If multiple tags are specified to query resources, up to 1,000 resources that are bound with all these tags can be displayed in the response. To query more than 1,000 resources that have specified tags added, call the ListTagResources operation. | TestKey |
Value | string | No | The value of tag N of the key pair. Valid values of N: 1 to 20. | TestValue |
Response parameters
Examples
Sample success responses
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
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||
---|---|---|---|---|---|---|---|---|
2024-02-01 | The request parameters of the API has changed. The response structure of the API has changed | see changesets | ||||||
|