Create folder¶
Create a folder under a volume or existing folder.
POST $CLOUDSIGMA_API_BASE/catalog/folder/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 object in the database to obtain the parent volume or parent folder ID. Prepare the personal access token, target workspace ID, and parent volume or parent folder ID that can access the target workspace. The caller needs write access to the root volume.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/folder/create" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"parent_volume_id": '"$VOLUME_ID"',
"database_id": '"$DATABASE_ID"',
"name": "<FOLDER_NAME>",
"description": "<FOLDER_DESCRIPTION>"
}'
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
Parent volume or parent folder ID. The service resolves it to the root volume. |
|
integer |
Yes |
The database ID to which it belongs. |
|
string |
Yes |
Folder name, must be a valid identifier. |
|
string |
No |
Folder description. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": 901
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
integer |
The ID of the new folder will be used for subsequent directory queries and operations. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "Bad Request"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |