Create Catalog

Create a Catalog in the current workspace.

HTTP
POST $CLOUDSIGMA_API_BASE/catalog/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. Prepare a personal access token and target workspace ID that can access the target workspace.

Request body

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

Field

Type

Required

Description

name

string

Yes

Catalog name, must be a valid identifier.

description

string

No

Catalog description.

Successful response

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

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.id

integer or null

Create the ID of the new Catalog. When not provided by the server, it is null.

Error response

JSON
{
  "code": "ErrAlreadyExists",
  "msg": "Catalog 名称已存在"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on