Create volume¶
Create a root volume under the specified database.
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¶
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 |
|---|---|---|---|
|
integer |
Yes |
Parent database ID. |
|
string |
Yes |
Volume name, must be a valid identifier. |
|
string |
No |
Volume description. |
|
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¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": 789
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
integer |
The ID of the new volume. |
Error response¶
{
"code": "ErrAlreadyExists",
"msg": "对象已存在"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |