View custom operator code¶
Read the source code of a custom operator. Source code may contain business logic or connection information, please save it according to your team’s code and key management requirements.
HTTP
GET $CLOUDSIGMA_API_BASE/workflow/v2/custom-operators/$OPERATOR_ID/code
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the custom operator list to confirm the operator to read the code.
Request¶
Shell
curl "$CLOUDSIGMA_API_BASE/workflow/v2/custom-operators/$OPERATOR_ID/code" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Request parameters
Successful response¶
The response returns the source code of the operator.
The response fields are as follows.
JSON
{
"code": "OK",
"msg": "OK",
"data": {
"source": "def handle(workspace_id, sdk, input):\\n return input"
}
}
| Field | Type | Description |
|---|---|---|
code | string | OK on success. |
msg | string | OK on success. |
data.source | string | Source code of custom operator. |
Error response¶
JSON
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
| Field | Type | Description |
|---|---|---|
code | string | Error code. |
msg | string | Readable error message. |
data | null | `null` in an error response. |
Follow-up operations¶
When modification is needed, Update custom operator. When returning the list query custom operator list.
Last updated on