Publish operator API service¶
Publish the specified version of workflow operator as an API service. After publishing, check the service configuration to confirm the service status and the information required for calling.
POST $CLOUDSIGMA_API_BASE/workflow/v2/workitems/catalog/{node_id}/api-service
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 workflow operator list, select the operator and obtain the operator ID. Then Query workflow operator details to select the version to be released. Prepare personal access token and target workspace ID that can access the target workspace.
Select a custom operator enabled in the current workspace. The same operator name must be uniquely located in the workspace. System operators, disabled operators, or operators with the same name cannot be operated through this interface.
Request body¶
Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, $NODE_ID, and $VERSION with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workitems/catalog/$NODE_ID/api-service" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"version": "'"$VERSION"'",
"service_name": "sql-processor",
"timeout_seconds": 30
}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The operator ID to publish, located in the request path. |
|
string |
Yes |
The operator version to publish. |
|
string |
No |
The name used when calling the service, unique within the same workspace. Letters, numbers, hyphens and underscores are allowed and must start and end with letters or numbers. |
|
string |
No |
Specify the compute resource ID for the service. |
|
integer |
No |
Timeout for a single call, in seconds. When |
|
integer |
No |
The maximum number of concurrent calls, cannot be a negative number. |
|
integer |
No |
The maximum number of calls per minute, cannot be negative. |
The service name length is calculated in UTF-8 bytes, which is 3–64 bytes. When the name is omitted, existing services will retain their original names. The name is only generated when needed to create a service configuration.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"service": {
"node_id": "moi:data.sql.process",
"version": "v1",
"service_name": "operator-api-37f61ebdaa18aa51",
"status": "ready",
"result_mode": "oneshot",
"auth_mode": "api_key",
"method": "POST",
"path": "/workspaces/ws-001/dynamic-services/invoke",
"input_schema": "",
"output_schema": "",
"api_service_id": "api_2e859efcedc1e0efea48b465b2197784",
"invoke": {
"method": "POST",
"path": "/workspaces/ws-001/dynamic-services/invoke",
"result_mode": "oneshot",
"body_example": {
"service_name": "operator-api-37f61ebdaa18aa51",
"payload": {
"sql": "SELECT now()"
}
}
},
"workflow_id": "api_2e859efcedc1e0efea48b465b2197784",
"workflow_version_id": "version-example",
"timeout_seconds": 30,
"workflow_def_id": "definition-example",
"deployment": {
"service_name": "operator-api-37f61ebdaa18aa51",
"invoke": {
"method": "POST",
"path": "/workspaces/ws-001/dynamic-services/invoke",
"result_mode": "oneshot",
"body_example": {
"service_name": "operator-api-37f61ebdaa18aa51",
"payload": {
"sql": "SELECT now()"
}
}
}
}
}
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
Descriptive text for request processing. |
|
object |
response data. |
|
object |
API service information. |
|
integer |
The custom operator ID returned when customizing the operator source. Can be omitted if not set. |
|
string |
Published operator ID. |
|
string |
Published operator version. |
|
string |
Service name. |
|
string |
Service status. |
|
string |
workflow ID. Can be omitted if not set. |
|
string |
workflow definition ID. Can be omitted if not set. |
|
string |
workflow version ID. Can be omitted if not set. |
|
string |
Result return method. |
|
string |
Authentication method. |
|
string |
The HTTP method used by the call. |
|
string |
Service call path. Concatenated after the API base address when requesting. |
|
string |
JSON Schema of the input parameters. |
|
string |
JSON Schema of the output result. |
|
integer |
Call timeout in seconds. Can be omitted if not set. |
|
integer |
The maximum number of concurrent calls. Can be omitted if not set. |
|
integer |
Limit on the number of calls per minute. Can be omitted if not set. |
|
string |
The computing resource ID used. Can be omitted if not set. |
|
object |
Deployment information. Can be omitted if not set. |
|
string |
Service name. |
|
object |
Call configuration. Can be omitted if not set. |
|
string |
The HTTP method used by the call. |
|
string |
Service call path. Concatenated after the API base address when requesting. |
|
string |
Result return method. |
|
object |
Call request body example. Can be omitted if not set. |
|
object |
Deployed workflow version object. Omitted when not deployed or obtained. |
|
string |
Object ID. Can be omitted if not set. |
|
string |
The workspace ID to which it belongs. Can be omitted if not set. |
|
string |
workflow ID. Can be omitted if not set. |
|
integer |
Current version number. Can be omitted if not set. |
|
JSON value |
Saved workflow definition. The actual structure varies with version content. Omitted if not set. |
|
string |
Current status. Can be omitted if not set. Values: |
|
string |
Creator ID. Can be omitted if not set. |
|
string |
Creation time, in RFC 3339 format. Can be omitted if not set. |
|
string |
Release time. Can be omitted if not set. |
|
integer |
Operation type. Can be omitted if not set. Value: |
|
string |
JSON Schema of the input parameters. Can be omitted if not set. |
|
string |
JSON Schema of the output result. Can be omitted if not set. |
|
integer |
Result return method. Can be omitted if not set. Values: |
|
string |
Description. Can be omitted if not set. |
|
string |
JSON string for the run configuration. Can be omitted if not set. |
|
string |
Service ID. |
|
object |
Call configuration. |
|
string |
The HTTP method used by the call. |
|
string |
Service call path. Concatenated after the API base address when requesting. |
|
string |
Result return method. |
|
object |
Call request body example. Can be omitted if not set. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Readable error message. |