Add-AzStorageAccountManagementPolicyAction
Menambahkan tindakan ke objek Grup Tindakan ManagementPolicy input, atau membuat objek Grup Tindakan ManagementPolicy dengan tindakan. Objek dapat digunakan di New-AzStorageAccountManagementPolicyRule.
Sintaks
Add-AzStorageAccountManagementPolicyAction
-BaseBlobAction <String>
-DaysAfterModificationGreaterThan <Int32>
[-DaysAfterLastTierChangeGreaterThan <Int32>]
[-InputObject <PSManagementPolicyActionGroup>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Add-AzStorageAccountManagementPolicyAction
-BaseBlobAction <String>
-DaysAfterLastAccessTimeGreaterThan <Int32>
[-EnableAutoTierToHotFromCool]
[-InputObject <PSManagementPolicyActionGroup>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Add-AzStorageAccountManagementPolicyAction
-BaseBlobAction <String>
-DaysAfterCreationGreaterThan <Int32>
[-InputObject <PSManagementPolicyActionGroup>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Add-AzStorageAccountManagementPolicyAction
-SnapshotAction <String>
-DaysAfterCreationGreaterThan <Int32>
[-DaysAfterLastTierChangeGreaterThan <Int32>]
[-InputObject <PSManagementPolicyActionGroup>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Add-AzStorageAccountManagementPolicyAction
-BlobVersionAction <String>
-DaysAfterCreationGreaterThan <Int32>
[-DaysAfterLastTierChangeGreaterThan <Int32>]
[-InputObject <PSManagementPolicyActionGroup>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Deskripsi
Cmdlet Add-AzStorageAccountManagementPolicyAction menambahkan tindakan ke objek Grup Tindakan ManagementPolicy input, atau membuat objek Grup Tindakan ManagementPolicy dengan tindakan.
Contoh
Contoh 1: Membuat objek Grup Tindakan ManagementPolicy dengan 4 tindakan, lalu menambahkannya ke aturan kebijakan manajemen dan diatur ke akun Penyimpanan
$action = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction Delete -DaysAfterCreationGreaterThan 100
$action = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction TierToArchive -daysAfterModificationGreaterThan 50 -DaysAfterLastTierChangeGreaterThan 40 -InputObject $action
$action = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction TierToCool -DaysAfterLastAccessTimeGreaterThan 30 -EnableAutoTierToHotFromCool -InputObject $action
$action = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction TierToHot -DaysAfterCreationGreaterThan 100 -InputObject $action
$action = Add-AzStorageAccountManagementPolicyAction -SnapshotAction Delete -daysAfterCreationGreaterThan 100 -InputObject $action
$action
BaseBlob.TierToCool.DaysAfterModificationGreaterThan :
BaseBlob.TierToCool.DaysAfterLastAccessTimeGreaterThan : 30
BaseBlob.TierToCool.DaysAfterCreationGreaterThan :
BaseBlob.EnableAutoTierToHotFromCool : True
BaseBlob.TierToArchive.DaysAfterModificationGreaterThan : 50
BaseBlob.TierToArchive.DaysAfterLastAccessTimeGreaterThan :
BaseBlob.TierToArchive.DaysAfterCreationGreaterThan :
BaseBlob.TierToArchive.DaysAfterLastTierChangeGreaterThan : 40
BaseBlob.Delete.DaysAfterModificationGreaterThan :
BaseBlob.Delete.DaysAfterLastAccessTimeGreaterThan :
BaseBlob.Delete.DaysAfterCreationGreaterThan : 100
BaseBlob.TierToCold.DaysAfterModificationGreaterThan :
BaseBlob.TierToCold.DaysAfterLastAccessTimeGreaterThan :
BaseBlob.TierToCold.DaysAfterCreationGreaterThan :
BaseBlob.TierToHot.DaysAfterModificationGreaterThan :
BaseBlob.TierToHot.DaysAfterLastAccessTimeGreaterThan :
BaseBlob.TierToHot.DaysAfterCreationGreaterThan : 100
Snapshot.TierToCool.DaysAfterCreationGreaterThan :
Snapshot.TierToArchive.DaysAfterCreationGreaterThan :
Snapshot.TierToArchive.DaysAfterLastTierChangeGreaterThan :
Snapshot.Delete.DaysAfterCreationGreaterThan : 100
Snapshot.TierToCold.DaysAfterCreationGreaterThan :
Snapshot.TierToHot.DaysAfterCreationGreaterThan :
Version.TierToCool.DaysAfterCreationGreaterThan :
Version.TierToArchive.DaysAfterCreationGreaterThan :
Version.TierToArchive.DaysAfterLastTierChangeGreaterThan :
Version.Delete.DaysAfterCreationGreaterThan :
Version.TierToCold.DaysAfterCreationGreaterThan :
Version.TierToHot.DaysAfterCreationGreaterThan :
$filter = New-AzStorageAccountManagementPolicyFilter
$rule = New-AzStorageAccountManagementPolicyRule -Name Test -Action $action -Filter $filter
$policy = Set-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -Rule $rule
Perintah pertama membuat objek Grup Tindakan ManagementPolicy, 3 perintah berikut menambahkan 3 tindakan ke objek. Kemudian tambahkan ke aturan kebijakan manajemen dan atur ke akun Storage.
Contoh 2: Membuat objek Grup Tindakan ManagementPolicy dengan 7 tindakan pada rekam jepret dan versi blob, lalu menambahkannya ke aturan kebijakan manajemen dan diatur ke akun Storage
$action = Add-AzStorageAccountManagementPolicyAction -SnapshotAction Delete -daysAfterCreationGreaterThan 40
$action = Add-AzStorageAccountManagementPolicyAction -InputObject $action -SnapshotAction TierToArchive -daysAfterCreationGreaterThan 50
$action = Add-AzStorageAccountManagementPolicyAction -InputObject $action -SnapshotAction TierToCool -daysAfterCreationGreaterThan 60
$action = Add-AzStorageAccountManagementPolicyAction -InputObject $action -BlobVersionAction Delete -daysAfterCreationGreaterThan 70
$action = Add-AzStorageAccountManagementPolicyAction -InputObject $action -BlobVersionAction TierToArchive -daysAfterCreationGreaterThan 80
$action = Add-AzStorageAccountManagementPolicyAction -InputObject $action -BlobVersionAction TierToCool -daysAfterCreationGreaterThan 90
$action = Add-AzStorageAccountManagementPolicyAction -InputObject $action -BlobVersionAction TierToCold -daysAfterCreationGreaterThan 100
$action
BaseBlob.TierToCool.DaysAfterModificationGreaterThan :
BaseBlob.TierToCool.DaysAfterLastAccessTimeGreaterThan :
BaseBlob.TierToCool.DaysAfterCreationGreaterThan :
BaseBlob.EnableAutoTierToHotFromCool :
BaseBlob.TierToArchive.DaysAfterModificationGreaterThan :
BaseBlob.TierToArchive.DaysAfterLastAccessTimeGreaterThan :
BaseBlob.TierToArchive.DaysAfterCreationGreaterThan :
BaseBlob.TierToArchive.DaysAfterLastTierChangeGreaterThan :
BaseBlob.Delete.DaysAfterModificationGreaterThan :
BaseBlob.Delete.DaysAfterLastAccessTimeGreaterThan :
BaseBlob.Delete.DaysAfterCreationGreaterThan :
BaseBlob.TierToCold.DaysAfterModificationGreaterThan :
BaseBlob.TierToCold.DaysAfterLastAccessTimeGreaterThan :
BaseBlob.TierToCold.DaysAfterCreationGreaterThan :
BaseBlob.TierToHot.DaysAfterModificationGreaterThan :
BaseBlob.TierToHot.DaysAfterLastAccessTimeGreaterThan :
BaseBlob.TierToHot.DaysAfterCreationGreaterThan :
Snapshot.TierToCool.DaysAfterCreationGreaterThan : 60
Snapshot.TierToArchive.DaysAfterCreationGreaterThan : 50
Snapshot.TierToArchive.DaysAfterLastTierChangeGreaterThan :
Snapshot.Delete.DaysAfterCreationGreaterThan : 40
Snapshot.TierToCold.DaysAfterCreationGreaterThan :
Snapshot.TierToHot.DaysAfterCreationGreaterThan :
Version.TierToCool.DaysAfterCreationGreaterThan : 90
Version.TierToArchive.DaysAfterCreationGreaterThan : 80
Version.TierToArchive.DaysAfterLastTierChangeGreaterThan :
Version.Delete.DaysAfterCreationGreaterThan : 70
Version.TierToCold.DaysAfterCreationGreaterThan : 100
Version.TierToHot.DaysAfterCreationGreaterThan :
$filter = New-AzStorageAccountManagementPolicyFilter
$rule = New-AzStorageAccountManagementPolicyRule -Name Test -Action $action -Filter $filter
$policy = Set-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -Rule $rule
Perintah pertama membuat objek Grup Tindakan ManagementPolicy, 5 perintah berikut menambahkan 5 tindakan pada rekam jepret dan versi blob ke objek. Kemudian tambahkan ke aturan kebijakan manajemen dan atur ke akun Storage.
Parameter
-BaseBlobAction
Tindakan kebijakan manajemen untuk baseblob.
Jenis: | String |
Nilai yang diterima: | Delete, TierToArchive, TierToCool, TierToCold, TierToHot |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
-BlobVersionAction
Tindakan kebijakan manajemen untuk versi blob.
Jenis: | String |
Nilai yang diterima: | Delete, TierToArchive, TierToCool, TierToCold, TierToHot |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
-DaysAfterCreationGreaterThan
Nilai bilangan bulat menunjukkan usia dalam beberapa hari setelah pembuatan.
Jenis: | Int32 |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
-DaysAfterLastAccessTimeGreaterThan
Nilai bilangan bulat yang menunjukkan usia dalam beberapa hari setelah akses blob terakhir. Properti ini hanya dapat digunakan bersama dengan kebijakan pelacakan waktu akses terakhir.
Jenis: | Int32 |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
-DaysAfterLastTierChangeGreaterThan
Nilai bilangan bulat yang menunjukkan usia dalam beberapa hari setelah waktu perubahan tingkat blob terakhir. Properti ini hanya berlaku untuk tindakan tierToArchive. Ini mengharuskan daysAfterModificationGreaterThan diatur untuk tindakan berbasis baseBlobs, atau daysAfterModificationGreaterThan untuk diatur untuk rekam jepret dan tindakan berbasis versi blob.
Jenis: | Int32 |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-DaysAfterModificationGreaterThan
Nilai bilangan bulat menunjukkan usia dalam beberapa hari setelah modifikasi terakhir.
Jenis: | Int32 |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
-DefaultProfile
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan Azure.
Jenis: | IAzureContextContainer |
Alias: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-EnableAutoTierToHotFromCool
Memungkinkan penjenjangan otomatis blob dari dingin ke panas pada akses blob. Ini hanya berfungsi dengan tindakan TierToCool dan DaysAfterLastAccessTimeGreaterThan.
Jenis: | SwitchParameter |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-InputObject
Jika memasukkan objek Tindakan ManagementPolicy, akan mengatur tindakan ke objek tindakan input. Jika tidak input, akan membuat objek tindakan baru.
Jenis: | PSManagementPolicyActionGroup |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-SnapshotAction
Tindakan kebijakan manajemen untuk rekam jepret.
Jenis: | String |
Nilai yang diterima: | Delete, TierToArchive, TierToCool, TierToCold, TierToHot |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | False |
Terima karakter wildcard: | False |
Input
Output
Azure PowerShell