You need to enable JavaScript to run this app.
文档中心
密钥管理系统

密钥管理系统

复制全文
下载 pdf
凭据管理
DescribeSecrets - 列出凭据
复制全文
下载 pdf
DescribeSecrets - 列出凭据

调用本接口根据指定条件分页查询当前账号下的凭据列表。

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。

参数
类型
是否必填
示例值
描述
Action
String
是

DescribeSecrets

要执行的操作,取值:DescribeSecrets。

Version
String
是

2021-02-18

API的版本,取值:2021-02-18。

Filters
String
否

[{"Key":"SecretName","Values":["hello","world"]}]

查询符合指定条件的凭据,由 Key-Values 键值对组成。
Key
描述:需要查询的属性。
类型:String。
取值:
SecretName:凭据名称。
Trn:凭据 Trn。
SecretType:凭据类型。
SecretState:凭据状态。
ManagedState:是否为托管凭据。
OwningService:托管的云服务。
RotationState:凭据轮转状态。
Description:凭据描述。
CreationDateRange:凭据创建的时间范围。
UpdateDateRange:凭据更新的时间范围。
Values
描述:属性的具体取值。
类型:String 列表。
容量:1~10。
取值说明:
Key 取值为 SecretName 时:支持模糊搜索,不区分大小写,示例:["hello","world"]。
Key 取值为 Trn 时:支持模糊搜索,不区分大小写,示例:["kms","secret"]。
Key 取值为 SecretType 时:取值为 Generic、IAM、RDS、Redis、ECS,区分大小写,示例:["ECS","IAM"]。
Key 取值为 SecretState 时:取值为 Enable、Disable、PendingDelete,区分大小写,示例:["Enable","PendingDelete"]。
Key 取值为 ManagedState 时:取值为 true、false,区分大小写,示例:["true"]。
Key 取值为 OwningService 时:支持模糊搜索,不区分大小写,示例:["kms","tos"]。
Key 取值为 RotationState 时:取值为 Enable、Disable、Rotating,区分大小写,示例:["Enable","Rotating"]。
Key 取值为 Description 时:支持模糊搜索,不区分大小写,示例:["hello","world"]。
Key 取值为 CreationDateRange 时:必须填入开始时间和结束时间,示例:["2024-08-13 10:00:00","2024-08-14 10:00:00"]。
Key 取值为 UpdateDateRange 时:必须填入开始时间和结束时间,示例:["2024-08-13 10:00:00","2024-08-14 10:00:00"]。
Filters 同一个 Key 中的多个 Value 之间的逻辑关系为 OR,不同 Key 之间的逻辑关系为 AND。
例如:输入[{"Key":"SecretName", "Values":["hello","world"]},{"Key":"SecretType", "Values":["ECS"]}]时,语义为:(SecretName=hello OR SecretName=world) AND (SecretType=ECS)。
该参数需要传入 JSON 序列化后的字符串。

ProjectName
String
否

default

凭据所属项目名称

CurrentPage
Integer
否

1

分页查找的页码,取值 >= 1。默认值:1。

PageSize
Integer
否

20

分页查找的页面大小,取值:[1, 100]。默认值:20。

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构。

参数
类型
示例值
描述
Secrets
Array of Object

{
"ID": "d24a9f14-1a8b-4393-b66e-b77b766b6666",
"CreationDate": 1625818017,
"UpdateDate": 1625818017591,
"SecretName": "secret-9527",
"UID": "2100000282",
"Trn": "trn:kms:cn-beijing:2100000282:secrets/secret-9527",
"ProjectName": "default",
"Description": "test",
"SecretType": "Generic",
"Managed": false,
"ExtendedConfig": "",
"RotationState": "None",
"RotationInterval": 0
}

凭据信息

PageInfo
Object

"PageInfo": {
"TotalCount": 1,
"PageSize": 20,
"CurrentPage": 1,
"Count": 1
}

分页信息

请求示例

POST /?Action=DescribeSecrets&Version=2021-02-18 HTTP/1.1
Host: kms.cn-beijing.volcengineapi.com
Content-Type: application/json; charset=UTF-8
X-Date: 20240814T083317Z
X-Content-Sha256: 287e874e******d653b44d21e
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240814/cn-beijing/kms/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f

{
  "Filters": "[{\"Key\":\"SecretName\",\"Values\":[\"secret\",\"9527\"]}]",
  "ProjectName": "default",
  "CurrentPage": 1,
  "PageSize": 20
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "202408080951551860031671271B4C78",
    "Action": "DescribeSecrets",
    "Version": "2021-02-18",
    "Service": "kms",
    "Region": "cn-beijing"
  },
  "Result": {
    "Secrets": [
      {
        "ID": "d24a9f14-1a8b-4393-b66e-b77b766b6666",
        "CreationDate": 1625818017,
        "UpdateDate": 1625818017591,
        "SecretName": "secret-9527",
        "UID": "2100000282",
        "Trn": "trn:kms:cn-beijing:2100000282:secrets/secret-9527",
        "ProjectName": "default",
        "Description": "test",
        "SecretType": "Generic",
        "SecretState": "Enable",
        "EncryptionKey": "",
        "Managed": false,
        "OwningService": "",
        "ExtendedConfig": "",
        "RotationState": "None",
        "RotationInterval": 0
      }
    ],
    "PageInfo": {
      "TotalCount": 1,
      "PageSize": 20,
      "CurrentPage": 1,
      "Count": 1
    }
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
InvalidParameter

The request parameter %s is invalid.

请求参数格式、类型或取值不合法,请根据参数说明检查并修正请求。

403
Reject.Throttling.Action

The request of Action: %s upper limit is exceeded.

接口级请求频率超过限制,请降低请求速率后重试。

403
AccessDenied

User is not authorized to do this action

当前账号或子账号缺少执行该操作所需权限,请检查 IAM 授权策略。

403
SecretsManagerServiceNotOpen

Secrets Manager service not open yet. Please open the service and try again later.

服务未开通

500
UndefinedError

Undefined Internal Error. Pls Contact With Admin.

服务内部错误,请稍后重试;如持续出现,请联系技术支持。

502
InternalServiceError

Service has some internal Error. Pls Contact With Admin.

服务内部错误,请稍后重试;如持续出现,请联系技术支持。

最近更新时间:2026.09.03 18:02:14
这个页面对您有帮助吗?
有用
有用
无用
无用