ListWorkspaces

Updated at:

Retrieves a list of workspaces.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cms:ListWorkspaces

list

*Workspace

acs:cms::{#accountId}:workspace/*

None None

Request syntax

GET /workspace HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

workspaceName

string

No

The name of the workspace. Fuzzy match is supported.

workspace-test-001

nextToken

string

No

The pagination token.

aAaAAAA1aAAA1a1a1AaaAAa1A11aaaa1AA-aAA1Aaaa1aaAaAaaAaAaa1AAAaa1A

maxResults

integer

No

The maximum number of entries per page. Default value: 50 Maximum value: 50

10

workspaceNameList

array

No

The names of the workspaces. Exact match is supported.

workspace-test-001

string

No

The names of the workspaces. Exact match is supported.

workspace-test-001

region

string

No

The region.

cn-heyuan

resourceGroupId

string

No

The ID of the resource group.

rg-ae******ey

tags

array<object>

No

The tags.

object

No

The tags.

key

string

No

The tag key.

key

value

string

No

The tag value.

value

Response elements

Element

Type

Description

Example

object

Schema of Response

maxResults

integer

The maximum number of entries per page. Default value: 50 Maximum value: 50

10

nextToken

string

The pagination token.

A1111AAAA1A1AaaA1Aa1aaAaa1AAaaAAa1AaAaaa1aA1Aa1aaaa1aaa-AAaaa1aa

requestId

string

The ID of the request.

264C3E89-XXXX-XXXX-XXXX-CE9C2196C7DC

total

integer

The total number of results.

1

workspaces

array<object>

The list of workspaces.

array<object>

WorkspaceItemType

createTime

string

The creation time.

2025-03-11T08:21:58Z

displayName

string

The display name of the workspace.

workspace-test

description

string

The description of the workspace.

workspace test

lastModifyTime

string

The last modification time.

2025-03-11T08:21:58Z

regionId

string

The region ID.

cn-heyuan

slsProject

string

The name of the Simple Log Service project.

sls-project-test-001

workspaceName

string

The name of the workspace.

workspace-test-001

resourceGroupId

string

The ID of the resource group.

rg-ae******ey

tags

array<object>

The tags.

object

The tags.

key

string

The tag key.

key

value

string

The tag value.

value

Examples

Success response

JSON format

{
  "maxResults": 10,
  "nextToken": "xxxxxxxxxx",
  "requestId": "264C3E89-XXXX-XXXX-XXXX-CE9C2196C7DC",
  "total": 1,
  "workspaces": [
    {
      "createTime": "2025-03-11T08:21:58Z",
      "displayName": "workspace-test",
      "description": "workspace test",
      "lastModifyTime": "2025-03-11T08:21:58Z",
      "regionId": "cn-heyuan",
      "slsProject": "sls-project-test-001",
      "workspaceName": "workspace-test-001",
      "resourceGroupId": "rg-ae******ey",
      "tags": [
        {
          "key": "key",
          "value": "value"
        }
      ]
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.