• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Keypairs
  6. Querying Key Pairs

Querying Key Pairs

Function Description

This interface is used to query key pairs.

Interface Format

Method

URI

Description

GET

/v2/{tenant_id}/os-keypairs

/v2.1/{tenant_id}/os-keypairs

Queries key pairs.

Restrictions

N/A

Expanded Interface

N/A

Request Parameter

N/A

Response Parameter

Table 1 Response parameters

Parameter

Type

Mandatory

Description

public_key

String

Yes

Specifies the public key.

name

String

Yes

Specifies the name of a key pair.

fingerprint

String

Yes

Specifies the fingerprint used for identification.

user_id

UUID

Yes

Specifies the user ID.

This field is newly added in version 2.10.

type

String

Yes

Specifies the key type. The value is ssh or x509.

This field is newly added in version 2.2.

Request Example

GET  /v2/6fbe9263116a4b68818cf1edce16bc4f/os-keypairs
GET  /v2.1/6fbe9263116a4b68818cf1edce16bc4f/os-keypairs

Response Example

{
    "keypairs": [
        {
            "keypair": {
                "fingerprint": "15:b0:f8:b3:f9:48:63:71:cf:7b:5b:38:6d:44:2d:4a",
                "name": "keypair-601a2305-4f25-41ed-89c6-2a966fc8027a",
                "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC+Eo/RZRngaGTkFs7I62ZjsIlO79KklKbMXi8F+KITD4bVQHHn+kV+4gRgkgCRbdoDqoGfpaDFs877DYX9n4z6FrAIZ4PES8TNKhatifpn9NdQYWA+IkU8CuvlEKGuFpKRi/k7JLos/gHi2hy7QUwgtRvcefvD/vgQZOVw/mGR9Q== Generated-by-Nova\n"
            }
        }
    ]
}

Returned Values

For details, see section General Request Returned Values.

Error Code

For details, see section General Request Returned Values.