ConoHa API Documantation

キーペア追加 - Compute API v2

Description
個数制限は 100 pair

Request URL

Compute API v2.0

POST /v2/​{tenant_id}​/os-keypairs

Request Paramters

Parameter Value Style Description
X-Auth-Token Userトークン header トークンID
tenant_id URI テナントID
name キーペア名 plain キーペア名
public_key (Optional) plain 公開鍵

Request Json(public_key指定時:ユーザが予め作成したKeyを設定する場合)

{
    "keypair": {
        "name": "keypair-dab428fe-6186-4a14-b3de-92131f76cd39",
        "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova"
    }
}

Request Json(public_key未指定時:NovaがKeyを作成する場合)

{
    "keypair": {
        "name": "keypair-dab428fe-6186-4a14-b3de-92131f76cd39",
    }
}

Normal response codes

200

Example (public_key指定時)
※エンドポイントURLにつきましては、お客様環境によって異なりますので、コントロールパネルにてご確認の上ご利用ください。

  • REQ
curl -i -X POST \
-H "Accept: application/json" \
-H "X-Auth-Token: 35941e7df872405d84e5b026dba8323c" \
-d '{"keypair": {"name": "keypair-dab428fe-6186-4a14-b3de-92131f76cd39","public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova"}}' \
https://compute.tyo1.conoha.io/v2/1864e71d2deb46f6b47526b69c65a45d/os-keypairs
  • RES
HTTP/1.1 200 OK
Date: Thu, 11 Dec 2014 05:43:25 GMT
Server: Apache
Content-Length: 430
Content-Type: text/html; charset=UTF-8

{
    "keypair": {
        "fingerprint": "1e:2c:9b:56:79:4b:45:77:f9:ca:7a:98:2c:b0:d5:3c",
        "name": "keypair-dab428fe-6186-4a14-b3de-92131f76cd39",
        "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova",
        "user_id": "ea63fc7a16bb4250aff7e203198eea22"
    }
}

Example (public_key未指定時)

  • REQ
curl -i -X POST \
-H "Accept: application/json" \
-H "X-Auth-Token: 35941e7df872405d84e5b026dba8323c" \
-d '{"keypair": {"name": "keypair-2"}}' \
https://compute.tyo1.conoha.io/v2/1864e71d2deb46f6b47526b69c65a45d/os-keypairs
  • RES
HTTP/1.1 200 OK
Date: Thu, 11 Dec 2014 05:43:25 GMT
Server: Apache
Content-Length: 430
Content-Type: text/html; charset=UTF-8

{
    "keypair": {
        "fingerprint": "05:83:13:70:51:06:d3:e2:77:bd:f5:5a:ea:60:94:e8",
        "name": "keypair-2",
        "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAw2DmP74QlG+2XJHd5HdiFIoCuDN7PE1W0dyL+6YqNb1eBA67\nymxV0sPrCkYOCyvaK6rL1PrNLFEOqwRJfYQXhfHv4ggqjGeKAAgoz56D5FqWGrSR\nHtGZdH8MxGalx8Gtv15lJsuc/YXYsoqXFCfgy4DbNgru2QkEUNrRwQVZYOj0jZ/f\ngaozYJ6wMa6+5ZwpNRdqlExUtFGARrLoVu/Ic8mokQcfrHpDv2qxUHlkn0IekHio\n5FbsutO3HJM4W6NjUaIug0ffi8JUclkxrlVuLtUGsrxv8fYQV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naiImcs24Jm/UdU6hcsJd+nghkhqaPWSpdCPysUMNmx7UUyso7lwpFQ6LaGVL5fU3\nKuPlFakCgYA3kCL8Fo68wLKlpc7Ftc4vTjYGit5BHFwcO6LbJh1TPsM5GJZ/tUgK\n+uQPTTQTuNaAamsJ1EbmB3+PMnIPKJxUvE+8UeQQyOrK1jgE6oenGGy9181I6nip\nfDkmfy2zNDPTLRRp1dp4Kpjz0ITm83IbQm4rwr65yQxwux6QT5PV+A==\n-----END RSA PRIVATE KEY-----\n",
        "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDYOY/vhCUb7Zckd7kd2IUigK4M3s8TVbR3Iv7pio1vV4EDrvKbFXSw+sKRg4LK9orqsvU+s0sUQ6rBEl9hBeF8e/iCCqMZ4oACCjPnoPkWpYatJEe0Zl0fwzEZqXHwa2/XmUmy5z9hdiyipcUJ+DLgNs2Cu7ZCQRQ2tHBBVlg6PSNn9+BqjNgnrAxrr7lnCk1F2qUTFS0UYBGsuhW78hzyaiRBx+sekO/arFQeWSfQh6QeKjkVuy607cckzhbo2NRoi6DR9+LwlRyWTGuVW4u1QayvG/x9hBWOi0reDiimFg6eexajgyBnX0jgcQTjYxV1Ly0bW4Dr+vTO8KZuFyN Generated-by-Nova\n",
        "user_id": "ea63fc7a16bb4250aff7e203198eea22"
    }
}