Updated on 2023-05-06 GMT+08:00

Adding an SSH Key

Function

Adding an SSH Key

URI

POST /v1/users/sshkey

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token.

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

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

key

Yes

String

Key

Minimum: 0

Maximum: 2048

title

Yes

String

Name

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

PublicKey object

Result

status

String

Status code in a response

Table 4 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message

Table 5 PublicKey

Parameter

Type

Description

id

String

Key ID

Minimum: 1

Maximum: 40

key

String

Key

Minimum: 0

Maximum: 2048

title

String

Name

Example Requests

POST https://{endpoint}/v1/users/sshkey

{
  "title" : "z00464114@SZXG4Z004641141",
  "key" : "ssh-rsa AAAAB3NzaXXXXXXXX"
}

Example Responses

Status code: 200

OK

{
  "result" : {
    "id" : "1034531",
    "title" : "z00464114@SZXG4Z004641141",
    "key" : "ssh-rsa AAAAB3NzaC1yc2XXXXXxxXXX"
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.