DescribeSecret

Last updated: 2021-09-13 16:19:00

1. API Description

Domain name for API request: ssm.tencentcloudapi.com.

This API is used to obtain the detailed attribute information of a Secret.

A maximum of 40 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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: DescribeSecret.
Version Yes String Common parameter. The value used for this API: 2019-09-23.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
SecretName Yes String Name of a Secret whose detailed information is to be obtained.

3. Output Parameters

Parameter Name Type Description
SecretName String Name of the Secret.
Description String Description of the Secret.
KmsKeyId String ID of the KMS CMK used for encryption.
CreateUin Integer Creator UIN.
Status String Credential status: Enabled, Disabled, PendingDelete, Creating, Failed.
DeleteTime Integer Deletion time, formatted as a Unix timestamp. For a Secret that is not in PendingDelete status, this value is 0.
CreateTime Integer Creation time.
SecretType Integer 0: user-defined secret; 1: database credential; 2: SSH key secret.
Note: this field may return null, indicating that no valid values can be obtained.
ProductName String Tencent Cloud service name.
Note: this field may return null, indicating that no valid values can be obtained.
ResourceID String Tencent Cloud service instance ID.
Note: this field may return null, indicating that no valid values can be obtained.
RotationStatus Boolean Whether to enable rotation. True: yes; False: no.
Note: this field may return null, indicating that no valid values can be obtained.
RotationFrequency Integer Rotation frequency in days by default.
Note: this field may return null, indicating that no valid values can be obtained.
ResourceName String Secret name. This field is only valid when the SecretType is set to 2 (SSH key secret).
Note: this field may return null, indicating that no valid values can be obtained.
ProjectID Integer Project ID. This field is only valid when the SecretType is set to 2 (SSH key secret).
Note: this field may return null, indicating that no valid values can be obtained.
AssociatedInstanceIDs Array of String ID of the CVM instance associated with the SSH key. ID. This field is only valid when the SecretType is set to 2 (SSH key secret).
Note: this field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Obtaining the secret details

Input Example

https://ssm.tencentcloudapi.com/?Action=DescribeSecret
&SecretName=test
&<Common request parameters>

Output Example

{
  "Response": {
    "Status": "xx",
    "Description": "xx",
    "CreateUin": 1,
    "ResourceID": "xx",
    "ProductName": "xx",
    "RotationStatus": true,
    "KmsKeyId": "xx",
    "RequestId": "xx",
    "SecretType": 0,
    "SecretName": "xx",
    "RotationFrequency": 1,
    "DeleteTime": 1,
    "CreateTime": 1,
    "ResourceName": "xxx",
    "ProjectID": 1,
    "AssociatedInstanceIDs": [
      "xxx"
    ]
  }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError An internal error occurred.
InvalidParameterValue The parameter value is invalid.
ResourceNotFound The resource does not exist.
ResourceUnavailable The resource is unavailable.
ResourceUnavailable.NotPurchased The service is not purchased.
UnauthorizedOperation The operation is unauthorized.