Showing SSH key details

GET /os-keypairs/{keypair_name}

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

Source: https://docs.openstack.org/api-ref/compute/index.html?expanded=show-keypair-details-detail#show-keypair-details

Request

Parameters

Name In Type Description
keypair_name path string The key pair name.
user_id (Optional) body string

The user ID for a key pair. This allows administrative users to upload keys for other users than themselves.

New in version 2.10

Example

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

Response

Parameters

Name In Type Description
keypair body object The 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 this example, the offset value is -05:00.

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

The type of the key pair. Allowed values are ssh or x509.

New in version 2.2

Status codes

Success

Code Reason
200 - OK Request was successful.

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.

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