Domain name for API request: ssm.intl.tencentcloudapi.com.
For a user-defined secret, this API is used to obtain the plaintext information of the secret by specifying the secret name and version.
For a cloud product secret such as a Mysql secret, this API is used to obtain the plaintext information of a historical rotated secret by specifying the secret name and historical version number. To obtain the plaintext of the secret version currently in use, set the version number to SSM_Current.
A maximum of 500 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: GetSecretValue. |
| 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 | Specifies the name of the credential. |
| VersionId | No | String | Specifies the version ID of the credential to read. If only VersionId is passed, the specified version is read. For cloud product credentials and Redis/MongoDB credentials, the current version can be read through SSM_Current. Input limits: If VersionStage is also specified, both must point to the same version; Otherwise, ResourceNotFound is returned. For custom, cloud product, and Redis/MongoDB credentials, if neither VersionId nor VersionStage is specified, the version pointed to by the Stage_Current tag is read by default. If this tag is not set, InvalidParameterValue is returned, and it does not fall back to SSM_Current. |
| EncryptionPublicKey | No | String | PEM-format public key used to encrypt the returned credential value. RSA 2048 and SM2 are supported. If not specified, the credential value is returned in the original way. |
| EncryptionAlgorithm | No | String | Asymmetric encryption algorithm. It takes effect only when EncryptionPublicKey is specified. Supported algorithms: SM2, SM2_C1C3C2_ASN1, RSAES_PKCS1_V1_5, RSAES_OAEP_SHA_1, and RSAES_OAEP_SHA_256. The default value is SM2. |
| VersionStage | No | String | Tag used to select the credential version. It supports custom, cloud product, and Redis/MongoDB credentials. Valid values:
Only Stage_Current is supported, and it is case-sensitive. If only the tag is passed, the value is obtained based on the binding relationship. If it is passed together with VersionId, both must point to the same version. If neither is passed, Stage_Current is resolved by default. If this tag is not set, InvalidParameterValue is returned. |
| Parameter Name | Type | Description |
|---|---|---|
| SecretName | String | Credential name. |
| VersionId | String | Version number of the credential. |
| SecretBinary | String | If binary data is specified when creating a credential (CreateSecret), this field is returned and encoded in base64. The application needs to decode the base64 data to obtain the original data. |
| SecretString | String | If plaintext data is specified when creating a credential (CreateSecret), this field is returned. |
| 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. |
Obtaining the Plaintext Secret Information
POST / HTTP/1.1
Host: ssm.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: GetSecretValue
<Common request parameters>
{
"SecretName": "test3-secret",
"VersionId": "v3"
}
{
"Response": {
"RequestId": "91cec765-5604-4287-89b1-634357cfcd29",
"SecretBinary": "5Yet5o2udmFsdWUyCg==",
"SecretName": "test3-secret",
"SecretString": "Secret value3",
"VersionId": "v3"
}
}
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. |
| InvalidParameterValue | Parameter value error. |
| OperationDenied.RoleNotExist | Role does not exist. |
| ResourceNotFound | Resources do not exist. |
| ResourceNotFound.SecretNotExist | The credential does not exist. |
| ResourceUnavailable.NotPurchased | The service has not been purchased. |
| ResourceUnavailable.ResourceDisabled | The credential is disabled. |
| ResourceUnavailable.ResourcePendingDeleted | The credential is in the scheduled deletion state. |
| ResourceUnavailable.ResourceUninitialized | The credential is not initialized. |
| UnauthorizedOperation | Unauthorized operation. |
Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários