ImportKeyPair
1. API Description
The API is used to import an SSH key pair to log in to a Linux
instance.
Note
This request is to import an SSH key pair to be used for later instance login.
A key pair name and several public SSH keys are required.
2. Input Parameters
The following request parameter list only provides API request parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
keyName | Yes | String | Key pair name. Up to 32 characters in length are supported, containing letters, digits and special character -_ The names cannot be duplicated. For example: |
publicKey | Yes | String | Public SSH keys in |
keyDescription | No | String | Description of key pair. Up to 255 characters in length are allowed. |
3. Output Parameters
Parameter Name | Type | Description |
---|---|---|
requestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
keyId | String | Key pair ID. |
4. Code Example
Import an SSH key pair.
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 Code | Error Code | Description |
---|---|---|
400 | INVALID_KEY_NAME_MALFORMED | Key pair name error. |
400 | INVALID_PUBLIC_KEY_MALFORMED | Public key format error. |
400 | INVALID_KEY_PAIR_EXCEED_LIMIT | Quota limit exceeded. |
409 | INVALID_KEY_PAIR_NAME_EXIST | Key pair name duplicated. |
Last updated