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

Querying the SSH Key Pair List

Function

Querying the SSH Key Pair List

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:list

    List

    SSHKeyPair *

    -

    kps:domainKeypairs:list

    -

URI

GET /v3/{project_id}/keypairs

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

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

String

Definition

Number of secrets returned on each page

Constraints

N/A

Range

1-1000

Default Value

1000

marker

No

String

Definition

Name of the last key pair on each page is used as a pagination tag. If this parameter is left blank, the first page is queried.

Constraints

Parameters marker and limit must be used together. If the number of records returned on the last page is less than the value of limit, the query ends.

Range

N/A

Default Value

N/A

Request Parameters

Table 3 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 4 Response body parameters

Parameter

Type

Description

keypairs

Array of Keypairs objects

Definition

SSH key pair list

Default Value

N/A

page_info

PageInfo object

Definition

Pagination information

Range

N/A

Table 5 Keypairs

Parameter

Type

Description

keypair

Keypair object

Definition

SSH key pair information

Default Value

N/A

Table 6 Keypair

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

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

frozen_state

String

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

Table 7 PageInfo

Parameter

Type

Description

next_marker

String

Definition

Query tag of the next page during pagination query

Range

N/A

previous_marker

String

Definition

Query tag of the previous page during pagination query

Range

N/A

current_count

Integer

Definition

Number of records on the current page

Range

N/A

Example Requests

None

Example Responses

Status code: 200

Request succeeded.

{
  "keypairs" : [ {
    "keypair" : {
      "name" : "1hprr3TI",
      "type" : "ssh",
      "scope" : "user",
      "public_key" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABjV8GvwpSs.....",
      "fingerprint" : "65:ca:87:0a:16:86:59:ea:57:ea:18:37:58:e2:04:b0",
      "is_key_protection" : false,
      "frozen_state" : 0
    }
  } ],
  "page_info" : {
    "next_marker" : "KeyPair-dxxx",
    "previous_marker" : "KeyPair-xxxx",
    "current_count" : 49
  }
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.