Memberikan akun standar izin untuk mengakses satu atau beberapa database dalam Kluster PolarDB Basis Data Relasional Cloud-Native tertentu.
Deskripsi operasi
-
An account can be authorized to access one or more databases.
-
If the specified account already has the access permissions on the specified databases, the operation returns a successful response.
-
Before you call this operation, make sure that the cluster is in the Running state. Otherwise, the operation fails.
-
This operation is supported only for PolarDB for MySQL clusters.
-
By default, a privileged account for a cluster has all the permissions on the databases in the cluster.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardb:GrantAccountPrivilege |
update |
*dbcluster
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
Yes |
ID Kluster. |
pc-**************** |
| AccountName |
string |
Yes |
Nama pengguna akun. |
testacc |
| DBName |
string |
Yes |
Nama database yang dapat diakses oleh akun. Anda dapat memberikan izin akses pada satu atau beberapa database kepada akun standar tertentu. Untuk menentukan beberapa nama database, pisahkan nama database dengan koma (,). |
testdb_1,testdb_2 |
| AccountPrivilege |
string |
Yes |
Izin yang diberikan kepada akun. Nilai valid:
Catatan
Jumlah nilai AccountPrivilege harus konsisten dengan jumlah nilai DBName. Setiap izin akun harus sesuai dengan nama database secara berurutan. Sebagai contoh, Anda dapat mengatur DBName ke |
ReadWrite,ReadOnly |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. |
2FED790E-FB61-4721-8C1C-07C627***** |
Contoh
Respons sukses
JSONformat
{
"RequestId": "2FED790E-FB61-4721-8C1C-07C627*****"
}
Respons error
JSONformat
{
"RequestId": "2FED790E-FB61-4721-8C1C-07C627FA5A19"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | EngineMigration.ActionDisabled | Specified action is disabled while custins is in engine migration. | The specified operation is disabled when custins is being migrated across engines. |
| 400 | LockTimeout | The request processing has failed due to lock timeout. | Failed to process the request due to a lock timeout. |
| 400 | Account.UpdateError | Instance %s update Account %s error | Failed to update account %s for cluster %s. |
| 400 | InvalidDBName.Malformed | The specified parameter DBName is not valid. | The format of the specified database name is invalid. |
| 400 | InvalidAccountName.Malformed | The specified parameter AccountName is not valid. | The specified AccountName parameter is invalid. |
| 400 | InvalidAccountPrivilege.Malformed | The specified parameter AccountPrivilege is not valid. | The specified AccountPrivilege parameter is invalid. |
| 403 | IncorrectAccountPrivilegeType | Current account privilege type does not support this operation. | The permission type of the current account does not support this operation. |
| 404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The specified DBClusterId parameter does not exist in the current record. |
| 404 | InvalidDBClusterId.Malformed | The specified parameter DBClusterId is not valid. | The specified DBClusterId parameter is invalid. |
| 404 | InvalidDBClusterId.NotFound | The DBInstanceId provided does not exist in our records. | The specified DBClusterId parameter does not exist in the current record. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.