查询分类树结构列表信息 - ListClassifications
功能介绍
功能介绍:查询分类树结构列表信息
调用方法
请参见如何调用API。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
- 如果使用身份策略授权,当前API调用无需身份策略权限。
URI
GET /v1/{project_id}/scan-templates/{template_id}/classifications
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| project_id | 是 | String | 参数解释: 项目ID。可参考获取项目ID获取。 约束限制: 不涉及 取值范围: 以IAM服务接口返回值为准,字符长度32-32。 默认取值: 不涉及 |
| template_id | 是 | String | 参数解释: 模板ID 约束限制: 不涉及 取值范围: 不涉及 默认取值: 不涉及 |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| X-Auth-Token | 是 | String | 参数解释: 用户Token。通过调用IAM服务查询用户Token接口获取(响应消息头中X-Subject-Token的值)。 约束限制: 不涉及 取值范围: IAM服务查询用户Token接口为准 默认取值: 不涉及 |
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| template_id | String | 参数解释: 模板ID 取值范围: 不涉及 |
| template_category | String | 参数解释: 模板类别 取值范围: 不涉及 |
| template_name | String | 参数解释: 模板名称 取值范围: 不涉及 |
| template_type | String | 参数解释: 模板分类信息类型 取值范围: 不涉及 |
| classification_trees | Array of TemplateClassificationTree objects | 参数解释: 分类树 取值范围: 不涉及 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| id | String | 参数解释: 资源ID,唯一标识 取值范围: 不涉及 |
| project_id | String | 参数解释: 项目ID 取值范围: 不涉及 |
| name | String | 参数解释: 分类名称 取值范围: 不涉及 |
| root_id | String | 参数解释: 模板分类树ID 取值范围: 不涉及 |
| parent_id | String | 参数解释: 父节点唯一标识符 取值范围: 不涉及 |
| depth | Integer | 参数解释: 分类深度 取值范围: 不涉及 |
| children_nums | Integer | 参数解释: 子节点数量 取值范围: 不涉及 |
| children | Array of TemplateClassificationTree objects | 参数解释: 子节点 取值范围: 不涉及 |
| create_time | Long | 参数解释: 创建时间 取值范围: 不涉及 |
| update_time | Long | 参数解释: 更新时间 取值范围: 不涉及 |
| rule_nums | Long | 参数解释: 规则数量 取值范围: 不涉及 |
| security_level_id | String | 参数解释: 模板分类树ID 取值范围: 不涉及 |
| security_level_name | String | 参数解释: 安全等级名称 取值范围: 不涉及 |
| description | String | 参数解释: 资源描述信息 取值范围: 不涉及 |
| sample_data | String | 参数解释: 样例数据 取值范围: 不涉及 |
请求示例
查询分类树结构列表信息
/v1/2b31ed520xxxxxxebedb6e57xxxxxxxx/scan-templates/{template_id}/classifications 响应示例
状态码:200
{
"template_id" : "7e1f2a3b-4c5d-4e6f-1a2b-0c9d8e7f6a5b",
"template_category" : "classification-01",
"template_name" : "scan-template-01",
"template_type" : "BUILT_IN",
"classification_trees" : [ {
"id" : "8f2a3b4c-5d6e-4f7a-2b3c-1d0e9f8a7b6c",
"project_id" : "2d52d09a-f0d3-4c1a-86b4-fc7e435e9c7a",
"name" : "classification-01",
"root_id" : "6d0e1f2a-3b4c-4d5e-0f1a-9b8c7d6e5f4a",
"parent_id" : "0b4c5d6e-7f8a-4b9c-4d5e-3f2a1b0c9d8e",
"depth" : 1,
"children_nums" : 10,
"children" : [ ],
"create_time" : 1700000000000,
"update_time" : 1700000000000,
"rule_nums" : 10,
"security_level_id" : "5c9d0e1f-2a3b-4c4d-9e0f-8a7b6c5d4e3f",
"security_level_name" : "classification-01",
"description" : "classification示例描述",
"sample_data" : "classification-01"
}, {
"id" : "8f2a3b4c-5d6e-4f7a-2b3c-1d0e9f8a7b6c",
"project_id" : "2d52d09a-f0d3-4c1a-86b4-fc7e435e9c7a",
"name" : "classification-01",
"root_id" : "6d0e1f2a-3b4c-4d5e-0f1a-9b8c7d6e5f4a",
"parent_id" : "0b4c5d6e-7f8a-4b9c-4d5e-3f2a1b0c9d8e",
"depth" : 1,
"children_nums" : 10,
"children" : [ ],
"create_time" : 1700000000000,
"update_time" : 1700000000000,
"rule_nums" : 10,
"security_level_id" : "5c9d0e1f-2a3b-4c4d-9e0f-8a7b6c5d4e3f",
"security_level_name" : "classification-01",
"description" : "classification示例描述",
"sample_data" : "classification-01"
} ]
} 状态码
| 状态码 | 描述 |
|---|---|
| 200 | 请求已成功 |
错误码
请参见错误码。