Mengambil kebijakan dari kunci yang ditentukan.
Deskripsi operasi
-
Untuk informasi selengkapnya mengenai kebijakan akses yang diperlukan agar Pengguna Resource Access Management (RAM) atau Peran RAM dapat memanggil operasi ini, lihat Resource Access Management.
-
Karena nama kebijakan kunci hanya dapat diatur ke default, Anda harus menetapkan parameter PolicyName ke default saat mengambil kebijakan kunci. Jika tidak, kesalahan
Not Foundakan dikembalikan.
Coba sekarang
Test
RAM authorization
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| KeyId |
string |
Yes |
ID atau Nama Sumber Daya Alibaba Cloud (ARN) dari kunci tersebut. Catatan
Saat Anda mengakses kunci dalam Akun Alibaba Cloud lain, Anda harus memasukkan ARN kunci tersebut. ARN kunci memiliki format |
key-hzz630494463ejqjx**** |
| PolicyName |
string |
No |
Nama kebijakan kunci. Hanya nilai statis default yang didukung. |
default |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. ID ini merupakan pengenal unik yang dihasilkan oleh Alibaba Cloud untuk permintaan tersebut. Anda dapat menggunakan ID ini untuk memecahkan masalah. |
381D5D33-BB8F-395F-8EE4-AE3B84B523C8 |
| Policy |
string |
Kebijakan kunci. |
{"Statement": [{"Action": ["kms:*"],"Effect": "Allow","Principal": {"RAM": ["acs:ram::190325303126****:*","acs:ram::119285303511****:*"]},"Resource": ["*"],"Sid": "kms default key policy"}],"Version": "1" } |
Contoh
Respons sukses
JSONformat
{
"RequestId": "381D5D33-BB8F-395F-8EE4-AE3B84B523C8",
"Policy": "{\"Statement\": [{\"Action\": [\"kms:*\"],\"Effect\": \"Allow\",\"Principal\": {\"RAM\": [\"acs:ram::190325303126****:*\",\"acs:ram::119285303511****:*\"]},\"Resource\": [\"*\"],\"Sid\": \"kms default key policy\"}],\"Version\": \"1\" }"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is not valid. | An invalid value is specified for the parameter. |
| 400 | MissingParameter | The parameter needed but no provided. | The required parameters are not specified. |
| 400 | Forbidden.NoPermission | This operation is forbidden by permission system. | You are not authorized to perform this operation. |
| 400 | Forbidden.KeyPolicyUnSupported | The specified key does not support key policy. | The specified key does not support key policies. |
| 404 | Forbidden.KeyNotFound | The specified Key is not found. | The error message returned because the specified CMK does not exist. |
| 404 | Forbidden.ResourceNotFound | Policy not found. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.