Updated on 2026-06-09 GMT+08:00

Querying SSH Key Pair Details

Function

Querying SSH Key Pair Details

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    kps:SSHKeyPair:get

    Read

    SSHKeyPair *

    -

    kps:domainKeypairs:get

    -

URI

GET /v3/{project_id}/keypairs/{keypair_name}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details, see Obtaining a Project ID.

Constraints

N/A

Range

The value returned by the IAM API is used, which contains 32 characters.

Default Value

N/A

keypair_name

Yes

String

Definition

Key pair name

Constraints

Key pair name. The value can contain at most 255 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. It can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints

N/A

Range

Obtain the value by calling the IAM API for obtaining the user token.

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

keypair

KeypairDetail object

Definition

Key pair details

Range

N/A

Table 4 KeypairDetail

Parameter

Type

Description

name

String

Definition

Key pair name. The value can contain at most 255 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Range

N/A

id

Long

Definition

Key pair ID

Range

N/A

type

String

Definition

Key pair type

Range

  • ssh

  • x509

scope

String

Definition

Domain to which the key pair belongs, which can be tenant-level or user-level.

Range

  • domain

  • user

public_key

String

Definition

Public key information of an SSH key pair

Range

N/A

fingerprint

String

Definition

Fingerprint information about an SSH key pair

Range

N/A

is_key_protection

Boolean

Definition

Whether to host keys

Range

true or false

deleted

Boolean

Definition

Tag that indicates an SSH key pair is deleted

Range

true or false

description

String

Definition

SSH key pair description

Range

N/A

user_id

String

Definition

ID of the user to which the SSH key pair belongs

Range

N/A

create_time

Long

Definition

Timestamp when the SSH key pair was created, that is, the total seconds since January 1, 1970.

Range

N/A

delete_time

Long

Definition

Timestamp when the SSH key pair was deleted, that is, the total seconds since January 1, 1970.

Range

N/A

update_time

Long

Definition

Timestamp when the SSH key pair was updated, that is, the total seconds since January 1, 1970.

Range

N/A

frozen_state

Integer

Definition

Key frozen status

Range

  • 0: normal

  • 1: frozen due to common causes

  • 2: frozen by the public security bureau

  • 3: frozen due to common causes and frozen by the public security bureau

  • 4: frozen due to violations

  • 5: frozen due to common causes and violations

  • 6: frozen by the public security bureau and due to violations

  • 7: frozen by the public security bureau and due to common causes and violations

  • 8: frozen due to the lack of real-name authentication

  • 9: frozen due to common causes and the lack of real-name authentication

  • 10: frozen by the public security bureau and due to the lack of real-name authentication

key_id

String

Definition

Key ID

Range

N/A

algorithm

String

Definition

Algorithm

Range

N/A

Example Requests

None

Example Responses

Status code: 200

Request succeeded.

{
  "keypair" : {
    "name" : "1hprr3TI",
    "id" : 116248,
    "type" : "ssh",
    "scope" : "user",
    "public_key" : "ssh-rsa AAAGenerated-by-Nova",
    "fingerprint" : "65:ca:87:0a:16:86:59:ea:57:ea:18:37:58:e2:04:b0",
    "is_key_protection" : false,
    "deleted" : false,
    "description" : "12345",
    "user_id" : "6c2a33b1b8474d0dbac0a24297127525",
    "create_time" : 1581507580000,
    "delete_time" : null,
    "update_time" : null,
    "frozen_state" : 0
  }
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.