• 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 SSH Key Pairs (Native OpenStack API)

Querying SSH Key Pairs (Native OpenStack API)

Function

This interface is used to query SSH key pairs and to display the query results in a list.

Constraints

Pagination query is not supported.

URI

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

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Request Message

N/A

Response Message

  • Response parameters

    Parameter

    Type

    Description

    keypairs

    List data structure. For details, see [1] keypairs field data structure description.

    Specifies the key pairs.

    [1] keypairs field data structure description

    Parameter

    Type

    Description

    keypair

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

    Specifies the key pair details.

    [2] keypair field data structure description

    Parameter

    Type

    Description

    fingerprint

    String

    Specifies fingerprint information about the key pair.

    name

    String

    Specifies the key pair name.

    type

    String

    Specifies the key type, which is ssh by default.

    This field is supported in microversions later than 2.2.

    public_key

    String

    Specifies information about the public key in the key pair.

  • Example response
    {
        "keypairs": [
            {
                "keypair": {
                    "fingerprint": "15:b0:f8:b3:f9:48:63:71:cf:7b:5b:38:6d:44:2d:4a",
                    "name": "keypair-601a2305-4f25-41ed-89c6-2a966fc8027a",
                    "type": "ssh",
                    "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC+Eo/RZRngaGTkFs7I62ZjsIlO79KklKbMXi8F+KITD4bVQHHn+kV+4gRgkgCRbdoDqoGfpaDFs877DYX9n4z6FrAIZ4PES8TNKhatifpn9NdQYWA+IkU8CuvlEKGuFpKRi/k7JLos/gHi2hy7QUwgtRvcefvD/vgQZOVw/mGR9Q== Generated-by-Nova"
                }
            }
        ]
    }

Returned Values

See section Common Returned Values.