调用CreateKeyPair创建一对SSH密钥对。
接口说明
边缘节点服务 ENS 会为您保管密钥的公钥部分,并返回未加密的 PEM 编码的 PKCS#8 格式私钥。您需要自行妥善保管私钥部分。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ens:CreateKeyPair |
create |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| KeyPairName |
string |
是 |
密钥对名称。命名规则如下所示:
|
TestKeyPairName |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| KeyPairFingerPrint |
string |
密钥对的指纹。根据 RFC4716 定义的公钥指纹格式,采用 MD5 信息摘要算法。详情请参见 RFC4716 。 |
7880c1ad4687fdbf7a6da2131**** |
| KeyPairId |
string |
SSH 密钥对的 ID。 |
ssh-5lywanlkih1zo9yl8eg**** |
| KeyPairName |
string |
密钥对名称。 |
TestKeyPairName |
| PrivateKeyBody |
string |
密钥对的私钥。PEM 编码的 PKCS#8 格式的私钥部分。 |
-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQE**** |
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
示例
正常返回示例
JSON格式
{
"KeyPairFingerPrint": "7880c1ad4687fdbf7a6da2131****",
"KeyPairId": "ssh-5lywanlkih1zo9yl8eg****",
"KeyPairName": "TestKeyPairName",
"PrivateKeyBody": "-----BEGIN RSA PRIVATE KEY-----\\nMIIEogIBAAKCAQE****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
错误码
|
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 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | 指定的安全组ID不存在。 |
| 400 | SecurityGroupRuleConflict.Duplicated | The SecurityGroup rule already exists. | 安全组规则重复。 |
| 400 | AuthorizationLimitExceed | The limit of authorization records in the security group reaches. | 安全组规则数量超出限额。 |
| 400 | ens.interface.error | An error occurred while calling the API. | |
| 400 | CallInterface | Call Interface Happen Error. | 接口调用出错。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。