All Products
Search
Document Center

Platform For AI:CreateResource

Last Updated:Oct 16, 2025

Creates a resource group.

Operation description

Before you call this operation, make sure that you understand the billing methods and pricing of Elastic Algorithm Service (EAS).

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

eas:CreateResource

create

*Resource

acs:eas:{#regionId}:{#accountId}: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 ECS instance type.

Note

This parameter is required when you set ResourceType to Dedicated.

ecs.c6.8xlarge

SystemDiskSize

integer

No

The size of the system disk. Unit: GiB. Valid values: 200 to 2000. The default value is 200 GiB.

200

EcsInstanceCount

integer

No

The number of instances.

Note

This parameter is required when you set ResourceType to Dedicated.

5

ChargeType

string

No

The billing method. Valid values:

  • PrePaid: subscription.

  • PostPaid: pay-as-you-go.

Note

This parameter is required when you set ResourceType to Dedicated.

Valid values:

  • PostPaid :

    pay-as-you-go

  • PrePaid :

    subscription

PostPaid

AutoRenewal

boolean

No

Specifies whether to enable auto-renewal. Valid values:

  • false (default): Auto-renewal is disabled.

  • true: Auto-renewal is enabled.

false

Zone

string

No

The zone where the instance resides.

cn-shanghai-f

ResourceType

string

No

The type of the resource group. Valid values:

  • Dedicated: a dedicated resource group.

  • SelfManaged: a self-managed resource group.

Note

To use a self-managed resource group, you must request to be added to the whitelist.

Valid values:

  • SelfManaged :

    SelfManaged

  • Dedicated :

    Dedicated

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 the permissions to access PAI-EAS.

clusterrole

NodeMatchLabels

object

No

The collection of key-value pairs for the node labels.

string

No

The key-value pair of a node label.

"key1": "value1"

NodeTolerations

array

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 relationship between the key and the value.

Valid values:

  • Equal :

    Equal

  • Exists :

    Exists

Equal

effect

string

No

The effect.

Valid values:

  • PreferNoSchedule :

    PreferNoSchedule

  • NoSchedule :

    NoSchedule

  • NoExecute :

    NoExecute

NoSchedule

Labels

object

No

The user-defined labels.

string

No

The label.

{"key":"value"}

ResourceName

string

No

The name of the resource group.

MyResource

Response elements

Element

Type

Description

Example

object

The response schema.

RequestId

string

The request ID.

40325405-579C-4D82****

ResourceId

string

The resource group ID.

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 machine instance IDs.

string

The machine 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.