CreateResource
Creates a resource group.
Operation description
Before you call this operation, make sure that you fully understand the billing methods and pricing of EAS.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
eas:CreateResource |
create |
*Resource
|
None | None |
Request syntax
POST /api/v2/resources HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| EcsInstanceType |
string |
No |
The instance type, which corresponds to an ECS instance type. This parameter is required when ResourceType is set to Dedicated. |
ecs.c6.8xlarge |
| SystemDiskSize |
integer |
No |
The size of the system cloud disk. Unit: GiB. Valid values: 200 to 2000. Default value: 200. |
200 |
| EcsInstanceCount |
integer |
No |
The number of instances. This parameter is required when ResourceType is set to Dedicated. |
5 |
| ChargeType |
string |
No |
The billing method. Valid values:
Valid values:
|
PostPaid |
| AutoRenewal |
boolean |
No |
Specifies whether to enable auto-renewal. Valid values:
|
false |
| Zone |
string |
No |
The zone where the instance resides. |
cn-shanghai-f |
| ResourceType |
string |
No |
The type of the resource group. Valid values:
Valid values:
|
Dedicated |
| SelfManagedResourceOptions |
object |
No |
The configuration options for the self-managed resource group. |
|
| ExternalClusterId |
string |
No |
The ID of the self-managed cluster. |
cf0386f250f2545689ca7fdd1cd****** |
| RoleName |
string |
No |
The name of the RAM role that is granted permissions related to PAI-EAS. |
clusterrole |
| NodeMatchLabels |
object |
No |
The collection of label key-value pairs for nodes. |
"key1": "value1" |
|
string |
No |
The label key-value pair for a node. |
"key1": "value1" |
|
| NodeTolerations |
array<object> |
No |
The list of tolerations for node taints. |
|
|
object |
No |
The toleration for a node taint. |
||
| key |
string |
No |
The key. |
key1 |
| value |
string |
No |
The value. |
value1 |
| operator |
string |
No |
The operator that specifies the relationship between the key and the value. Valid values:
|
Equal |
| effect |
string |
No |
The effect. Valid values:
|
NoSchedule |
| Labels |
object |
No |
The custom labels. |
{"key":"value"} |
|
string |
No |
The label. |
{"key":"value"} |
|
| ResourceName |
string |
No |
The name of the resource group. |
MyResource |
| SystemDiskPerformanceLevel |
string |
No |
The performance level (PL) of the system cloud disk for the instance. Valid values:
|
PL1 |
| UsageMode |
string |
No |
The usage mode of the resource group. Valid values: inference (inference service resource group) and sandbox (sandbox resource group). |
inference |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
40325405-579C-4D82**** |
| ResourceId |
string |
The ID of the resource group. |
eas-r-h7lcw24dyqztwxxxxxx |
| ResourceName |
string |
The name of the resource group. |
MyResource |
| ClusterId |
string |
The ID of the cluster where the resource group resides. |
cn-shanghai |
| OwnerUid |
string |
The UID of the resource group owner. |
14401087478**** |
| InstanceIds |
array |
The list of instance IDs. |
|
|
string |
The instance ID. |
eas-i-xxxxx |
Examples
Success response
JSON format
{
"RequestId": "40325405-579C-4D82****",
"ResourceId": "eas-r-h7lcw24dyqztwxxxxxx",
"ResourceName": "MyResource",
"ClusterId": "cn-shanghai",
"OwnerUid": "14401087478****",
"InstanceIds": [
"eas-i-xxxxx"
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.