12.3. Showing SSH key details

GET /os-keypairs/{keypair_name}

Shows the details of a keypair with the specified name that is associated with the account.

Source: https://docs.openstack.org/api-ref/compute/#show-keypair-details

12.3.1. Request

Name In Type Description
keypair_name path string The keypair name.
user_id (Optional) query string

This allows administrative users to operate key-pairs of specified user ID.

New in version 2.10

12.3.1.1. Example

# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:8774/v2.1/f5d834d636c642c7bfe8af86139c6f26/os-keypairs/key1

12.3.2. Response

Name In Type Description
keypair body object Keypair object
created_at body string

The date and time when the resource was created. The date and time stamp format is ISO 8601

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is -05:00.

deleted body boolean A boolean indicates whether this keypair is deleted or not. The value is always false (not deleted).
deleted_at body none It is always null.
fingerprint body string The fingerprint for the keypair.
id body integer The keypair ID.
name body string A name for the keypair which will be used to reference it later.
public_key body string The keypair public key.
updated_at body none It is always null.
user_id body string The user_id for a keypair.
type body string

The type of the keypair. Allowed values are ssh or x509.

New in version 2.2

12.3.2.1. Status codes

12.3.2.1.1. Success

Code Reason
200 - OK Request was successful.

12.3.2.1.2. Error

Code Reason
401 - Unauthorized User must authenticate before making a request.
403 - Forbidden Policy does not allow current user to do this operation.
404 - Not Found The requested resource could not be found.

12.3.2.2. Example

{
  "keypair": {
    "public_key": "ssh-rsa AAAA<...> VSTOR-KEY-DESC:Key description",
    "user_id": "eb481bff7b7c4ec6a686646957d8064b",
    "name": "key1",
    "deleted": false,
    "created_at": "2020-01-31T12:56:51.515306",
    "updated_at": null,
    "fingerprint": "36:2e:c4:95:95:1a:4d:9d:81:82:3a:da:46:93:e1:1d",
    "deleted_at": null,
    "id": 1
  }
}