All Products
Search
Document Center

ApsaraMQ for RocketMQ:CreateInstanceAcl

Last Updated:Jun 10, 2026

Membuat daftar kontrol akses (ACL) di instans tertentu.

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

rocketmq:CreateInstanceAcl

create

*Instance

acs:rocketmq:{#regionId}:{#accountId}:instance/{#InstanceId}

None None

Sintaks permintaan

POST /instances/{instanceId}/acl/account/{username} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

ID instans.

rmq-cn-7e22ody****

username

string

Yes

Nama pengguna akun.

abc

Parameter permintaan

Parameter

Type

Required

Description

Example

body

object

No

Badan permintaan.

resourceType

string

Yes

The type of the resource on which you want to grant permissions.

Valid values:

  • Group

  • Topic

Valid values:

  • Group :

    Consumer Group

  • Topic :

    Topic

Topic

resourceName

string

Yes

The name of the resource on which you want to grant permissions.

test

decision

string

Yes

The decision result of the authorization.

Valid values:

  • Deny

  • Allow

Valid values:

  • Deny :

    Deny access

  • Allow :

    Allow access

Allow

actions

array

Yes

The type of operations that can be performed on the resource.

The following types of operations are supported based on the resource type:

  • Topic: Pub, Sub, and Pub|Sub

  • Group: Sub

Valid values:

  • Sub: subscribe

  • Pub|Sub: publish and subscribe

  • Pub: publish

Valid values:

  • Sub :

    Subscribe

  • Pub|Sub :

    Publish and subscribe

  • Pub :

    Publish

Pub

string

No

The type of operations that can be performed on the resource.

The following types of operations are supported based on the resource type:

  • Topic: Pub, Sub, and Pub|Sub

  • Group: Sub

Pub

ipWhitelists

array

No

The IP addresses in the whitelist.

string

No

The IP address in the whitelist. IP addresses and CIDR blocks are supported.

0.0.0.0/0

Elemen respons

Element

Type

Description

Example

object

The result.

requestId

string

The request ID.

C7E8AE3A-219B-52EE-BE32-4036F5F88833

success

boolean

Indicates whether the request was successful.

true

data

boolean

The returned data.

true

code

string

The error code.

MissingInstanceId

message

string

The error message.

Parameter instanceId is mandatory for this action .

httpStatusCode

integer

The HTTP status code.

200

dynamicCode

string

The dynamic error code.

InstanceId

dynamicMessage

string

The dynamic error message.

instanceId

accessDeniedDetail

string

The details about the access denial. This parameter is returned only if the access is denied because the Resource Access Management (RAM) user does not have the required permissions.

xxx

Contoh

Respons sukses

JSONformat

{
  "requestId": "C7E8AE3A-219B-52EE-BE32-4036F5F88833",
  "success": true,
  "data": true,
  "code": "MissingInstanceId",
  "message": "Parameter instanceId is mandatory for this action .",
  "httpStatusCode": 200,
  "dynamicCode": "InstanceId",
  "dynamicMessage": "instanceId",
  "accessDeniedDetail": "xxx"
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.