Menyambungkan label ke satu atau beberapa instans database ApsaraDB for Tair (Redis® OSS-Compatible).
Deskripsi operasi
Jika Anda memiliki banyak instans, Anda dapat membuat beberapa label, menyambungkan label yang berbeda ke instans untuk Kategorisasi, lalu memfilter instans berdasarkan label.
Label terdiri dari pasangan kunci-nilai. Kunci label harus unik dalam akun dan wilayah yang sama. Nilai label tidak memiliki batasan ini.
Jika label yang ditentukan tidak ada, label akan dibuat secara otomatis dan disambungkan ke instans target.
Jika instans sudah memiliki label dengan kunci yang sama, label yang ada akan ditimpa dengan yang baru.
Anda dapat menyambungkan hingga 20 label ke setiap instans.
Anda dapat memanggil operasi ini untuk menyambungkan label ke hingga 50 instans sekaligus.
Untuk operasi Konsol yang sesuai dengan API ini, lihat Membuat label.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
kvstore:TagResources |
create |
*DBInstance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah instans. |
cn-hangzhou |
| ResourceType |
string |
Yes |
Tipe Sumber daya. Tetapkan nilai ke INSTANCE. |
INSTANCE |
| ResourceId |
array |
Yes |
ID instans. |
r-bp1zxszhcgatnx**** |
|
string |
No |
ID instans. Anda dapat menentukan beberapa ID instans. Catatan
N menentukan nomor urut ID instans. Misalnya, ResourceId.1 menentukan ID instans pertama, dan ResourceId.2 menentukan ID instans kedua. |
r-bp1zxszhcgatnx**** |
|
| Tag |
array<object> |
Yes |
Informasi tag instans. |
|
|
object |
No |
Objek. |
||
| Key |
string |
Yes |
Kunci label. Catatan
|
demokey |
| Value |
string |
Yes |
Nilai tag. Catatan
N menentukan nomor urut nilai tag. Misalnya, Tag.1.Value menentukan nilai tag pertama, dan Tag.2.Value menentukan nilai tag kedua. |
demovalue |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. |
4BD4E308-A3D8-4CD1-98B3-0ADAEE38**** |
Contoh
Respons sukses
JSONformat
{
"RequestId": "4BD4E308-A3D8-4CD1-98B3-0ADAEE38****"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | NumberExceed.Tags | The Tags parameter number is exceed, Valid is 20. | |
| 400 | InvalidTagKey.Malformed | The specified parameter Tag.n.Key or TagKey.n is not valid. | |
| 400 | InvalidTagValue.Malformed | The specified parameter Tag.n.Value is not valid. | |
| 400 | InvalidParameter.ResourceId | The specified parameter ResourceId.n is not valid. | |
| 400 | MissParameter.TagOrResourceId | The parameter Tag.n or ResourceId.n is needed. | |
| 400 | InvalidParameter.Scope | The specified parameter Scope is not valid. | |
| 400 | NumberExceed.ResourceIds | The ResourceIds parameter number is exceed. | |
| 400 | NumberExceed.CustomTags | The Custom Tags parameter number is exceed. Valid is 20. | |
| 400 | Duplicate.TagKey | The specified parameter Tag.n.Key is duplicated. | |
| 400 | InvalidParameter.ResourceType | The specified parameter ResourceType is not valid. | |
| 400 | OperationDenied.QuotaExceed | The Tags parameter number is exceed. Valid is 20. | |
| 404 | InvalidDbInstanceId.NotFound | Specified instance does not exist. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.