Domain name for API request: cvm.tencentcloudapi.com.
This API is used to import key pairs.
SSL
tool before importing them.A maximum of 10 requests can be initiated per second for this API.
Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: cvm.ap-shanghai-fsi.tencentcloudapi.com
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common parameter. The value used for this API: ImportKeyPair. |
Version | Yes | String | Common parameter. The value used for this API: 2017-03-12. |
Region | Yes | String | Common parameter. For more information, please see the list of regions supported by the product. |
KeyName | Yes | String | Key pair name, which can contain numbers, letters, and underscores, with a maximum length of 25 characters. |
ProjectId | Yes | Integer | The ID of the project to which the created key pair belongs. You can retrieve the project ID in two ways: projectId in the response.If you want to use the default project, specify 0 for the parameter. |
PublicKey | Yes | String | Content of the public key in the key pair in the OpenSSH RSA format. |
Parameter Name | Type | Description |
---|---|---|
KeyId | String | Key pair ID |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
GET https://cvm.tencentcloudapi.com/?Action=ImportKeyPair
&KeyName=operation_key
&ProjectId=0
&PublicKey=ssh-rsa XXXXXXXXXXXX== skey_45071
&<Common request parameters>
{
"Response": {
"KeyId": "skey-4e5ty7i8",
"RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InternalServerError | Internal error. |
InvalidKeyPair.LimitExceeded | The number of key pairs exceeds the limit. |
InvalidKeyPairName.Duplicate | Key pair name already exists. |
InvalidKeyPairNameEmpty | The key name cannot be empty. |
InvalidKeyPairNameIncludeIllegalChar | The key name contains invalid characters. Key names can only contain letters, numbers and underscores. |
InvalidKeyPairNameTooLong | The key name cannot exceed 25 characters. |
InvalidParameterValue | Incorrect parameter value. |
InvalidProjectId.NotFound | Invalid project ID: the specified project ID does not exist. |
InvalidPublicKey.Duplicate | Invalid public key: the specified key already exists. |
InvalidPublicKey.Malformed | Invalid public key: the specified public key does not meet the OpenSSH RSA format requirements. |
MissingParameter | Missing parameter. |
Was this page helpful?