gpt4 book ai didi

azure - 如何使用 CLI 创建 Azure 备份策略?

转载 作者:行者123 更新时间:2023-12-02 07:46:46 24 4
gpt4 key购买 nike

最佳答案

其实是支持的,但是官方文档缺少说明,还有REST API表示createupdate使用相同的api。

enter image description here

你可以尝试下面的命令,在我这边效果很好。

az backup policy set --policy '{
"name": "testpolicy3",
"properties": {
"backupManagementType": "AzureIaasVM",
"instantRpRetentionRangeInDays": 2,
"protectedItemsCount": 0,
"retentionPolicy": {
"dailySchedule": {
"retentionDuration": {
"count": 180,
"durationType": "Days"
},
"retentionTimes": [
"2019-07-09T07:30:00+00:00"
]
},
"monthlySchedule": {
"retentionDuration": {
"count": 60,
"durationType": "Months"
},
"retentionScheduleDaily": null,
"retentionScheduleFormatType": "Weekly",
"retentionScheduleWeekly": {
"daysOfTheWeek": [
"Sunday"
],
"weeksOfTheMonth": [
"First"
]
},
"retentionTimes": [
"2019-07-09T07:30:00+00:00"
]
},
"retentionPolicyType": "LongTermRetentionPolicy",
"weeklySchedule": {
"daysOfTheWeek": [
"Sunday"
],
"retentionDuration": {
"count": 12,
"durationType": "Weeks"
},
"retentionTimes": [
"2019-07-09T07:30:00+00:00"
]
},
"yearlySchedule": {
"monthsOfYear": [
"January"
],
"retentionDuration": {
"count": 10,
"durationType": "Years"
},
"retentionScheduleDaily": null,
"retentionScheduleFormatType": "Weekly",
"retentionScheduleWeekly": {
"daysOfTheWeek": [
"Sunday"
],
"weeksOfTheMonth": [
"First"
]
},
"retentionTimes": [
"2019-07-09T07:30:00+00:00"
]
}
},
"schedulePolicy": {
"schedulePolicyType": "SimpleSchedulePolicy",
"scheduleRunDays": null,
"scheduleRunFrequency": "Daily",
"scheduleRunTimes": [
"2019-07-09T07:30:00+00:00"
],
"scheduleWeeklyFrequency": 0
},
"timeZone": "UTC"
},
"resourceGroup": "joywebapp",
"tags": null,
"type": "Microsoft.RecoveryServices/vaults/backupPolicies"
}' --resource-group 'joywebapp' --vault-name 'joyvault'

enter image description here

关于azure - 如何使用 CLI 创建 Azure 备份策略?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56944847/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com