Query the running policy list¶
Query the running policy configuration in the workspace.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/runtime-policy-profiles
Preparation before calling¶
Prepare a personal access token and target workspace ID that has access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: The workspace ID to be queried, passed through theX-Workspace-IDHeader, and asworkspace_idin the path.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/runtime-policy-profiles?limit=20" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID, must be consistent with |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Filter by policy status. |
|
string |
No |
Filter by scope type. |
|
string |
No |
Filter by scope reference. |
|
string |
No |
Query by name or related text. |
|
integer |
No |
Returns the upper limit of quantity. |
|
integer |
No |
Returns the offset. |
Successful response¶
Returns 200 on success. data.items is the policy list, data.total, data.limit and data.offset describe the list range.
{
"code": 0,
"data": {
"items": [
{
"id": "policy_01",
"name": "默认运行限制",
"status": "active",
"scope_type": "workspace",
"version": 1
}
],
"total": 1,
"limit": 20,
"offset": 0
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array |
Run policy list. |
|
string |
Run policy ID. |
|
string |
Policy name and status. |
|
string |
Policy name and status. |
|
string |
Scope types and references. |
|
string |
Scope types and references. |
|
integer |
Policy version. |
|
integer |
The total number of filter results, the current return upper limit and offset. |
|
integer |
The total number of filter results, the current return upper limit and offset. |
|
integer |
The total number of filter results, the current return upper limit and offset. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 2,
"message": "运行策略参数无效"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid workspace or filter parameters. |
Check path and query parameters. |
|
|
Credentials are missing or invalid. |
Check API Key. |
|
|
The current identity does not have read permission. |
Use valid credentials, or contact your administrator for authorization. |
|
|
The running policy service is unavailable. |
Try again later. |
Follow-up operations¶
Use policy ID Query the details of the running strategy.