Finalize SQL version¶
Save and finalize a draft version. After finalization this version is read-only and the SQL text cannot be updated.
POST $CLOUDSIGMA_API_BASE/workbook/version/save
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First list saved SQL versions and confirm the version status.
$WORKBOOK_ID in the example below is the ID of the SQL saved record and $VERSION_ID is the version ID with status draft. If you need to modify the finalized SQL, create a new draft version.
Request¶
Replace caller-specific values in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workbook/version/save" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{
\"workbook_id\": \"$WORKBOOK_ID\",
\"version_id\": \"$VERSION_ID\"
}"
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
workbook_id | string | Required | The ID of the SQL saved record. |
version_id | string | Required | The version ID in the SQL save record to be finalized. |
sql_content | string | SQL content saved together when finalizing. |
Successful response¶
data is empty on success. You can then View the version of the saved SQL to confirm that this version of status is finalize.
{
"code": 200,
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
null |
Fixed to |
Error response¶
{
"code": 400,
"message": "请求参数无效"
}
| Field | Type | Description |
|---|---|---|
code | integer or string | Error code or status. |
message | string | Error message. |
Follow-up operations¶
After completion View saved SQL version content confirms the current status.