Lists all workspaces in a region.
Operation description
You can use the option parameter to specify query options, so as to obtain different information about the workspaces.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
paiworkspace:ListWorkspaces | list | *All Resources * |
| none |
Request syntax
GET /api/v1/workspaces HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
PageNumber | long | No | The page number of the workspace list. Pages start from page 1. Default value: 1. | 1 |
PageSize | integer | No | The number of entries to return on each page. Default value: 20. | 20 |
SortBy | string | No | Specifies how to sort the results. Default value: GmtCreateTime. Valid values:
| GmtCreateTime |
Order | string | No | The order of results (ascending or descending). Valid values:
| ASC |
WorkspaceName | string | No | The name of the workspace. | abc |
ModuleList | string | No | The modules, separated by commas (,). Default value: PAI. | PAI |
Status | string | No | The workspace status. Valid values:
| ENABLED |
Option | string | No | The query options. Valid values:
| GetWorkspaces |
Verbose | boolean | No | Specifies whether to display workspace details. Valid values:
| true |
Fields | string | No | The list of returned fields of workspace details. Used to limit the fields in the returned results. Separate multiple fields with commas (,). Currently, only Id is supported, which is the workspace ID. | Id |
WorkspaceIds | string | No | The workspace IDs. Separate multiple IDs by commas (,). | 123,234 |
ResourceGroupId | string | No | The resource group ID. To obtain the ID of a resource group, see View basic information of a resource group. | rg-acfmwp7rky**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "8D7B2E70-F770-505B-A672-09F1D8F2EC1E",
"Workspaces": [
{
"WorkspaceId": "123",
"WorkspaceName": "workspace-example",
"GmtCreateTime": "2021-01-21T17:12:35.232Z",
"GmtModifiedTime": "2021-01-21T17:12:35.232Z",
"Description": "workspace description example",
"Creator": "122424353535",
"EnvTypes": [
"prod"
],
"Status": "ENABLED",
"AdminNames": [
"demo_test@***.aliyunid.com"
],
"IsDefault": false,
"ExtraInfos": {
"TenantId": "4286******98"
},
"resourceGroupId": "rg-acfmwp7rky****"
}
],
"TotalCount": 1,
"ResourceLimits": {
"MaxCompute_share": 1,
"MaxCompute_isolate": 1,
"DLC_share": 1
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2025-01-23 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2021-03-02 | The response structure of the API has changed | View Change Details |
2021-03-02 | The request parameters of the API has changed | View Change Details |
2021-03-02 | The response structure of the API has changed | View Change Details |