1. SSH密钥详情
1.1. 描述
获取SSH密钥详情
1.2. 请求地址
请求地址的格式如下:
https://<区域服务地址>/v1/sshkey/detail
1.3. 请求参数
参数名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
projectId | String | 是 | 所属项目ID |
id | String | 是 | SSH密钥ID |
1.4. 请求示例
以获取华东一区某SSH密钥详情为例:
1.4.1. 请求地址
POST https://cn-east-1.api.yovole.com/v1/sshkey/detail HTTP/1.1
x-ycs-timestamp: 2019-06-19T14:26:26Z
x-ycs-requestid: 2a49cfa2-925b-11e9-bb3a-6c96cfdcd6b9
x-ycs-security-authorization: Authorization: YCS1-HMAC-SHA1 Credential=08e206fb-7b41-45b7-8076-8d43e8aeea89,SignedHeaders=content-type;x-ycs-requestid;x-ycs-timestamp,Signature=2RFjU7C9gICCrQfpAIfAJHqRRlQ=
1.4.2. 接口请求参数
{
"projectId": "8a83a0906b692378016b6d5ec5f40250",
"id": "8a9496b46b5556cd016b555d16a50002"
}
1.5. 返回结果
1.5.1. 返回正确结果示例
{
"requestId": "c11fc9e4-b7c1-4535-a561-b2dc62c14500",
"success": true,
"code": 200,
"message": null,
"model": {
"id": "2c945bb16adec267016adf5ccc970000",
"name": "test",
"sn": "SSH-XXXXX",
"regionSn": "CN-EAST-1",
"created": "2019-05-22 19:46:02",
"encryptType": "DSA",
"using": "UNUSED",
"publicKey": "ssh-dss AAAAB3NzaC1kc3MAAACBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAAAAFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QAAAIEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoAAACBAM9N6R9mK4tQdtJ0VpnZbvMLGUSrEdALAWcOF442bWofNV/AtAzW1lqFJeU3HxlgUufV7jaYYw8/Mi7N1LaTq7Xpf0SqOq0rpZjuO4eI7dF6mMmhMtbJn5MoOvVPULTyP4n6qBiV4y6H59Pj/WJ3FCHVMj+ug7mmzi9IjkSPFwMD GENERATED-BY-YOVOLE-CLOUD\n",
"attaches":[
{
"resourceType":"VM",
"id":"f6509405-b150-44e6-b903-a7f6cf9bc8c4",
"sn":"VM-21A-8KP5T",
"name":"主机名称"
}
]
}
}
1.5.2. 返回错误结果示例
{
"requestId": "8835c71f-cec3-4bdf-92f1-4d55c7f431e9",
"success": false,
"code": 404,
"message": "SshKey Not Found",
"errorCode": "NotFound"
}
1.6. 错误码
可以通过错误返回结果中的code、errorCode和message字段了解错误分类和具体的错误原因。
该接口没有特殊错误码,错误码信息和简单的错误分析方法可以参考公共错误码。