Updated on 2022-10-27 GMT+08:00

Querying Details About an SSH Key Pair (V2.1)

Function

This API is used to query details about an SSH key pair.

URI

  • URI format

    GET /v2.1/{project_id}/os-keypairs/{keypair_name}

  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

    keypair_name

    Yes

    String

    Name of an SSH key pair

Requests

None

Responses

Table 2 Response parameters

Parameter

Mandatory

Type

Description

keypair

Yes

Object

SSH key pair information. For details, see Table 3.

Table 3 keypair field description

Parameter

Mandatory

Type

Description

public_key

Yes

String

Public key information about an SSH key pair

name

Yes

String

Name of an SSH key pair

fingerprint

Yes

String

Fingerprint information about an SSH key pair

created_at

Yes

String

Time when an SSH key pair is created The value is a timestamp expressed in the number of seconds since 00:00:00 UTC on January 1, 1970.

deleted

Yes

Boolean

Tag that indicates an SSH key pair is deleted

deleted_at

Yes

String

Time when an SSH key pair is deleted The value is a timestamp expressed in the number of seconds since 00:00:00 UTC on January 1, 1970.

id

Yes

String

ID of an SSH key pair

updated_at

Yes

String

Time when an SSH key pair is updated The value is a timestamp expressed in the number of seconds since 00:00:00 UTC on January 1, 1970.

user_id

Yes

String

User to whom an SSH key pair belongs

is_key_protection

Yes

Boolean

Whether the private key of the SSH key pair is managed and protected.

description

Yes

String

Description of an SSH key pair

Examples

  • Example request

    None

  • Example response
    {
        "keypair": {
            "created_at": "2014-05-07T12:06:13.681238",
            "deleted": false,
            "deleted_at": null,
            "fingerprint": "9d:00:f4:d7:26:6e:52:06:4c:c1:d3:1d:fd:06:66:01",
            "id": 1,
            "name": "keypair-3582d8b7-e588-4aad-b7f7-f4e76f0e4314",
            "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYJrTVpcMwFqQy/oMvtUSRofZdSRHEwrsX8AYkRvn2ZnCXM+b6+GZ2NQuuWj+ocznlnwiGFQDsL/yeE+/kurqcPJFKKp60mToXIMyzioFxW88fJtwEWawHKAclbHWpR1t4fQ4DS+/sIbX/Yd9btlVQ2tpQjodGDbM9Tr9/+/3i6rcR+EoLqmbgCgAiGiVV6VbM2Zx79yUwd+GnQejHX8BlYZoOjCnt3NREsITcmWE9FVFy6TnLmahs3FkEO/QGgWGkaohAJlsgaVvSWGgDn2AujKYwyDokK3dXyeX3m2Vmc3ejiqPa/C4nRrCOlko5nSgV/9IXRx1ERImsqZnE9usB Generated-by-Nova\n",
            "updated_at": null,
            "user_id": "fake",
            "is_key_protection": true,
            "description": "keypair test"
        }
    }

    or

    {
        "error_code": "KPS.XXXX",
        "error_msg": "XXXX"
    }

Status Codes

For details, see Status Codes.