Publish operator API service

Publish the specified version of the operator as a callable API service. Save the service name after successful publishing; it can be called after the service is enabled.

HTTP
POST $CLOUDSIGMA_API_BASE/workflow/v2/workitems/catalog/$NODE_ID/api-service

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

First View operator list to confirm the operator to be released and its version.

Request

Shell
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\",
    \"timeout_seconds\": 30
  }"

Request body

ParameterTypeRequiredDescription
node_idstringRequiredThe operator ID to be published. It can be obtained from the [View operator list](../operator-catalog/list-operators.md) response.
versionstringRequiredThe operator version to be released.
compute_resource_idstringSpecifies the computing resource ID for the service.
timeout_secondsintegerSingle call timeout, in seconds. When 0 is not passed or 0 is passed, it is 30, and the maximum value is 300.
max_concurrencyintegerThe maximum number of concurrent calls, cannot be a negative number.
rate_limit_per_minintegerMaximum number of calls per minute, cannot be negative.

Successful response

The response returns service identification, status, calling address and configuration. After successful publishing, the service can be called; use the returned service name as it is for call service.

The response fields are as follows.

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "service": {
      "api_service_id": "api_2e859efcedc1e0efea48b465b2197784",
      "node_id": "moi:data.sql.process",
      "version": "v1",
      "service_name": "operator-api-37f61ebdaa18aa51",
      "status": "ready",
      "method": "POST",
      "path": "/workspaces/ws-001/dynamic-services/invoke",
      "result_mode": "<result_mode>",
      "invoke": {
        "method": "POST",
        "path": "/workspaces/ws-001/dynamic-services/invoke",
        "result_mode": "<result_mode>",
        "body_example": {
          "service_name": "operator-api-37f61ebdaa18aa51",
          "payload": {}
        }
      }
    }
  }
}
FieldTypeDescription
codestringOK on success.
msgstringOK on success.
data.service.api_service_idstringService ID.
data.service.operator_idintegerPublished custom operator ID.
data.service.node_idstringPublished operator ID.
data.service.versionstringPublished operator version.
data.service.service_namestringService name.
data.service.statusstringService status. ready means it can be called.
data.service.result_modestringThe result return mode of the service.
data.service.auth_modestringThe authentication mode of the service.
data.service.methodstringThe HTTP method used to call the service.
data.service.pathstringRelative path to the calling service.
data.service.workflow_idstringThe workflow ID associated with the service; returned if there is a value.
data.service.workflow_def_idstringThe workflow definition ID associated with the service; returned if there is a value.
data.service.workflow_version_idstringThe workflow version ID associated with the service; returned if there is a value.
data.service.compute_resource_idstringThe computing resource ID used; only returned if there is a value.
data.service.timeout_secondsintegerTimeout for a single call, in seconds; returned if there is a value.
data.service.max_concurrencyintegerThe maximum number of concurrent calls; returned when there is a value.
data.service.rate_limit_per_minintegerMaximum number of calls per minute; returned if there is a value.
data.service.input_schemastringThe serialized content of the input schema; returned if there is a value.
data.service.output_schemastringOutput the serialized content of schema; return if there is a value.
data.service.invokeobjectInformation required to call the service; returned if there is a value.
data.service.deploymentobjectService deployment information; returned if there is a value.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}
FieldTypeDescription
codestringError code.
msgstringReadable error message.
datanull`null` in an error response.

Follow-up operations

After completion View operator API service configuration confirms the current status.

Last updated on