Call ListWorkspaces to get 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 for the next page of results. |
1 |
| maxResults |
integer |
No |
The maximum number of results 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 ID of the region. |
cn-hangzhou |
| tag |
array<object> |
No |
Filters the results by one or more tags. |
|
|
object |
No |
A tag object. |
||
| key |
string |
No |
The tag key. |
cn-shenzhen-finance.edas.config.server |
| value |
string |
No |
The tag value. |
iPhone disk space remaining rate |
| resourceGroupId |
string |
No |
The ID of the resource group. |
rg-aek2thxggoqhmhq |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| workspaces |
array<object> |
Workspace list. |
|
|
array<object> |
Workspace details. |
||
| workspaceId |
string |
Workspace ID. |
w-****** |
| workspaceName |
string |
Workspace name. |
Spark batch workspace-1 |
| resourceSpec |
string |
Resource specification. |
100cu |
| storage |
string |
OSS path. |
spark-result |
| dlfCatalogId |
string |
DLF Catalog information. |
default |
| paymentType |
string |
Billing method. |
PayAsYouGo or Subscription |
| paymentDurationUnit |
string |
Subscription period (Required for the prepaid billing method). |
YEAR, MONTH, WEEK, DAY, HOUR, MINUTE |
| duration |
integer |
The subscription period quantity is required for the prepaid billing method. |
1 |
| autoRenew |
boolean |
Specifies whether to enable auto-renewal (required for the prepaid billing method). |
true |
| autoRenewPeriod |
integer |
Auto-renewal duration (Required for the prepaid billing method). |
1 |
| autoRenewPeriodUnit |
string |
Auto-renewal period (Required for the prepaid billing method). |
YEAR, MONTH, WEEK, DAY, HOUR, MINUTE |
| workspaceStatus |
string |
Workspace status. |
STARTING,RUNNING,TERMINATED |
| failReason |
string |
Failure reason. |
out of stock |
| paymentStatus |
string |
Payment status. |
PAID/UNPAID |
| regionId |
string |
Region ID. |
cn-shanghai |
| createTime |
integer |
Workspace creation time. |
1684115879955 |
| endTime |
integer |
Workspace release time. |
1687103999999 |
| stateChangeReason |
object |
Information about changes to the workspace status. |
|
| code |
string |
Error code. |
0 |
| message |
string |
Error message. |
Success |
| releaseType |
string |
Workspace release reason. |
SERVICE_RELEASE |
| dlfType |
string |
Bind a dlf type. |
1.0 |
| prePaidQuota |
object |
Information about prepaid resource quotas. |
|
| usedResource |
string |
The amount of resources currently in use. |
{\"cpu\":\"0\",\"memory\":\"0Gi\",\"cu\":\"0\"} |
| maxResource |
string |
The maximum amount of resources. |
{\"cpu\":\"1\",\"memory\":\"4Gi\",\"cu\":\"1\"} |
| allocatedResource |
string |
The amount of resources that are currently allocated. |
{\"cpu\":\"1\",\"memory\":\"4Gi\",\"cu\":\"1\"} |
| createTime |
integer |
The creation time of the resource quota. |
1745683200000 |
| expireTime |
integer |
The expiration time of the resource quota. |
1740537153000 |
| autoRenewal |
boolean |
Whether auto-renewal is enabled for the resource.
|
true |
| paymentStatus |
string |
The payment status of the current resource. The possible values are as follows:
|
NORMAL |
| instanceId |
string |
The resource instance ID that is associated with the quota. |
i-abc12345 |
| orderId |
string |
||
| tags |
array<object> |
||
|
object |
|||
| tagKey |
string |
||
| tagValue |
string |
||
| resourceGroupId |
string |
rg-xxxxxxxxxx |
|
| gpuSpec |
array |
||
|
string |
ecs.gn7i-c8g1.2xlarge |
||
| ipWhiteList |
array |
||
|
string |
0.0.0.1 |
||
| requestId |
string |
Request ID. |
DD6B1B2A-5837-5237-ABE4-FF0C8944**** |
| nextToken |
string |
Next page token. |
1 |
| maxResults |
integer |
The maximum number of records to retrieve at one time. |
20 |
| totalCount |
integer |
Total number of records. |
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"
],
"ipWhiteList": [
"0.0.0.1"
]
}
],
"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.