Mengotorisasi pengguna untuk mengelola database dan akun database.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-bastionhost:AttachDatabaseAccountsToUser |
update |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
ID bastion host yang penggunanya ingin Anda berikan izin. Catatan
Anda dapat memanggil operasi DescribeInstances untuk mengkueri ID bastion host. |
bastionhost-cn-wwo36qbv601 |
| RegionId |
string |
No |
ID Wilayah bastion host. Catatan
Untuk informasi selengkapnya tentang Pemetaan antara ID Wilayah dan nama Wilayah, lihat Wilayah dan zona. |
cn-hangzhou |
| UserId |
string |
Yes |
ID pengguna yang akan diotorisasi. Catatan
Anda dapat memanggil operasi ListUsers untuk mengkueri ID pengguna. |
1 |
| Databases |
array<object> |
No |
Array yang terdiri dari objek database. Catatan
Anda dapat menentukan hingga 10 database dan 10 akun database. Akun database tidak wajib. Jika Anda tidak menentukan akun database, pengguna hanya diotorisasi untuk mengelola database. |
|
|
object |
No |
|||
| DatabaseId |
string |
No |
The ID of the database that you want to authorize the user to manage. |
22 |
| DatabaseAccountIds |
array |
No |
An array that consists of database account IDs. |
|
|
string |
No |
The database account ID. |
1 |
Struktur data parameter permintaan.
Databases.
| Field | Tipe | Deskripsi |
| DatabaseId | string | ID database. |
| DatabaseAccountIds | array[string] | Array yang terdiri dari ID akun database. Anda dapat menentukan hingga 10 ID. |
Kode berikut memberikan contoh nilai parameter Databases:
[
{"DatabaseId":"1"} // Mengotorisasi pengguna untuk mengelola database saja.{"DatabaseId":"2","DatabaseAccountIds":["1","2","3",...]}, // Mengotorisasi pengguna untuk mengelola database dan akun database.{"DatabaseId":"5","DatabaseAccountIds":[]} // Tidak didukung.]
```.
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
23120B8E-8737-50BD-A3A3-902A7821F04D |
| Results |
array<object> |
The result of the call. |
|
|
array<object> |
|||
| Code |
string |
The error code that is returned. If OK is returned, the authorization was successful. If another error code is returned, the authorization failed. |
OK |
| DatabaseAccounts |
array<object> |
A list that shows the authorization results of the database accounts. |
|
|
object |
|||
| Code |
string |
The error code that is returned. If OK is returned, the authorization was successful. If another error code is returned, the authorization failed. |
OK |
| DatabaseAccountId |
string |
The database account ID. |
6 |
| Message |
string |
The error message that is returned. |
success |
| DatabaseId |
string |
The database ID. |
22 |
| Message |
string |
The error message that is returned. |
None |
| UserId |
string |
The user ID. |
1 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "23120B8E-8737-50BD-A3A3-902A7821F04D",
"Results": [
{
"Code": "OK",
"DatabaseAccounts": [
{
"Code": "OK",
"DatabaseAccountId": "6",
"Message": "success"
}
],
"DatabaseId": "22",
"Message": "None",
"UserId": "1"
}
]
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The argument is invalid. | |
| 500 | InternalError | An unknown error occurred. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.