3.29.2. Create or import keypair

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

Generates or imports a keypair.

Normal response codes: 200

 3.29.2.1. Request

This table shows the URI parameters for the create or import keypair request:

NameTypeDescription

{tenant_id}

​String

The ID for the tenant or account in a multi-tenancy cloud.

 

Example 3.245. Create or import keypair: XML request

<keypair>
    <name>keypair-96bbe50e-05e1-4d59-9115-4779a3ebcc2e</name>
    <public_key>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova</public_key>
</keypair>

 

Example 3.246. Create or import keypair: JSON request

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

This operation does not require a request body.

 3.29.2.2. Response

 

Example 3.247. Create or import keypair: XML response

<?xml version='1.0' encoding='UTF-8'?>
<keypair>
  <public_key>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova</public_key>
  <user_id>fake</user_id>
  <name>keypair-96bbe50e-05e1-4d59-9115-4779a3ebcc2e</name>
  <fingerprint>1e:2c:9b:56:79:4b:45:77:f9:ca:7a:98:2c:b0:d5:3c</fingerprint>
</keypair>

 

Example 3.248. Create or import keypair: JSON response

{
    "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": "fake"
    }
}

This operation does not return a response body.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page


loading table of contents...