CreateWorkspaceResource
Add a resource reference to a workspace.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
paiworkspace:CreateWorkspaceResource |
*All Resource
|
None | None |
Request syntax
POST /api/v1/workspaces/{WorkspaceId}/resources HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| WorkspaceId |
string |
Yes |
The ID of the workspace. To obtain the workspace ID, see ListWorkspaces. |
123 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| Resources |
array<object> |
Yes |
The list of resources. |
|
|
array<object> |
Yes |
The resource details. |
||
| Name |
string |
Yes |
The resource name. The name must meet the following requirements:
|
ResourceName |
| ProductType |
string |
No |
[Deprecated] This parameter is deprecated and will be removed in a future version. Use the |
MaxCompute |
| EnvType |
string |
Yes |
The environment type. Valid values:
|
prod |
| WorkspaceId |
string |
Yes |
The ID of the workspace to which the resource belongs. To obtain the workspace ID, see ListWorkspaces. |
123 |
| IsDefault |
boolean |
No |
Indicates whether this is the default resource for its type. Each resource type can have only one default resource.
|
false |
| Quotas |
array<object> |
No |
The resource quotas. Currently, only MaxCompute resources have resource quotas. |
|
|
object |
No |
A resource quota. |
||
| Id |
string |
No |
The ID of the resource quota. To obtain the resource quota ID, see ListQuotas. This parameter is required only for subscription MaxCompute resources.
For ECS, Lingjun, and ACS resources, you do not need to specify this parameter. Their quota information is configured in the |
232892******92912 |
| Spec |
object |
No |
The resource specification in JSON format. For ECS and Lingjun resources, the format is as follows:
{
|
{ "clusterType": "private", "resourceId": "quota1c******b4", "resourceName": "unif******90" } |
| GroupName |
string |
No |
The name of the resource group. The name must be unique within an Alibaba Cloud account. This parameter is required for MaxCompute, ECS, Lingjun, ACS, and Flink resources. |
groupName |
| ResourceType |
string |
No |
The resource type. Valid values:
|
MaxCompute |
| Labels |
array<object> |
No |
An array of resource tags. |
|
|
object |
No |
A resource tag. |
||
| Key |
string |
No |
The key of the tag. |
system.support.eas |
| Value |
string |
No |
The value of the tag. |
true |
| Option |
string |
No |
The creation behavior. Valid values:
Note
MaxCompute resources only support the |
CreateAndAttach |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data returned. |
||
| RequestId |
string |
The request ID. |
1e195c5116124202371861018d5bde |
| Resources |
array<object> |
A list of resources. |
|
|
object |
The details of a resource. |
||
| Id |
string |
The resource ID. |
1234 |
| TotalCount |
integer |
The total number of resources. |
1 |
Examples
Success response
JSON format
{
"RequestId": "1e195c5116124202371861018d5bde",
"Resources": [
{
"Id": "1234"
}
],
"TotalCount": 1
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.