Batch parse workspace names

Batch resolves names by workspace ID and returns the IDs and names of resolvable items.

HTTP
POST $CLOUDSIGMA_API_BASE/data-share/workspaces/resolve-names

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 the personal access token that can access the target workspace, the target workspace ID, and the list of workspace IDs to be resolved.

Request body

The example uses jq to construct the JSON request body. Install jq before running, and set the environment variables in the example. Do not re-encode the JSON generated by jq.

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/data-share/workspaces/resolve-names" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  --data-binary "$(jq -n --arg TARGET_WORKSPACE_ID "$TARGET_WORKSPACE_ID" '
{
  "ids": [
    $TARGET_WORKSPACE_ID
  ]
}
')"

The ID list can be omitted and filled in with null or []. The service will ignore empty items and remove duplicates, retain the order of first occurrence, and query up to 200 different IDs.

No sharing relationship is required, and only workspace IDs and names in normal status are returned. Items not found are omitted, and an error is returned if the read fails. Querying the name does not mean that you have access rights to the workspace.

Field

Type

Required

Description

ids

array of string

No

The workspace ID to be resolved. Can be omitted, null or empty array, up to 200 deduplication IDs.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "workspaces": [
      {
        "id": "ws-02",
        "name": "分析工作区"
      }
    ]
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

object

response data.

data.workspaces

array of object

Resolvable workspace list.

data.workspaces[].id

string

workspace ID.

data.workspaces[].name

string

workspace name.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

Error description.

data

null

Empty on error.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

ErrWorkspaceRequired, ErrParamInvalid

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

403

ErrPermissionDenied

The current identity or active role does not have permission for this operation.

Use an authorized identity or contact an administrator to grant access.

404

ErrSourceNotFound

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

500

ErrServer

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

ErrServiceUnavailable

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on