Create folder

Create a folder under a volume or existing folder.

HTTP
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

Shell
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

parent_volume_id

integer

Yes

Parent volume or parent folder ID. The service resolves it to the root volume.

database_id

integer

Yes

The database ID to which it belongs.

name

string

Yes

Folder name, must be a valid identifier.

description

string

No

Folder description.

Successful response

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

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.id

integer

The ID of the new folder will be used for subsequent directory queries and operations.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "Bad Request"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on