• Bare Metal Server

bms
  1. Help Center
  2. Bare Metal Server
  3. API Reference
  4. API
  5. BMS SSH Key Pair Management (Native OpenStack APIs)
  6. Querying an SSH Key Pair (Native OpenStack API)

Querying an SSH Key Pair (Native OpenStack API)

Function

This interface is used to query a specified SSH key pair based on the key pair name.

URI

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

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

keypair_name

Yes

Specifies the key pair name.

Request Message

N/A

Response Message

  • Response parameters

    Parameter

    Type

    Description

    keypair

    Dictionary data structure. For details, see [1] keypair field data structure description.

    Specifies information about the SSH key pair.

    [1] keypair field data structure description

    Parameter

    Type

    Description

    public_key

    String

    Specifies information about the public key in the key pair.

    name

    String

    Specifies the key pair name.

    fingerprint

    String

    Specifies fingerprint information about the key pair.

    created_at

    String:DateTime

    Specifies the time when the key pair was created.

    deleted

    Boolean

    Specifies the deleted key pair.

    • true: indicates that the key has been deleted.
    • false: indicates that the key is not deleted.

    deleted_at

    String:DateTime

    Specifies the time when the key pair was deleted.

    id

    String

    Specifies the key pair ID.

    updated_at

    String:DateTime

    Specifies the time when the key pair was updated.

    user_id

    String

    Specifies information about the user to which the key pair belongs.

  • 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",
            "updated_at": null,
            "user_id": "fake"
        }
    }

Returned Values

See section Common Returned Values.