Retrieves a list of workspaces.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
emr-serverless-spark:ListWorkspaces |
list |
*All Resource
|
None | None |
Request syntax
GET /api/v1/workspaces HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| nextToken |
string |
No |
The token to retrieve the next page of results. |
1 |
| maxResults |
integer |
No |
The maximum number of results to return per page. |
20 |
| name |
string |
No |
The name of the workspace. Fuzzy search is supported. |
test_workspace |
| state |
string |
No |
The state of the workspace. |
running |
| regionId |
string |
No |
The region ID. |
cn-hangzhou |
| tag |
array<object> |
No |
The tags used to filter workspaces. |
|
|
object |
No |
|
||
| key |
string |
No |
The tag key. |
cn-shenzhen-finance.edas.config.server |
| value |
string |
No |
The tag value. |
iphone_disk_remaining_rate |
| resourceGroupId |
string |
No |
The ID of the resource group to which the workspace belongs. |
rg-aek2thxggoqhmhq |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data returned. |
||
| workspaces |
array<object> |
A list of workspaces. |
|
|
array<object> |
The details of a workspace. |
||
| workspaceId |
string |
The workspace ID. |
w-****** |
| workspaceName |
string |
The name of the workspace. |
spark-batch-workspace-1 |
| resourceSpec |
string |
The resource specification. |
100cu |
| storage |
string |
The OSS path. |
spark-result |
| dlfCatalogId |
string |
The DLF catalog ID. |
default |
| paymentType |
string |
The billing method. |
PayAsYouGo or Subscription |
| paymentDurationUnit |
string |
The unit of the subscription duration. This parameter is required when paymentType is set to Subscription. |
YEAR, MONTH, WEEK, DAY, HOUR, MINUTE |
| duration |
integer |
The subscription duration. This parameter is required when paymentType is set to Subscription. |
1 |
| autoRenew |
boolean |
Specifies whether auto-renewal is enabled. This parameter is required when paymentType is set to Subscription. |
true |
| autoRenewPeriod |
integer |
The auto-renewal duration. This parameter is required when paymentType is set to Subscription. |
1 |
| autoRenewPeriodUnit |
string |
The unit of the auto-renewal duration. This parameter is required when paymentType is set to Subscription. |
YEAR, MONTH, WEEK, DAY, HOUR, MINUTE |
| workspaceStatus |
string |
The workspace status. |
STARTING,RUNNING,TERMINATED |
| failReason |
string |
The failure reason. |
out of stock |
| paymentStatus |
string |
The payment status. |
PAID/UNPAID |
| regionId |
string |
The region ID. |
cn-shanghai |
| createTime |
integer |
The time when the workspace was created, represented as a Unix timestamp in milliseconds. |
1684115879955 |
| endTime |
integer |
The time when the workspace was released, represented as a Unix timestamp in milliseconds. |
1687103999999 |
| stateChangeReason |
object |
Details about the workspace status change. |
|
| code |
string |
The error code. |
0 |
| message |
string |
The error message. |
Success |
| releaseType |
string |
The reason the workspace was released. |
SERVICE_RELEASE |
| dlfType |
string |
The type of the attached DLF. |
1.0 |
| prePaidQuota |
object |
Information about the prepaid resource quota. |
|
| usedResource |
string |
The amount of used resources. |
{\"cpu\":\"0\",\"memory\":\"0Gi\",\"cu\":\"0\"} |
| maxResource |
string |
The maximum amount of available resources. |
{\"cpu\":\"1\",\"memory\":\"4Gi\",\"cu\":\"1\"} |
| allocatedResource |
string |
The amount of allocated resources. |
{\"cpu\":\"1\",\"memory\":\"4Gi\",\"cu\":\"1\"} |
| createTime |
integer |
The time when the resource quota was created, represented as a Unix timestamp in milliseconds. |
1745683200000 |
| expireTime |
integer |
The expiration time of the resource quota, represented as a Unix timestamp in milliseconds. |
1740537153000 |
| autoRenewal |
boolean |
Specifies whether auto-renewal is enabled for the resource.
|
true |
| paymentStatus |
string |
The payment status of the resource. Valid values:
|
NORMAL |
| instanceId |
string |
The ID of the resource instance associated with the quota. |
i-abc12345 |
| orderId |
string |
The order ID. |
|
| tags |
array<object> |
The tags of the workspace. |
|
|
object |
A tag. |
||
| tagKey |
string |
The tag key. |
|
| tagValue |
string |
The tag value. |
|
| resourceGroupId |
string |
The resource group ID. |
rg-xxxxxxxxxx |
| gpuSpec |
array |
The GPU specifications. |
|
|
string |
A GPU specification. |
ecs.gn7i-c8g1.2xlarge |
|
| requestId |
string |
The request ID. |
DD6B1B2A-5837-5237-ABE4-FF0C8944**** |
| nextToken |
string |
The token to use in a subsequent request to retrieve the next page of results. |
1 |
| maxResults |
integer |
The maximum number of results to return per page. |
20 |
| totalCount |
integer |
The total number of results. |
200 |
Examples
Success response
JSON format
{
"workspaces": [
{
"workspaceId": "w-******",
"workspaceName": "spark-batch-workspace-1",
"resourceSpec": "100cu",
"storage": "spark-result",
"dlfCatalogId": "default",
"paymentType": "PayAsYouGo or Subscription",
"paymentDurationUnit": "YEAR, MONTH, WEEK, DAY, HOUR, MINUTE",
"duration": 1,
"autoRenew": true,
"autoRenewPeriod": 1,
"autoRenewPeriodUnit": "YEAR, MONTH, WEEK, DAY, HOUR, MINUTE",
"workspaceStatus": "STARTING,RUNNING,TERMINATED",
"failReason": "out of stock",
"paymentStatus": "PAID/UNPAID",
"regionId": "cn-shanghai",
"createTime": 1684115879955,
"endTime": 1687103999999,
"stateChangeReason": {
"code": "0",
"message": "Success"
},
"releaseType": "SERVICE_RELEASE",
"dlfType": "1.0",
"prePaidQuota": {
"usedResource": "{\\\"cpu\\\":\\\"0\\\",\\\"memory\\\":\\\"0Gi\\\",\\\"cu\\\":\\\"0\\\"}",
"maxResource": "{\\\"cpu\\\":\\\"1\\\",\\\"memory\\\":\\\"4Gi\\\",\\\"cu\\\":\\\"1\\\"}",
"allocatedResource": "{\\\"cpu\\\":\\\"1\\\",\\\"memory\\\":\\\"4Gi\\\",\\\"cu\\\":\\\"1\\\"}",
"createTime": 1745683200000,
"expireTime": 1740537153000,
"autoRenewal": true,
"paymentStatus": "NORMAL",
"instanceId": "i-abc12345",
"orderId": ""
},
"tags": [
{
"tagKey": "",
"tagValue": ""
}
],
"resourceGroupId": "rg-xxxxxxxxxx",
"gpuSpec": [
"ecs.gn7i-c8g1.2xlarge"
]
}
],
"requestId": "DD6B1B2A-5837-5237-ABE4-FF0C8944****",
"nextToken": "1",
"maxResults": 20,
"totalCount": 200
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.