tencent cloud

Feedback

ListSecrets

Last updated: 2024-11-11 16:38:53

    1. API Description

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

    This API is used to obtain the detailed information list of all Secrets. You can specify the filter fields and sorting order as needed.

    A maximum of 30 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: ListSecrets.
    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. This API only supports: ap-beijing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-shanghai, ap-singapore, ap-tokyo.
    Offset No Integer Starting position of the list, starting at 0. If not specified, 0 is used by default.
    Limit No Integer Maximum number of returned Secrets in a query. If not set or set to 0, 20 is used by default.
    OrderType No Integer Sorting order according to the creation time. If not set or set to 0, descending order is used; if set to 1, ascending order is used.
    State No Integer Filter based on credential status.
    The default value is 0, indicating to query all.
    1: query the list of credentials in Enabled status.
    2: query the list of credentials in Disabled status.
    3: query the list of credentials in PendingDelete status.
    4: query the list of credentials in PendingCreate status.
    5: query the list of credentials in CreateFailed status.
    The PendingCreate and CreateFailed status only take effect when SecretType is Tencent Cloud service credential
    SearchSecretName No String Filter according to Secret names. If left empty, this filter is not applied.
    TagFilters.N No Array of TagFilter Tag filter.
    SecretType No Integer 0 (default): user-defined secret.
    1: Tencent Cloud services secret.
    2: SSH key secret.
    3: Tencent Cloud API key secret.
    ProductName No String This parameter only takes effect when the value of the SecretType parameter is 1.\nWhen the value of SecretType is 1:
    If the ProductName value is empty, it means querying all types of Tencent Cloud product secrets;If the ProductName value is a specific cloud product value such as MySQL, it means querying MySQL database credential;If the ProductName value is multiple cloud product values, such as: Mysql, Tdsql-mysql, Tdsql_C_Mysql (multiple values are separated by commas in English), it means querying the secrets of three cloud product types;To query the list of supported cloud products, use the interface: DescribeSupportedProducts.

    3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Number of filtered Secrets according to State and SearchSecretName.
    SecretMetadatas Array of SecretMetadata List of Secret information.
    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.

    4. Example

    Example1 Obtaining the list of secret details

    Input Example

    https://ssm.tencentcloudapi.com/?Action=ListSecrets
    &Limit=2
    &SecretType=0
    &<Common request parameters>
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "SecretMetadatas": [
                {
                    "Status": "xx",
                    "Description": "xx",
                    "AssociatedInstanceIDs": [
                        "xx"
                    ],
                    "CreateUin": 1,
                    "ProjectID": 0,
                    "ProductName": "xx",
                    "RotationStatus": 0,
                    "SecretType": 0,
                    "KmsKeyId": "xx",
                    "KmsKeyType": "xx",
                    "SecretName": "xx",
                    "ResourceName": "xx",
                    "DeleteTime": 1,
                    "CreateTime": 1,
                    "NextRotationTime": 1,
                    "TargetUin": 0
                },
                {
                    "Status": "xx",
                    "Description": "xx",
                    "AssociatedInstanceIDs": [
                        "xx"
                    ],
                    "CreateUin": 1,
                    "SecretName": "xx",
                    "KmsKeyType": "xx",
                    "ProductName": "xx",
                    "SecretType": 0,
                    "KmsKeyId": "xx",
                    "RotationStatus": 0,
                    "ProjectID": 0,
                    "ResourceName": "xx",
                    "DeleteTime": 1,
                    "CreateTime": 1,
                    "NextRotationTime": 1,
                    "TargetUin": 0
                }
            ],
            "RequestId": "xx"
        }
    }
    

    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
    FailedOperation Operation failed.
    InternalError An internal error occurred.
    InvalidParameterValue The parameter value is invalid.
    ResourceUnavailable.NotPurchased The service is not purchased.
    UnauthorizedOperation The operation is unauthorized.