Domain name for API request: ssm.intl.tencentcloudapi.com.
This API is used to create a secret for hosting an SSH key pair.
A maximum of 20 requests can be initiated per second for this API.
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 Params. The value used for this API: CreateSSHKeyPairSecret. |
| Version | Yes | String | Common Params. The value used for this API: 2019-09-23. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| SecretName | Yes | String | Credential name. It must be unique within the same region and can contain up to 128 bytes. It can contain only letters, digits, hyphens (-), and underscores (_), and must start with a letter or digit. |
| ProjectId | Yes | Integer | ID of the project to which the SSH key pair belongs after creation. |
| Description | No | String | Description used to describe the purpose and other details. It can contain up to 2,048 bytes. |
| KmsKeyId | No | String | Specifies the KMS CMK used to encrypt the credential. |
| Tags.N | No | Array of Tag | Tag list. |
| SSHKeyName | No | String | User-defined name of the SSH key pair. It can contain digits, letters, and underscores (_), must start with a digit or letter, and can contain up to 25 characters. |
| KmsHsmClusterId | No | String | ID of the dedicated KMS cluster. This parameter is valid only when KmsKeyId is empty and a valid HsmClusterId exists in KMS. |
| EncryptType | No | Integer | Credential encryption type Valid values:
Default value: 0 |
| Parameter Name | Type | Description |
|---|---|---|
| SecretName | String | Name of the created credential. |
| SSHKeyID | String | ID of the created SSH key. |
| SSHKeyName | String | Name of the created SSH key. |
| TagCode | Integer | Return code for tag operation. 0: Success; 1: Internal error; 2: Business processing error |
| TagMsg | String | Return message for tag operation. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to create an SSH key pair credential.
POST / HTTP/1.1
Host: ssm.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateSSHKeyPairSecret
<Common request parameters>
{
"SecretName": "test2-sshkey-secret",
"ProjectId": 0,
"Description": "Description information",
"KmsKeyId": "6abd1fdb-86d4-11ef-b72d-52540089bc41",
"Tags": [
{
"TagKey": "env",
"TagValue": "dev"
}
],
"SSHKeyName": "test2_key"
}
{
"Response": {
"RequestId": "591e2b21-20e9-4621-8e4a-2697b89e985a",
"SSHKeyID": "skey-e0vbh2ts",
"SSHKeyName": "test2_key",
"SecretName": "test2-sshkey-secret",
"TagCode": 0,
"TagMsg": "ok"
}
}
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 |
|---|---|
| FailedOperation | Operation failed. |
| FailedOperation.AccessKmsError | KMS operation failed. |
| InternalError | Internal error. |
| InvalidParameter | Parameter error. |
| InvalidParameterValue | Parameter value error. |
| InvalidParameterValue.TagKeysDuplicated | Duplicate tag key. |
| InvalidParameterValue.TagsNotExisted | The tag key or tag value does not exist. |
| LimitExceeded | The quota limit is exceeded. |
| MissingParameter | Missing parameter error. |
| OperationDenied | Operation denied. |
| RequestLimitExceeded | The number of requests exceeds the frequency limit. |
| ResourceInUse.SecretExists | The credential name already exists. |
| ResourceUnavailable.NotPurchased | The service has not been purchased. |
| UnauthorizedOperation | Unauthorized operation. |
| UnauthorizedOperation.AccessKmsError | Failed to access KMS. |
| UnknownParameter | Unknown parameter error. |
| UnsupportedOperation | The operation is not supported. |
피드백