Create volume

Create a root volume under the specified database.

HTTP
POST $CLOUDSIGMA_API_BASE/catalog/volume/create

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 database list to obtain the target database ID. Prepare the personal access token, target workspace ID, and database ID that can access the target workspace.

Request body

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/volume/create" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "database_id": '"$DATABASE_ID"',
    "name": "<VOLUME_NAME>",
    "description": "<VOLUME_DESCRIPTION>"
  }'

Field

Type

Required

Description

database_id

integer

Yes

Parent database ID.

name

string

Yes

Volume name, must be a valid identifier.

description

string

No

Volume description.

catalog_id

integer

No

When the number is positive, it must be consistent with the Catalog to which the target database belongs. Inferred from database when omitted or non-positive.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": 789
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.id

integer

The ID of the new volume.

Error response

JSON
{
  "code": "ErrAlreadyExists",
  "msg": "对象已存在"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on