调用DescribeKeyPairs查询一个或多个密钥对。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ens:DescribeKeyPairs |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| KeyPairName |
string |
否 |
密钥对名称。长度为 2~128 个英文或中文字符。必须以大小字母或中文开头,不能以
仅支持传单个名称。默认查询所有密钥对信息。 |
TestKeyPairName |
| PageNumber |
string |
否 |
查询列表的页码。取值:>0,默认查询第 1 页。 |
1 |
| PageSize |
string |
否 |
分页查询时设置的每页行数。取值:>0,默认为 10。 |
10 |
| KeyPairId |
string |
否 |
密钥对的 ID。 |
ssh-50cynkq42sgj4ej1tn78t4*** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| KeyPairs |
object |
||
| KeyPair |
array<object> |
密钥对信息。 |
|
|
object |
|||
| CreationTime |
string |
密钥对的创建时间。日期格式按照 ISO8601 表示法,并使用 UTC 时间。格式为 yyyy-MM-ddTHH:mm:ssZ。 |
2020-04-26T15:38:27Z |
| KeyPairFingerPrint |
string |
密钥对的指纹。 |
fdaf8ff7a756ef843814fc**** |
| KeyPairName |
string |
密钥对的名称。 |
TestKeyPairName |
| KeyPairId |
string |
密钥对的 ID |
ssh-50cynkq42sgj4ej1tn78t4*** |
| PageNumber |
integer |
当前页码。 |
1 |
| PageSize |
integer |
每页行数。 |
10 |
| RequestId |
string |
请求 ID。 |
37B52F33-6879-49D0-A39B-22966B01449E |
| TotalCount |
integer |
密钥对的总数。 |
7 |
示例
正常返回示例
JSON格式
{
"KeyPairs": {
"KeyPair": [
{
"CreationTime": "2020-04-26T15:38:27Z",
"KeyPairFingerPrint": "fdaf8ff7a756ef843814fc****",
"KeyPairName": "TestKeyPairName",
"KeyPairId": "ssh-50cynkq42sgj4ej1tn78t4***"
}
]
},
"PageNumber": 1,
"PageSize": 10,
"RequestId": "37B52F33-6879-49D0-A39B-22966B01449E",
"TotalCount": 7
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | MissingParameter | The input parameter that is mandatory for processing this request is not supplied. | |
| 400 | NoPermission | Permission denied. | |
| 400 | InvalidParameter.%s | The specified field %s invalid. Please check it again. | |
| 400 | InvalidParameter | The errorMessage is %s. Please check it again. | |
| 400 | ens.interface.error | An error occurred while calling the API. | |
| 400 | CallInterface | Call Interface Happen Error. | 接口调用出错。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。