tencent cloud

文档反馈

DescribeSecret

最后更新时间:2023-09-18 17:15:28

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 Params. The value used for this API: DescribeSecret.
Version Yes String Common Params. The value used for this API: 2019-09-23.
Region No String Common Params. This parameter is not required for this API.
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: enable rotation; False: disable rotation.
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.
TargetUin Integer UIN of the Tencent Cloud API key. This field is valid when the secret type is Tencent Cloud API key secret.
Note: this field may return null, indicating that no valid values can be obtained.
AdditionalConfig String Additional configuration of the 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

This example shows you how to obtain the secret details.

Input Example

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

Output Example

{
    "Response": {
        "Status": "Enabled",
        "Description": "hello",
        "CreateUin": 1,
        "ResourceID": "inst-1",
        "ProductName": "redis",
        "RotationStatus": true,
        "KmsKeyId": "abc-ddd",
        "RequestId": "abc-hhm",
        "SecretType": 0,
        "SecretName": "secret-a",
        "RotationFrequency": 1,
        "DeleteTime": 1,
        "CreateTime": 1,
        "ResourceName": "db-user1",
        "ProjectID": 1,
        "AssociatedInstanceIDs": [
            "inst-1"
        ],
        "TargetUin": 12345,
        "AdditionalConfig": "{}"
    }
}

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.
OperationDenied.RoleNotExist The role does not exist.
ResourceNotFound The resource does not exist.
ResourceUnavailable The resource is unavailable.
ResourceUnavailable.NotPurchased The service is not purchased.
UnauthorizedOperation The operation is unauthorized.