All Products
Search
Document Center

:TagResources

Last Updated:Jun 10, 2026

Menambahkan tag ke Sumber daya.

Deskripsi operasi

Catatan

API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur.

You can call this operation to attach tags to a source. You can use tags to classify resources in ApsaraMQ for RocketMQ. This can help you aggregate and search resources in an efficient manner.

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

mq:TagResources

update

*全部资源

*

None
  • mq:QueryInstanceBaseInfo

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

No

ID instans ApsaraMQ for RocketMQ yang berisi Sumber daya yang ingin Anda menyambungkan tag.

Catatan

Parameter ini wajib diisi saat Anda menyambungkan tag ke topik atau kelompok.

MQ_INST_188077086902****_BXSuW61e

ResourceType

string

Yes

Tipe Sumber daya yang ingin Anda menyambungkan tag. Nilai valid:

  • INSTANCE

  • TOPIC

  • GROUP

TOPIC

Tag

array<object>

Yes

Tag yang ingin Anda menyambungkan ke Sumber daya.

object

No

Key

string

Yes

The tag key. If you configure this parameter, you must also configure the Value parameter.****

  • The value of this parameter cannot be an empty string.

  • A tag key must be 1 to 128 characters in length and cannot contain http:// or https://. A tag key cannot start with acs: or aliyun.

FinanceDept

Value

string

Yes

The value of the tag that you want to attach to the resource. If you configure this parameter, you must also configure the Key parameter.****

  • The value of this parameter can be an empty string.

  • A tag value must be 1 to 128 characters in length and cannot contain http:// or https://. A tag value cannot start with acs: or aliyun.

FinanceJoshua

ResourceId

array

Yes

ID Sumber daya.

TopicA

string

No

The ID of the resource to which you want to attach a tag.

  • If the resource is a ApsaraMQ for RocketMQ instance, specify the ID of the instance.

  • If the resource is a topic, specify the topic name.

  • If the resource is a group, specify the ID of the group.

TopicA

Elemen respons

Element

Type

Description

Example

object

RequestId

string

The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use the ID to troubleshoot issues.

301D2CBE-66F8-403D-AEC0-82582478****

Contoh

Respons sukses

JSONformat

{
  "RequestId": "301D2CBE-66F8-403D-AEC0-82582478****"
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.