所属服务

keypair

Action

UploadKeyPair

Version

2018-02-08

Method

POST

描述

上传秘钥对公钥

请求参数

参数名称说明参数类型是否必填
ActionUploadKeyPairstring
Version2018-02-08string

Body

参数名称说明参数类型是否必填
KeyContent公钥内容string
KeyName秘钥名称string

返回参数

返回参数被覆盖

错误码

错误码(Code)错误提示(Message)http status code说明
Success处理成功200null
NoQuota超出配额400null
InvalidParameters参数非法400null
DuplicatedSecretKey秘钥已存在400null
InternalServerError服务内部错误500null
MissingParameter参数缺失400null

请求示例

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"
}