Memberikan izin pada topik. Anda harus membuat topik induk di Konsol terlebih dahulu sebelum memanggil Operasi API ini.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mq:AddCustomAuthPermission |
create |
*Instance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
ID instans ApsaraMQ for MQTT. |
mqtt-cn-0pp12gl**** |
| IdentityType |
string |
Yes |
Tipe identitas. Nilai yang valid: USER dan CLIENT. |
USER |
| Identity |
string |
Yes |
Username atau client ID. |
test |
| PermitAction |
string |
Yes |
Izin yang ingin Anda berikan. |
PUB_SUB |
| Effect |
string |
Yes |
Menentukan apakah akses diizinkan atau ditolak. |
ALLOW |
| Topic |
string |
Yes |
Topik tempat Anda ingin memberikan izin. Topik multi-level dan karakter wildcard didukung. |
test/t1 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Objek skema. |
||
| RequestId |
string |
ID permintaan. |
82B9E503-F4A1-4F30-976F-C6999FF9**** |
| Code |
integer |
Kode status HTTP. Kode status 200 menunjukkan bahwa permintaan berhasil. |
200 |
| Success |
boolean |
Menunjukkan apakah permintaan berhasil. Nilai yang valid: true dan false. |
True |
| Message |
string |
Pesan error yang dikembalikan. |
operation success. |
Contoh
Respons sukses
JSONformat
{
"RequestId": "82B9E503-F4A1-4F30-976F-C6999FF9****",
"Code": 200,
"Success": true,
"Message": "operation success."
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InstancePermissionCheckFailed | An error occurred while validating the permissions of the instance. Please verify the account that created the instance and its permissions settings. | |
| 400 | InvalidParameter.%s | An error occurred while validating the parameter. The parameter may be missing or invalid. | |
| 400 | Customauth.over.capacity | Over custom auth capacity. | |
| 404 | ApiNotSupport | The specified API is not supported. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.