All Products
Search
Document Center

Platform For AI:CreateResource

Last Updated:Jun 11, 2026

Membuat kelompok sumber daya baru.

Deskripsi operasi

Before calling this API, make sure you understand the billing method and pricing of Elastic Algorithm Service (EAS).

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

eas:CreateResource

create

*Resource

acs:eas:{#regionId}:{#accountId}:resource/*

None None

Sintaks permintaan

POST /api/v2/resources HTTP/1.1

Parameter permintaan

Parameter

Type

Required

Description

Example

body

object

No

Badan permintaan.

EcsInstanceType

string

No

The ECS instance type.

Catatan

This parameter is required when ResourceType is set to Dedicated.

ecs.c6.8xlarge

SystemDiskSize

integer

No

The size of the system disk, in GiB. The value must be between 200 and 2,000. If unspecified, the default is 200 GiB.

200

EcsInstanceCount

integer

No

The number of instances.

Catatan

This parameter is required when ResourceType is set to Dedicated.

5

ChargeType

string

No

The billing method. Valid values:

  • PrePaid: subscription.

  • PostPaid: pay-as-you-go.

Catatan

This parameter is required when ResourceType is set to Dedicated.

Valid values:

  • PostPaid :
  • PrePaid :

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 in which to create the instance.

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.

Catatan

You must be whitelisted to use self-managed resource groups.

Valid values:

  • SelfManaged :
  • 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 grants PAI-EAS the required permissions.

clusterrole

NodeMatchLabels

object

No

The node labels to match, specified as key-value pairs.

string

No

A key-value pair for a node label.

"key1": "value1"

NodeTolerations

array<object>

No

A list of tolerations for node taints.

object

No

A 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

A key-value pair for a label.

{"key":"value"}

ResourceName

string

No

The name of the resource group.

MyResource

UsageMode

string

No

Elemen respons

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 that contains the resource group.

cn-shanghai

OwnerUid

string

The UID of the resource group owner.

14401087478****

InstanceIds

array

The instance IDs.

string

The instance ID.

eas-i-xxxxx

Contoh

Respons sukses

JSONformat

{
  "RequestId": "40325405-579C-4D82****",
  "ResourceId": "eas-r-h7lcw24dyqztwxxxxxx",
  "ResourceName": "MyResource",
  "ClusterId": "cn-shanghai",
  "OwnerUid": "14401087478****",
  "InstanceIds": [
    "eas-i-xxxxx"
  ]
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.