查询流程列表
功能介绍
查询流程列表
调用方法
请参见如何调用API。
URI
GET /v1/{project_id}/workspaces/{workspace_id}/soc/workflows
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
参数解释: 项目ID,用于明确项目归属,配置后可通过该ID查询项目下资产,可以通过调用API获取,也可以从控制台获取。获取项目ID 约束限制: 不涉及 取值范围: 不涉及 默认取值: 不涉及 |
workspace_id |
是 |
String |
参数解释: 工作空间ID 取值范围: 不涉及 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
offset |
否 |
Integer |
参数解释: 偏移量 约束限制: 0-10000 取值范围: 不涉及 默认取值: 0 |
limit |
否 |
Integer |
参数解释: 数据量 约束限制: 1-100 取值范围: 不涉及 默认取值: 10 |
order |
否 |
String |
参数解释: 排序顺序
约束限制: 不涉及 取值范围:
默认取值: DESC |
sortby |
否 |
String |
参数解释: 排序字段,
约束限制: 不涉及 取值范围:
默认取值: create_time |
enabled |
否 |
Boolean |
参数解释: 是否已启用 约束限制: 不涉及 取值范围:
默认值: fasle |
name |
否 |
String |
参数解释: 流程名称 约束限制: 不涉及 取值范围: 不涉及 默认值: 不涉及 |
description |
否 |
String |
参数解释: 流程描述 约束限制: 不涉及 取值范围: 不涉及 默认值: 不涉及 |
dataclass_id |
否 |
String |
参数解释: 数据类的ID 约束限制: 不涉及 取值范围: 不涉及 默认值: 不涉及 |
dataclass_name |
否 |
String |
参数解释: 数据类名称 约束限制: 不涉及 取值范围: 不涉及 默认值: 不涉及 |
aop_type |
否 |
String |
参数解释: 流程的类型
约束限制: 不涉及 取值范围:
默认值: 不涉及 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
参数解释: 用户Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。获取用户Token 约束限制: 不涉及 取值范围: 不涉及 默认取值: 不涉及 |
content-type |
是 |
String |
参数解释: 内容类型
约束限制: 不涉及 取值范围:
默认取值: 不涉及 |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
X-request-id |
String |
请求ID,格式为:request_uuid-timestamp-hostname |
参数 |
参数类型 |
描述 |
---|---|---|
code |
String |
参数解释: 响应的返回码 约束限制: 不涉及 |
total |
Integer |
参数解释: 数据总条数 约束限制: 不涉及 |
offset |
Integer |
参数解释: 当前页大小 约束限制: 不涉及 |
limit |
Integer |
参数解释: 当前页码 约束限制: 不涉及 |
message |
String |
参数解释: 响应的错误信息 约束限制: 不涉及 |
success |
Boolean |
参数解释: 是否成功 取值范围:
|
data |
Array of AopWorkflowInfo objects |
参数解释: 流程信息列表 取值范围: 不涉及 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
参数解释: 流程ID 取值范围: 不涉及 |
name |
String |
参数解释: 流程名称 取值范围: 不涉及 |
description |
String |
参数解释: 流程的描述 取值范围: 不涉及 |
project_id |
String |
参数解释: 租户ID 取值范围: 不涉及 |
owner_id |
String |
参数解释: 所有者ID 取值范围: 不涉及 |
creator_id |
String |
参数解释: 创建者ID 取值范围: 不涉及 |
edit_role |
String |
参数解释: 编辑角色 取值范围: 不涉及 |
use_role |
String |
参数解释: 使用角色 取值范围: 不涉及 |
approve_role |
String |
参数解释: 审核角色 取值范围: 不涉及 |
enabled |
Boolean |
参数解释: 是否已启用 取值范围:
|
workspace_id |
String |
参数解释: 工作空间ID 取值范围: 不涉及 |
version_id |
String |
参数解释: 流程激活版本ID 取值范围: 不涉及 |
current_approval_version_id |
String |
参数解释: 当前待审核版本ID 取值范围: 不涉及 |
current_rejected_version_id |
String |
参数解释: 当前拒绝的版本ID 取值范围: 不涉及 |
aop_type |
String |
参数解释: 流程的类型
取值范围:
|
engine_type |
String |
参数解释: 引擎的类型
取值范围:
|
dataclass_id |
String |
参数解释: 数据类的ID 取值范围: 不涉及 |
labels |
String |
参数解释: 流程实体类型
取值范围:
|
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
X-request-id |
String |
请求ID,格式为:request_uuid-timestamp-hostname |
参数 |
参数类型 |
描述 |
---|---|---|
code |
String |
参数解释: 错误码 取值范围: 不涉及 |
message |
String |
参数解释: 错误描述 取值范围: 不涉及 |
请求示例
查询流程列表,偏移量为0,查询10条
https://{endpoint}/v1/{project_id}/workspaces/{workspace_id}/soc/workflows?offset=0&limit=10
响应示例
状态码:200
请求成功
{ "code" : "00000000", "data" : [ { "aopSource" : "", "aop_type" : "NORMAL", "approve_role" : "", "create_time" : "2025-07-18T11:28:27.000Z+0800", "creator_id" : "5857617f6b8b4981baef587c08ab8b68", "creator_name" : "w60063692", "current_approval_version_id" : "", "current_rejected_version_id" : "", "dataclass_id" : "e410ae50-43fa-343e-807a-a2a9edb8018e", "dataclass_name" : "Alert", "description" : "desc", "domain_id" : "", "edit_role" : "", "enabled" : false, "engine_type" : "public_engine", "favorite" : null, "id" : "89262e34-4e5f-4cb2-9308-0b30e3d6e778", "labels" : "IP", "modifier_id" : "", "modifier_name" : "", "name" : "test001", "owner_id" : "", "project_id" : "f69081793d9e4ea8a2f479dcef961989", "update_time" : "2025-07-18T11:28:27.000Z+0800", "use_role" : "", "version" : "", "version_id" : "", "workspace_id" : "f44065f5-557b-4376-ae02-8c65ef1960f4" } ], "message" : "", "page" : 0, "request_id" : "", "size" : 10, "success" : true, "total" : 1 }
SDK代码示例
SDK代码示例如下。
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.secmaster.v2.region.SecMasterRegion; import com.huaweicloud.sdk.secmaster.v2.*; import com.huaweicloud.sdk.secmaster.v2.model.*; public class ListWorkflowsSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); SecMasterClient client = SecMasterClient.newBuilder() .withCredential(auth) .withRegion(SecMasterRegion.valueOf("<YOUR REGION>")) .build(); ListWorkflowsRequest request = new ListWorkflowsRequest(); request.withWorkspaceId("{workspace_id}"); try { ListWorkflowsResponse response = client.listWorkflows(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdksecmaster.v2.region.secmaster_region import SecMasterRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdksecmaster.v2 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = SecMasterClient.new_builder() \ .with_credentials(credentials) \ .with_region(SecMasterRegion.value_of("<YOUR REGION>")) \ .build() try: request = ListWorkflowsRequest() request.workspace_id = "{workspace_id}" response = client.list_workflows(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
Go
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := secmaster.NewSecMasterClient( secmaster.SecMasterClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ListWorkflowsRequest{} request.WorkspaceId = "{workspace_id}" response, err := client.ListWorkflows(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
请求成功 |
400 |
查询数据类列表错误返回body体 |
错误码
请参见错误码。