• Native OpenStack API

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

Querying a Key Pair

Function Description

This interface is used to query a single key pair.

Interface Format

Method

URI

Description

GET

/v2/{tenant_id}/os-keypairs/{keypair_name}

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

Queries a single key pair.

Restrictions

N/A

Expanded Interface

N/A

Request Parameter

N/A

Response Parameter

Table 1 Response Parameter

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 that is used for identification.

user_id

UUID

Yes

Specifies the user ID.

This field is newly added in version 2.10.

deleted

Boolean

Yes

Specifies whether a key pair is deleted.

created_at

String

Yes

Specifies the time when a key pair was created.

updated_at

Null

Yes

Specifies the last time when a key pair was updated.

deleted_at

Null

Yes

Specifies the time when a key pair was deleted.

id

Int

Yes

Specifies the key pair ID.

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/mykey

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

Response Example

{

            "keypair": {
                "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDdG2ek7tGR4NLPHDHntNdPBu0hnEA4mts9FL+fuqMQar5k+anndsqTwtD4WTfoRCoXBoiDAiEhiy1LOgr6GDgJorMYkfuKgdrdViz2meT2F5wiZnxm/gdnGLko2jYmwsla/wIvRtjzMRYR/ut1OMcqRXwyGtFXkO3VlE8YJRZj0TqjKmKaAwsa0mkVU1G2w1RjT8FDVt2qW+UVGggaqM3KZLs9rwn/K56X+eSraNx+BSBqDa+OX1h6Z1e8nRNVxYviOHL3FybcvlgZXLVWRUSBemS6P4xgQq0dapRB+D3/0N0hzY67FUQNfhFk4EsZCxKMxIi6EH7ueCssPTz5ESmp Generated by Nova\n",
"user_id": "84f52a2a8a0948fb8801cdf59a057650",
                "name": "mykey",
"deleted": false,
"created_at": "2016-05-24T12:03:55:181916",
"updated_at": null,
                "fingerprint": "60:b3:25:c5:44:42:fb:72:2e:2d:56:61:4a:2b:2c:14",
"deleted_at": null,
"id": 6
            }
        }

Returned Values

For details, see section General Request Returned Values.

Error Code

For details, see section General Request Returned Values.