Create a run strategy¶
Create a running policy configuration for reference by the agent.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/runtime-policy-profiles
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that can access the target workspace.
Request body¶
Replace $WORKSPACE_ID, $CLOUDSIGMA_API_KEY in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/runtime-policy-profiles" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "默认运行限制",
"budgets": {
"max_steps": 20
}
}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID must be consistent with X-Workspace-ID. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
logo. |
|
string |
Yes |
Policy name. |
|
string |
No |
Strategy description. |
|
string |
No |
Policy status. |
|
string |
No |
Policy scope type. |
|
string |
When not in workspace |
Required when in non-workspace scope, provide non-null reference. |
|
object |
No |
Admission conditions. |
|
object |
No |
Budget constraints. |
|
object |
No |
Retry strategy. |
|
object |
No |
Data strategy. |
|
object |
No |
Product strategy. |
|
object |
No |
Run provider constraints. |
|
object |
No |
Tag key-value pairs. |
|
object |
No |
Annotation key-value pairs. |
|
object |
No |
Extended metadata. |
scope_type supports workspace, role, agent and provider_profile, and the default is workspace. When selecting other scopes, non-empty scope_ref must be filled in. When saving, only the reference format is verified and the existence of the resource is not checked.
status supports draft, active, disabled and archived.
id can be specified by yourself, and will be generated by the service when omitted or empty. status defaults to draft, scope_type defaults to workspace. workspace_id and user_id in the request are not used to specify the workspace or operator to which they belong.
The values labels and annotations only support strings or null. Other configuration objects can contain legal JSON extension fields. When created, the configuration object cannot be null.
When updating, omit the field or fill in null to retain the original value, and clear the object when filling in {}. An empty update will also increment the version. This interface does not check whether old versions have changed.
Successful response¶
{
"code": 0,
"data": {
"id": "policy_01",
"workspace_id": "ws_01",
"name": "默认运行限制",
"status": "active",
"scope_type": "workspace",
"budgets": {
"max_steps": 20
},
"version": 1,
"created_at": "2026-08-21T07:00:00Z",
"updated_at": "2026-08-21T07:00:00Z"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
Run policy ID. |
|
string |
The workspace ID to which it belongs. |
|
string |
Policy name and status. |
|
string |
Description. |
|
string |
Policy name and status. Values: |
|
string |
Scope types and references. References are only returned if they have a value. Values: |
|
string |
Scope types and references. References are only returned if they have a value. |
|
object |
Admission, budgeting, and retry configuration. Only returned if there is a value. |
|
object |
Admission, budgeting, and retry configuration. Only returned if there is a value. |
|
object |
Admission, budgeting, and retry configuration. Only returned if there is a value. |
|
object |
Data, Product and Provider Restrictions. Only returned if there is a value. |
|
object |
Data, Product and Provider Restrictions. Only returned if there is a value. |
|
object |
Data, Product and Provider Restrictions. Only returned if there is a value. |
|
integer |
Strategy version. |
|
object |
Tag mapping. |
|
object |
Annotation mapping. |
|
object |
Extended metadata. |
|
string |
Creator. |
|
string |
Last updated by. |
|
string |
Creation and update time. RFC 3339 time. |
|
string |
Creation and update time. RFC 3339 time. |
Error response¶
{
"code": 2,
"message": "运行策略参数无效"
}
Field |
Type |
Description |
|---|---|---|
|
integer |
error code. |
|
string |
Error message for the caller. |