- 产品文档
- > 计算服务
- > 容器服务
- > 开发指南
- > 密钥 OpenAPI
- > 密钥对上传
所属服务
keypair
Action
UploadKeyPair
Version
2018-02-08
Method
POST
描述
上传秘钥对公钥
请求参数
参数名称 | 说明 | 参数类型 | 是否必填 |
---|---|---|---|
Action | UploadKeyPair | string | 是 |
Version | 2018-02-08 | string | 是 |
Body
参数名称 | 说明 | 参数类型 | 是否必填 |
---|---|---|---|
KeyContent | 公钥内容 | string | 是 |
KeyName | 秘钥名称 | string | 否 |
返回参数
返回参数被覆盖
错误码
错误码(Code) | 错误提示(Message) | http status code | 说明 |
---|---|---|---|
Success | 处理成功 | 200 | null |
NoQuota | 超出配额 | 400 | null |
InvalidParameters | 参数非法 | 400 | null |
DuplicatedSecretKey | 秘钥已存在 | 400 | null |
InternalServerError | 服务内部错误 | 500 | null |
MissingParameter | 参数缺失 | 400 | null |
请求示例
curl -X POST \
'{G0Host}/keypair?Action=UploadKeyPair&Version=2018-02-08' \
-H 'Accept: application/json;charset=UTF-8' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'X-163-RequestId: ae4dd21c-07ee-4aed-b6e0-3e657ff77150' \
-H 'X-163-AcceptLanguage: zh' \
-H 'X-163-SignatureVersion: 2.0' \
-H 'X-163-SignatureNonce: e3045d2b-e53b-4b00-a2e6-6938c0fddc09' \
-H 'X-163-DryRun: false' \
-H 'X-163-Date: 2018-08-21T01:59:01Z' \
-H 'host: {G0Host}' \
-H 'Authorization: HMAC-SHA256 Credential=bd9e3a3d25fa4deda81d7d6954a34342/20180821/cn-east-1/keypair/163_request, SignedHeaders=host;x-163-acceptlanguage;x-163-date;x-163-dryrun;x-163-signaturenonce;x-163-signatureversion, Signature=0292b56f06657438ef886b8658435c3dd1025787e44c87a9d123a16f28c41a87' \
-b '{"KeyName":"KeyPairTest22","KeyContent":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwO9vK8S6PSWfsoyEnEaFwQPGTNWSqL18pl7gr9EXa7+DFkw5A763SBUvd30XfeXEwQVRGO/IcaMFP3nRe7P3TmjYk+JLe80hHSKsWm3ctI/nt5qFePwE685ESWZeHPkWXn2plXd0LICbtqBq5M8AupEv4CjueUXQkDVyySNZvbBoNGuQl9HoKFCv4MVxn4lgQWdNfwBb7QKnct4OPav5lVcJ6qwRPuXM/uEw42FZXf2ovaBQSUvsR88hJfZmEMX/qS5EqQnudrlkw0XLV5NsCvRZhbupMGVz2rdUePjjI5nuT2oMbLPmiiQBEeMUBlyOLX7Ekc2+md2xCuWoAyQsJ wacaca@corp.netease.com"}'
返回示例
{
"KeyName":"KeyPairTest22",
"Fingerprint":"26:f5:88:5f:5b:ce:5b:de:e2:58:e4:37:ac:cb:ee:81",
"Message":"处理成功",
"RequestId":"ae4dd21c-07ee-4aed-b6e0-3e657ff77150",
"CreateTime":"2018-08-21T01:59:02Z",
"Id":3633,
"Code":"Success"
}