查询运行策略列表

查询工作区内的运行策略配置。

GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/runtime-policy-profiles

调用前准备

准备有目标工作区访问权限的个人访问令牌和目标工作区 ID。

请求参数

curl "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/runtime-policy-profiles?limit=20" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

字段

类型

必填

说明

workspace_id

string

当前工作区 ID,必须与 X-Workspace-ID 一致。

字段

类型

必填

说明

status

string

按策略状态筛选。

scope_type

string

按作用域类型筛选。

scope_ref

string

按作用域引用筛选。

query

string

按名称或相关文本查看。

limit

integer

返回数量上限。

offset

integer

返回偏移量。

成功响应

成功时返回 200data.items 为策略列表,data.totaldata.limitdata.offset 描述列表范围。

{
  "code": 0,
  "data": {
    "items": [
      {
        "id": "policy_01",
        "name": "默认运行限制",
        "status": "active",
        "scope_type": "workspace",
        "version": 1
      }
    ],
    "total": 1,
    "limit": 20,
    "offset": 0
  }
}

字段

类型

说明

code

integer

成功时为 0。

字段

类型

说明

data.limit

integer

本页请求的最大记录数。

data.offset

integer

本页第一条记录的零基偏移量。

字段

类型

说明

data.items[].status

string

策略名称和状态。

字段

类型

说明

data.total

integer

匹配记录总数。

data.items[].version

integer

策略版本。

字段

类型

说明

data.items

array

当前页的运行策略列表。

data.items[]

object

一条运行策略摘要。

data.items[].id

string

运行策略 ID。

data.items[].name

string

策略名称和状态。

data.items[].scope_type

string

作用域类型和引用。

data.items[].scope_ref

string

作用域类型和引用。

错误响应

{
  "code": 2,
  "message": "运行策略参数无效"
}

字段

类型

说明

code

integer

错误代码。

message

string

面向调用者的错误信息。

后续操作

使用策略 ID 查询运行策略详情

最后更新于