Help Center/ SecMaster/ API Reference/ API/ Workspace Management/ Querying the Workspace List
Updated on 2024-07-25 GMT+08:00

Querying the Workspace List

Function

This API is used to query workspace list. You can filter tenants' workspaces by workspace name, workspace description, and creation time.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/workspaces

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Minimum: 32

Maximum: 64

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

Yes

Number

Offset, which specifies the start position of the record to be returned. The value must be a number no less than 0.

Minimum: 0

Maximum: 999

Default: 0

limit

Yes

Number

Number of records displayed on each page

Minimum: 1

Maximum: 100

Default: 10

region_id

No

String

Region ID

Minimum: 32

Maximum: 64

name

No

String

This API is used to query the name.

Minimum: 0

Maximum: 64

description

No

String

Search by description

Minimum: 0

Maximum: 512

view_bind_id

No

String

Space ID bound to the view

Minimum: 0

Maximum: 36

view_bind_name

No

String

Space name bound to the view

Minimum: 0

Maximum: 64

create_time_start

No

String

Creation start time, for example, 2024-04-26T16:08:09Z+0800.

Minimum: 0

Maximum: 64

create_time_end

No

String

Creation end time, for example, 2024-04-2T16:08:09Z+0800.

Minimum: 0

Maximum: 64

is_view

No

Boolean

Indicates whether to query the view. The value can be true or false.

Default: false

ids

No

String

Workspace ID array, which is separated by commas (,).

Minimum: 0

Maximum: 999

normal_project_id

No

String

General project ID.

Minimum: 0

Maximum: 36

enterprise_project_id

No

String

Enterprise project ID.

Minimum: 0

Maximum: 36

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Minimum: 1

Maximum: 2097152

content-type

Yes

String

application/json;charset=UTF-8

Default: application/json;charset=UTF-8

Minimum: 0

Maximum: 64

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

workspaces

Array of CreateWorkspaceResponseBody objects

list of informations of workspaces

Array Length: 0 - 100

count

Number

Total data volume

Minimum: 2

Maximum: 999999999

Table 5 CreateWorkspaceResponseBody

Parameter

Type

Description

id

String

Workspace ID.

Minimum: 32

Maximum: 36

create_time

String

Creation time.

Minimum: 0

Maximum: 64

update_time

String

Update time.

Minimum: 0

Maximum: 64

name

String

Workspace name.

Minimum: 1

Maximum: 64

description

String

Workspace description.

Minimum: 0

Maximum: 512

creator_id

String

Creator ID.

Minimum: 0

Maximum: 36

creator_name

String

Creator name.

Minimum: 0

Maximum: 64

modifier_id

String

Modifier ID.

Minimum: 0

Maximum: 36

modifier_name

String

Modifier name.

Minimum: 0

Maximum: 64

project_id

String

Project ID.

Minimum: 32

Maximum: 36

project_name

String

Project name.

Minimum: 1

Maximum: 64

domain_id

String

Tenant ID.

Minimum: 32

Maximum: 36

domain_name

String

Tenant name.

Minimum: 1

Maximum: 64

enterprise_project_id

String

Enterprise project ID.

Minimum: 0

Maximum: 36

enterprise_project_name

String

Enterprise project name.

Minimum: 0

Maximum: 64

is_view

Boolean

Indicates whether the view is used.

region_id

String

Region ID.

Minimum: 1

Maximum: 64

view_bind_id

String

Space ID bound to the view.

Minimum: 0

Maximum: 36

view_bind_name

String

Space name bound to the view.

Minimum: 0

Maximum: 64

workspace_agency_list

Array of workspace_agency_list objects

This parameter is used only in the view scenario. The spaces managed by the view are listed.

Array Length: 0 - 32

Table 6 workspace_agency_list

Parameter

Type

Description

project_id

String

ID of the project to which the agency space belongs.

Minimum: 32

Maximum: 36

id

String

Space agency ID.

Minimum: 32

Maximum: 36

name

String

Space agency name.

Minimum: 1

Maximum: 64

region_id

String

ID of the region to which the agency space belongs

Minimum: 1

Maximum: 64

workspace_attribution

String

THIS_ACCOUNT: current account space; CROSS_ACCOUNT: cross-account space

Enumeration values:

  • THIS_ACCOUNT
  • CROSS_ACCOUNT

agency_version

String

IAM agency version used when a user creates a hosting space. The value can be V3 or V5.

Minimum: 1

Maximum: 64

domain_id

String

ID of the tenant agency.

Minimum: 32

Maximum: 64

domain_name

String

Name of the tenant agency.

Minimum: 1

Maximum: 64

iam_agency_id

String

IAM agency ID.

Minimum: 32

Maximum: 64

iam_agency_name

String

IAM agency name.

Minimum: 1

Maximum: 64

resource_spec_code

Array of strings

The purchased version of agency space

Minimum: 1

Maximum: 64

Array Length: 0 - 16

selected

Boolean

Indicates whether a view is selected.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

code

String

Error code.

Minimum: 0

Maximum: 64

message

String

Error description.

Minimum: 0

Maximum: 1024

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

code

String

Error code.

Minimum: 0

Maximum: 64

message

String

Error description.

Minimum: 0

Maximum: 1024

Example Requests

None

Example Responses

Status code: 200

Request successful.

{
  "count" : 1,
  "workspaces" : [ {
    "create_time" : "2024-07-02T09:25:17Z+0800",
    "creator_id" : "b4*****************************46a",
    "creator_name" : "l00644738",
    "description" : "My workspace",
    "domain_id" : "ac*****************************bf4",
    "domain_name" : "scc****09",
    "enterprise_project_id" : "",
    "enterprise_project_name" : "",
    "id" : "39*************bf",
    "is_timeout" : null,
    "is_view" : false,
    "modifier_id" : "",
    "modifier_name" : "",
    "name" : "My Workspace",
    "project_id" : "15**************************da6",
    "project_name" : "cn-north-4",
    "region_id" : "cn-north-4",
    "update_time" : "2024-07-02T09:25:17Z+0800",
    "view_bind_id" : "",
    "view_bind_name" : "",
    "workspace_agency_list" : [ ]
  } ]
}

Status Codes

Status Code

Description

200

Request successful.

400

Invalid request parameter.

500

Request failed.

Error Codes

See Error Codes.