Creating and Importing an SSH Key Pair (Native OpenStack API)

Function

This interface is used to create an SSH key pair or import a public key to generate a key pair.

After an SSH key is created, download the private key to a local directory. Then, you can use this private key to log in to the BMS. To ensure BMS security, the private key can be downloaded only once. Keep it secure.

URI

POST /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.

For how to obtain the project ID, see Obtaining Required Information.

Request

Response

Returned Values

Normal values

Returned Values

Description

200

The request has been successfully processed.

For details about other returned values, see Status Codes.

Error Codes

See Error Codes.