ModifyKeyPairAttribute

1. API Description

The API is used to modify the attributes of an SSH key pair.

Note

Only Description is supported to be modified for now.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter NameRequiredTypeDescription

keyId

Yes

String

Key pair ID.

For example: key-xxxxxxxx

keyDescription

No

String

Description of key pair.

Up to 255 characters in length are supported.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Code Example

Modify the attributes of an SSH key pair.

POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyKeyPairAttribute
<Common Request Params>

Request:
{
  "keyId": "key-xxxx",
  "keyDescription": "test-description"
}

Response:
{
  "requestId": "TE5661D09-28A7-4BDA-ACB1-106EDD916682",
  "response": {
    "requestId": "TE5661D09-28A7-4BDA-ACB1-106EDD916682"
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

HTTP Status CodeError CodeDescription

404

INVALID_KEY_PAIR_NOT_FOUND

Key pair not found.

Last updated