Update calculation specifications¶
Update the definition of a calculation specification.
PUT $CLOUDSIGMA_API_BASE/compute-resource-specs/{spec_id}
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. First query the calculation specification list to confirm the specifications to be updated. Prepare the personal access token, target workspace ID, and specification ID that can access the target workspace.
Request body¶
curl -X PUT "$CLOUDSIGMA_API_BASE/compute-resource-specs/$SPEC_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"id": "task-standard-small",
"kind": "task",
"family": "standard",
"family_name": "标准",
"family_name_en": "Standard",
"cpu_milli": 2000,
"memory_mib": 4096,
"gpu_count": 0,
"gpu_memory_mib": 0,
"gpu_cores": 0,
"credit_per_hour": 1,
"enabled": true
}'
When updating a scalar field, an empty string, 0, false, or null retains the old value. These values cannot be used when clearing text, GPU values, or prices. When the specification is disabled, the enable state interface is used.
When the scheduling configuration is omitted, the original value is retained. Clear the conditioning configuration when passing in {} or null.
Path parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The compute specification ID to update. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string or null |
No |
Spec ID. It must be provided consistent with |
|
string or null |
No |
Resource type. When filling in the blank string, |
|
string or null |
No |
Specification series. When filling in the blank string, |
|
string or null |
No |
Specification series name. When filling in the blank string, |
|
string or null |
No |
Specification series English name. When filling in the blank string, |
|
integer or null |
No |
CPU millicore count. When |
|
integer or null |
No |
Memory MiB. When |
|
integer or null |
No |
Number of GPUs. When |
|
integer or null |
No |
GPU memory MiB. When |
|
integer or null |
No |
Number of GPU cores. When |
|
number or null |
No |
Points price per hour. When |
|
string or null |
No |
Description of the current object. When filling in the blank string, |
|
object or null |
No |
Kubernetes node scheduling object. Only the defined Kubernetes scheduling fields are accepted. |
|
object or null |
No |
Node label selector. Objects allow extended keys. Node label selector. Both keys and values are Kubernetes legal labels. |
|
object or null |
No |
Affinity configuration. Kubernetes Pod affinity and anti-affinity rules. |
|
object or null |
No |
Node affinity conditions. Node affinity rules. |
|
object or null |
No |
Scheduling conditions that must be met. |
|
array of object or null |
No |
Node selection conditions. |
|
array of object or null |
No |
Label match expressions. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of object or null |
No |
Field matching expression. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of object or null |
No |
Prioritize matching scheduling conditions. |
|
integer |
No |
weight. |
|
object |
No |
priority conditions. |
|
array of object or null |
No |
Label match expressions. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of object or null |
No |
Field matching expression. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
object or null |
No |
Pod affinity conditions. Pod affinity rules. |
|
array of object or null |
No |
Scheduling conditions that must be met. |
|
object or null |
No |
Label selector. |
|
object or null |
No |
Tag matching conditions. Objects allow extended keys. |
|
array of object or null |
No |
Label match expressions. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of string or null |
No |
namespace. |
|
string |
No |
Topology label key. |
|
object or null |
No |
Namespace selector. |
|
object or null |
No |
Tag matching conditions. Objects allow extended keys. |
|
array of object or null |
No |
Label match expressions. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of string or null |
No |
Match key read from existing Pod tag. |
|
array of string or null |
No |
Mismatched keys read from existing Pod labels. |
|
array of object or null |
No |
Prioritize matching scheduling conditions. |
|
integer |
No |
weight. |
|
object |
No |
Pod affinity conditions. |
|
object or null |
No |
Label selector. |
|
object or null |
No |
Tag matching conditions. Objects allow extended keys. |
|
array of object or null |
No |
Label match expressions. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of string or null |
No |
namespace. |
|
string |
No |
Topology label key. |
|
object or null |
No |
Namespace selector. |
|
object or null |
No |
Tag matching conditions. Objects allow extended keys. |
|
array of object or null |
No |
Label match expressions. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of string or null |
No |
Match key read from existing Pod tag. |
|
array of string or null |
No |
Mismatched keys read from existing Pod labels. |
|
object or null |
No |
Pod anti-affinity condition. Pod anti-affinity rules. |
|
array of object or null |
No |
Scheduling conditions that must be met. |
|
object or null |
No |
Label selector. |
|
object or null |
No |
Tag matching conditions. Objects allow extended keys. |
|
array of object or null |
No |
Label match expressions. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of string or null |
No |
namespace. |
|
string |
No |
Topology label key. |
|
object or null |
No |
Namespace selector. |
|
object or null |
No |
Tag matching conditions. Objects allow extended keys. |
|
array of object or null |
No |
Label match expressions. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of string or null |
No |
Match key read from existing Pod tag. |
|
array of string or null |
No |
Mismatched keys read from existing Pod labels. |
|
array of object or null |
No |
Prioritize matching scheduling conditions. |
|
integer |
No |
weight. |
|
object |
No |
Pod affinity conditions. |
|
object or null |
No |
Label selector. |
|
object or null |
No |
Tag matching conditions. Objects allow extended keys. |
|
array of object or null |
No |
Label match expressions. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of string or null |
No |
namespace. |
|
string |
No |
Topology label key. |
|
object or null |
No |
Namespace selector. |
|
object or null |
No |
Tag matching conditions. Objects allow extended keys. |
|
array of object or null |
No |
Label match expressions. |
|
string |
No |
Match key. |
|
string |
No |
Match operator. |
|
array of string or null |
No |
Match values. |
|
array of string or null |
No |
Match key read from existing Pod tag. |
|
array of string or null |
No |
Mismatched keys read from existing Pod labels. |
|
array of object or null |
No |
Taint tolerance rules. List of rules that tolerate node taint. |
|
string |
No |
Match key. Taint key. It can be omitted when |
|
string |
No |
Match operator. Matching method: |
|
string |
No |
value. Taint value. |
|
string |
No |
stain effect. stain effect. When there is a value, it is |
|
integer or null |
No |
Tolerance seconds. Number of seconds to tolerate |
|
array of object or null |
No |
Topological distribution constraints. List of topological distribution constraints. |
|
integer |
No |
Maximum distribution deviation. The maximum allowed deviation between the same topological domains. |
|
string |
No |
Topology label key. Node label key used to divide topological domains. |
|
string |
No |
Scheduling method when constraints cannot be met. What to do when constraints are not met: |
|
object or null |
No |
Tag selector. Tag selector for matching Pods. |
|
object or null |
No |
Tag matching conditions. Objects allow extended keys. Tag key-value selector. |
|
array of object or null |
No |
Tag matching expression. List of label selection expressions. |
|
string |
No |
Match key. Tag key. |
|
string |
No |
Match operator. Tag operator. |
|
array of string or null |
No |
Match value. List of tag comparison values. |
|
integer or null |
No |
Minimum number of topological domains. Minimum number of available topology domains. |
|
string or null |
No |
Node affinity counting strategy. Node affinity policy. |
|
string or null |
No |
Node taint counting strategy. Node taint strategy. |
|
array of string or null |
No |
Match key read from existing Pod tag. Pod tag keys participating in the match. |
|
string |
No |
Priority class name. Kubernetes PriorityClass name. |
|
string |
No |
Runtime class name. Kubernetes RuntimeClass name. |
|
string |
No |
Scheduler name. Kubernetes scheduler name. |
|
boolean or null |
No |
false, null, or omitted retains the old enabled value. To disable, you need to call the enable state PATCH. |
|
string |
No |
The target label value corresponding to a node label key. |
|
string |
No |
The target tag value corresponding to a tag key. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": "task-standard-small",
"kind": "task",
"family": "standard",
"family_name": "标准",
"family_name_en": "Standard",
"cpu_milli": 2000,
"memory_mib": 4096,
"gpu_count": 0,
"gpu_memory_mib": 0,
"gpu_cores": 0,
"credit_per_hour": 1,
"description": "用于常规任务",
"node_placement": {},
"enabled": true,
"description_en": "",
"is_system": false,
"created_by": "user_01",
"updated_by": "user_01",
"created_at": "2026-10-14T00:00:00Z",
"updated_at": "2026-10-14T00:00:00Z"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
success code. |
|
string |
Response information. |
|
object |
The data returned by this operation. |
|
string |
Updated spec ID. |
|
string |
Resource type. The values are |
|
string |
Spec family identifier. |
|
string |
Spec family name. |
|
string |
English name of the specification family. |
|
integer |
CPU capacity in millicores. |
|
integer |
Memory capacity in MiB. |
|
integer |
Number of GPUs. |
|
integer |
GPU memory in MiB. |
|
integer |
Number of GPU cores. |
|
number |
Credit usage per hour. |
|
string |
Specifications. |
|
string |
English specifications. System specifications can be returned. |
|
object |
Kubernetes node scheduling object. Only the defined Kubernetes scheduling fields are accepted. |
|
object |
Node label selector. Both keys and values are legal Kubernetes label objects that allow extended keys. |
|
object |
Kubernetes Pod affinity and anti-affinity rules. |
|
object |
Node affinity rules. |
|
object |
Scheduling conditions that must be met. |
|
array of object |
Node selection conditions. |
|
array of object |
Label match expressions. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of object |
Field matching expression. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of object |
Prioritize matching scheduling conditions. |
|
integer |
weight. |
|
object |
priority conditions. |
|
array of object |
Label match expressions. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of object |
Field matching expression. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
object |
Pod affinity rules. |
|
array of object |
Scheduling conditions that must be met. |
|
object |
Label selector. |
|
object |
The label-matching condition object accepts additional keys. |
|
array of object |
Label match expressions. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of string |
namespace. |
|
string |
Topology label key. |
|
object |
Namespace selector. |
|
object |
The label-matching condition object accepts additional keys. |
|
array of object |
Label match expressions. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of string |
Match key read from existing Pod tag. |
|
array of string |
Mismatched keys read from existing Pod labels. |
|
array of object |
Prioritize matching scheduling conditions. |
|
integer |
weight. |
|
object |
Pod affinity conditions. |
|
object |
Label selector. |
|
object |
The label-matching condition object accepts additional keys. |
|
array of object |
Label match expressions. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of string |
namespace. |
|
string |
Topology label key. |
|
object |
Namespace selector. |
|
object |
The label-matching condition object accepts additional keys. |
|
array of object |
Label match expressions. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of string |
Match key read from existing Pod tag. |
|
array of string |
Mismatched keys read from existing Pod labels. |
|
object |
Pod anti-affinity rules. |
|
array of object |
Scheduling conditions that must be met. |
|
object |
Label selector. |
|
object |
The label-matching condition object accepts additional keys. |
|
array of object |
Label match expressions. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of string |
namespace. |
|
string |
Topology label key. |
|
object |
Namespace selector. |
|
object |
The label-matching condition object accepts additional keys. |
|
array of object |
Label match expressions. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of string |
Match key read from existing Pod tag. |
|
array of string |
Mismatched keys read from existing Pod labels. |
|
array of object |
Prioritize matching scheduling conditions. |
|
integer |
weight. |
|
object |
Pod affinity conditions. |
|
object |
Label selector. |
|
object |
The label-matching condition object accepts additional keys. |
|
array of object |
Label match expressions. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of string |
namespace. |
|
string |
Topology label key. |
|
object |
Namespace selector. |
|
object |
The label-matching condition object accepts additional keys. |
|
array of object |
Label match expressions. |
|
string |
Match key. |
|
string |
Match operator. |
|
array of string |
Match values. |
|
array of string |
Match key read from existing Pod tag. |
|
array of string |
Mismatched keys read from existing Pod labels. |
|
array of object |
List of rules that tolerate node taint. |
|
string |
Taint key. It can be omitted when |
|
string |
Matching method: |
|
string |
Taint value. |
|
string |
stain effect. When there is a value, it is |
|
integer |
Number of seconds to tolerate |
|
array of object |
List of topological distribution constraints. |
|
integer |
The maximum allowed deviation between the same topological domains. |
|
string |
Node label key used to divide topological domains. |
|
string |
What to do when constraints are not met: |
|
object |
Tag selector for matching Pods. |
|
object |
Tag key value selector objects allow extended keys. |
|
array of object |
List of label selection expressions. |
|
string |
Tag key. |
|
string |
Tag operator. |
|
array of string |
List of tag comparison values. |
|
integer |
Minimum number of available topology domains. |
|
string |
Node affinity strategy. |
|
string |
Node taint strategy. |
|
array of string |
Pod tag keys participating in the match. |
|
string |
Priority class name. |
|
string |
Runtime class name. |
|
string |
Scheduler name. |
|
boolean |
Updated enabled status. |
|
boolean |
Whether it is a built-in specification of the system. |
|
string |
Creator ID. |
|
string |
Last updated by identifier. |
|
string |
Creation time. In RFC 3339 format. |
|
string |
Last updated. In RFC 3339 format. |
Error response¶
{
"code": "INVALID_PARAMS",
"msg": "family_name_en is required",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |
|
null |
Empty on error. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |