调用DeleteKeyPairs删除一对SSH密钥对。
接口说明
如果您成功删除密钥对,将无法通过 DescribeKeyPairs 查询该密钥对。
如果您的 ENS 实例已经绑定了密钥对,在删除了该密钥对后,阿里云 ENS 不再为您保存该 SSH 密钥对,但是实例可以正常使用该 SSH 密钥对。调用 DescribeInstances 查询实例信息时,会显示密钥对名称(KeyPairName),但不再显示其他相关信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ens:DeleteKeyPairs |
delete |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| KeyPairName |
string |
否 |
密钥对名称。命名规则如下所示:
在进行删除密钥对前,您可以调用 DescribeKeyPairs 查询已有密钥对。 |
TestKeyPairName |
| KeyPairId |
string |
否 |
SSH 密钥对的 ID。 |
ssh-5lywanlkih1zo9yl8eg**** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
示例
正常返回示例
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E\t"
}
错误码
|
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 | PubKeyNameExisted | Public Key Pair Name Existed. | 密钥对名字已存在 |
| 400 | PubKeyAttachedWithInstance | Public Key Attached With Instance. | 密钥已绑定了实例 |
| 400 | InvalidPubKeyBody | Invalid Public Key Body. | 不合法的密钥 |
| 400 | PubKeyNameNotExist | Public Key Pair Name Not Exist. | 密钥对名字不存在 |
| 400 | CallInterface | Call Interface Happen Error. | 接口调用出错。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。