Enable operator API service¶
Enable the published operator API service. The service is available for calls after it is enabled.
POST $CLOUDSIGMA_API_BASE/workflow/v2/workitems/catalog/{node_id}/api-service/enable?version={version}
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 operator API service configuration, confirm that the service has been published and needs to be enabled, and obtain the operator ID and version. 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 parameters¶
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/enable?version=$VERSION" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The operator ID of the service to be enabled, located in the request path. |
|
string |
Yes |
operator version, located in the query parameters. |
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"
}
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
Descriptive text for request processing. |
|
object |
response data. |
|
object |
API service information. |
|
integer |
operator ID. Can be omitted if not set. |
|
string |
operator ID. |
|
string |
operator version. |
|
string |
Service name. |
|
string |
Updated 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. |