1. Interface Description
Interface request domain name: cvm.api3.convergecloud.com.
This API (ImportKeyPair) is used to import key pairs.
- The feature of this API is to import key pairs into the user account without automatically associating them with instances. To associate, you can use the API AssociateInstancesKeyPairs.
- You need to specify the key pair name and the public key text of the key pair.
- If users have only a private key, they can convert the private key into a public key by using the
SSLtool and then import it.
Default interface request rate limit: 10 times per second.
Interface update time: 2020-05-19 04:15:05.
The interface only verifies the signature but does not authenticate.
2. Input Parameters
The following list of request parameters only lists interface request parameters and some public parameters, For a complete list of public parameters see public request parameters.
| Parameter name | Required | Allow NULL | Type | Description |
|---|---|---|---|---|
| Action | Yes | No | String | Public parameter, The value of this interface: ImportKeyPair |
| Version | Yes | No | String | Public parameter, The value of this interface: 2017-03-12 |
| Region | No | No | String | Public parameter,Regional information A list of supported geographies is available through the DescribeRegions interface |
| KeyName | Yes | No | String | Key pair name, can contain digits, letters, and underscores, with no more than 25 characters. Example: operation_key |
| ProjectId | Yes | No | Int64 | Project ID to which key pair belongs after creation. You can obtain a project ID in the following ways: projectId in the returned information from the API DescribeProjects.Example: 0 |
| PublicKey | Yes | No | String | Public key content of key pair, in the format of OpenSSH RSA.Example: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0ran+u+y09bSSoAbHBhJm2ivci0uwTif+/MqoGj5odBuGcDHGIBE7Th74ITXtbuqEXxdOSROi7DOVaTZa1MYe6qKGPAi5/8jlV8c9CKCezXr99A2Dps/eVPVn4yO2NhSXbr0U/voRxTqNprP0YLo25y1lVnN0vg0CfWL8DDYh6DkMMVufGikA7WVPdsHomTLlSPdlSLvCRZPHC7eBhkrznO0rnfM+cJY2fqqSrdI1kqtDRJNpNvPLaRnJsc3uoot2nGqrGD6yiwx2tvdLAqgQT5tASfvtTc3CTMMJRGIqm+CdG2S1y0VlMDmm9XHeVBmZuX5YDJPNGIOcBI2Cgrj5 skey-mk5eqeu6 |
3. Output Parameters
| Parameter name | Type | Description |
|---|---|---|
| KeyId | String | Key pair ID. Example: skey-4e5ty7i8 |
| RequestId | String | Unique request id, Each request will return. The RequestId of the request needs to be provided when locating the problem. |
4. Error Code
The following lists only the error codes related to the interface business logic, For other error codes, see public ErrorCode.
| Error Code | Description |
|---|---|
| InternalServerError | Internal operation error. |
| InvalidKeyPairNameTooLong | The key name exceeds 25 characters. |
| InvalidKeyPairNameEmpty | The key name is empty. |
| InvalidKeyPairName.Duplicate | The key pair names are duplicate. |
| InvalidKeyPair.LimitExceeded | The number of key pairs exceeds the limit. |
| MissingParameter | Parameters are missing. The request did not include mandatory parameters. |
| InvalidKeyPairNameIncludeIllegalChar | The key name includes illegal characters. The key name only supports letters, digits, and underscores. |
| InvalidParameterValue | Invalid parameter value. The format of the parameter value is incorrect or not supported, etc. |
| InvalidPublicKey.Duplicate | Invalid public key. The specified public key already exists. |
| InvalidPublicKey.Malformed | Invalid public key. The format of the specified public key format is incorrect and does not meet the OpenSSH RSA format requirements. |