Terapkan kebijakan snapshot otomatis ke disk. Jika kebijakan snapshot otomatis diterapkan pada disk yang sudah memiliki kebijakan tersebut, kebijakan baru akan menggantikan kebijakan sebelumnya.
Catatan Penggunaan
- Anda hanya dapat menerapkan satu kebijakan snapshot otomatis untuk setiap disk.
- Satu kebijakan snapshot otomatis dapat diterapkan ke beberapa disk.
Debugging
Parameter Permintaan
|
Parameter |
Type |
Required |
Example |
Description |
| Action | String | Yes | ApplyAutoSnapshotPolicy | Operasi yang ingin Anda lakukan. Tetapkan nilainya ke ApplyAutoSnapshotPolicy. |
| regionId | String | Yes | cn-hangzhou | ID Wilayah dari kebijakan snapshot otomatis dan disk. Anda dapat memanggil operasi DescribeRegions untuk mengambil daftar wilayah terbaru. |
| autoSnapshotPolicyId | String | Yes | sp-bp14yziiuvu3s6jn**** | ID kebijakan snapshot otomatis yang akan diterapkan. |
| diskIds | String | Yes | ["d-bp14k9cxvr5uzy54****", "d-bp1dtj8v7x6u08iw****", "d-bp1c0tyj9tfli2r8****"] | ID disk. Nilainya berupa array JSON yang terdiri atas ID disk. Pisahkan ID disk dengan koma (,). |
Parameter Respons
Parameter |
Type |
Example |
Description |
| RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | ID permintaan. |
Contoh
Contoh permintaan
https://ecs.aliyuncs.com/?Action=ApplyAutoSnapshotPolicy
&autoSnapshotPolicyId=sp-bp14yziiuvu3s6jn****
&diskIds=["d-bp14k9cxvr5uzy54****", "d-bp1dtj8v7x6u08iw****", "d-bp1c0tyj9tfli2r8****"]
®ionId=cn-hangzhou
&<Common request parameters>
Contoh respons sukses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<ApplyAutoSnapshotPolicyResponse>
<RequestId>F3CD6886-D8D0-4FEE-B93E-1B73239673DE</RequestId>
</ApplyAutoSnapshotPolicyResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "F3CD6886-D8D0-4FEE-B93E-1B73239673DE"
}
Kode Kesalahan
|
Kode status HTTP |
Kode kesalahan |
Pesan kesalahan |
Deskripsi |
| 400 | DiskCategory.OperationNotSupported | The type of the specified disk does not support creating a snapshot. | Operasi ini tidak didukung oleh kategori disk saat ini. |
| 400 | PartofDiskCategory.OperationNotSupported | The types of some disks in the disk list do not support creating snapshots. | Beberapa disk yang ditentukan tidak mendukung operasi ini. |
| 403 | ParameterInvalid | The specified RegionId parameter is invalid. | Nilai RegionId tidak valid. Periksa apakah ID wilayah yang ditentukan benar. |
| 403 | ParameterInvalid | The specified AutoSnapshotPolicyId parameter is invalid. | Nilai autoSnapshotPolicyId tidak valid. |
| 403 | ParameterInvalid | The specified DiskIds are invalid. | ID disk yang ditentukan tidak valid. Periksa apakah ID disk yang ditentukan benar. |
| 403 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | Saldo akun tidak mencukupi. Tambahkan dana ke akun Anda dan coba lagi. |
| 403 | InvalidAccountStatus.SnapshotServiceUnavailable | Snapshot service has not been opened yet. | Operasi ini tidak didukung karena layanan snapshot belum diaktifkan. |
| 404 | ParameterInvalid | The specified automatic snapshot policy does not exist. | Kebijakan snapshot otomatis yang ditentukan tidak ditemukan. |
| 404 | ParameterInvalid | The specified automatic snapshot policy does not exist in the region. | Kebijakan snapshot otomatis yang ditentukan tidak ditemukan di wilayah tersebut. |
| 404 | InvalidDiskId.NotFound | The specified disk does not exist in the region. | Disk yang ditentukan tidak ditemukan di wilayah saat ini. |
Untuk daftar kode kesalahan, lihat Service error codes.