Finalize SQL version

Save and finalize a draft version. After finalization this version is read-only and the SQL text cannot be updated.

HTTP
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.

Shell
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

ParameterTypeRequiredDescription
workbook_idstringRequiredThe ID of the SQL saved record.
version_idstringRequiredThe version ID in the SQL save record to be finalized.
sql_contentstringSQL 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.

JSON
{
  "code": 200,
  "data": null
}

The response fields are as follows.

Field

Type

Description

data

null

Fixed to null when finalized successfully.

Error response

JSON
{
  "code": 400,
  "message": "请求参数无效"
}
FieldTypeDescription
codeinteger or stringError code or status.
messagestringError message.

Follow-up operations

After completion View saved SQL version content confirms the current status.

Last updated on