ListWorkspaces
Retrieves the list of workspaces in a region.
Operation description
Use the Option parameter to specify different query options and retrieve different workspace-related information.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
paiworkspace:ListWorkspaces |
list |
*All Resource
|
None | None |
Request syntax
GET /api/v1/workspaces HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PageNumber |
integer |
No |
The page number of the workspace list. Minimum value: 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page for a paged query. Default value: 20. |
20 |
| SortBy |
string |
No |
The sort field for a paged query. Default value: GmtCreateTime. Valid values:
|
GmtCreateTime |
| Order |
string |
No |
The sort order applied to the specified sort field in a paged query. Valid values:
|
ASC |
| WorkspaceName |
string |
No |
The workspace name. |
abc |
| ModuleList |
string |
No |
The comma-separated module list. 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 fields to return in the workspace details. Use this parameter to limit the workspace properties included in the response. Separate multiple properties with commas (,). Currently, only Id (workspace ID) is supported. |
Id |
| WorkspaceIds |
string |
No |
The list of workspace IDs. Separate multiple workspace IDs with commas (,). |
123,234 |
| ResourceGroupId |
string |
No |
The resource group ID. For information about how to view the resource group ID, see View basic information about a resource group. |
rg-acfmwp7rky**** |
| UserId |
string |
No |
The user ID. |
17*****1743 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response struct. |
||
| RequestId |
string |
The request ID. |
8D7B2E70-F770-505B-A672-09F1D8F2EC1E |
| Workspaces |
array<object> |
The list of workspace details. This list is returned when Option is set to GetWorkspaces. |
|
|
array<object> |
The workspace details. |
||
| WorkspaceId |
string |
The workspace ID. |
123 |
| WorkspaceName |
string |
The workspace name. |
workspace-example |
| GmtCreateTime |
string |
The time when the workspace was created. The time follows the ISO 8601 standard in UTC+0. Format: yyyy-MM-ddTHH:mm:ss.SSSZ. |
2021-01-21T17:12:35.232Z |
| GmtModifiedTime |
string |
The time when the workspace was last modified. The time follows the ISO 8601 standard in UTC+0. Format: yyyy-MM-ddTHH:mmZ. |
2021-01-21T17:12:35.232Z |
| Description |
string |
The workspace description. |
workspace description example |
| Creator |
string |
The user ID of the creator. |
122424353535 |
| EnvTypes |
array |
The list of environments included in the workspace. |
|
|
string |
The environment included in the workspace. Valid values:
|
prod |
|
| Status |
string |
The workspace status. |
ENABLED |
| AdminNames |
array |
The list of administrator account names. |
|
|
string |
The administrator account name. |
demo_test@***.aliyunid.com |
|
| IsDefault |
boolean |
Indicates whether this is the default workspace. |
false |
| ExtraInfos |
object |
The extended information. Currently includes TenantId, which represents the tenant ID. |
{"TenantId": "4286******98"} |
| resourceGroupId |
string |
The resource group ID. |
rg-acfmwp7rky**** |
| DisplayName |
string |
The workspace display name. |
workspace-example |
| TotalCount |
integer |
The total number of workspaces that match the query conditions. |
1 |
| ResourceLimits |
object |
The types and quantity limits of resources that a user can activate within a workspace. This list is returned when Option is set to GetResourceLimits. Currently supported resource types:
|
{ "MaxCompute_share": 1, "MaxCompute_isolate": 1, "DLC_share": 1 } |
Examples
Success response
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****",
"DisplayName": "workspace-example"
}
],
"TotalCount": 1,
"ResourceLimits": {
"MaxCompute_share": 1,
"MaxCompute_isolate": 1,
"DLC_share": 1
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.