az maintenance configuration
Note
This reference is part of the maintenance extension for the Azure CLI (version 2.67.0 or higher). 该扩展将在首次运行 az maintenance configuration 命令时自动安装。 Learn more about extensions.
使用维护管理维护配置。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az maintenance configuration create |
创建配置记录。 |
Extension | GA |
az maintenance configuration delete |
删除配置记录。 |
Extension | GA |
az maintenance configuration list |
列出订阅和资源组中的配置记录。 |
Extension | GA |
az maintenance configuration show |
获取配置记录。 |
Extension | GA |
az maintenance configuration update |
更新配置记录。 |
Extension | GA |
az maintenance configuration create
创建配置记录。
az maintenance configuration create --name --resource-name
--resource-group
[--duration --maintenance-window-duration]
[--expiration-date-time --maintenance-window-expiration-date-time]
[--extension-properties]
[--install-patches-linux-parameters --linux-parameters]
[--install-patches-windows-parameters --windows-parameters]
[--location]
[--maintenance-scope {Extension, Host, InGuestPatch, OSImage, Resource, SQLDB, SQLManagedInstance}]
[--maintenance-window-recur-every --recur-every]
[--maintenance-window-start-date-time --start-date-time]
[--maintenance-window-time-zone --time-zone]
[--namespace]
[--reboot-setting {Always, IfRequired, Never}]
[--tags]
[--visibility {Custom, Public}]
示例
MaintenanceConfigurations_CreateOrUpdateForResource
az maintenance configuration create --location "westus2" --maintenance-scope "OSImage" --maintenance-window-duration "05:00" --maintenance-window-expiration-date-time "9999-12-31 00:00" --maintenance-window-recur-every "Day" --maintenance-window-start-date-time "2020-04-30 08:00" --maintenance-window-time-zone "Pacific Standard Time" --namespace "Microsoft.Maintenance" --visibility "Custom" --resource-group "examplerg" --resource-name "configuration1"
必需参数
维护配置名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
HH:mm 格式的维护时段持续时间。 如果未提供,将根据提供的维护范围使用默认值。 Example: 05:00.
属性 | 值 |
---|---|
Parameter group: | MaintenanceWindow Arguments |
YYYY-MM-DD hh:mm 格式的维护时段的有效到期日期。 该窗口将在提供的时区中创建,并根据该时区调整为夏令时制。 到期日期必须设置为将来的日期。 如果未提供,它将设置为最大日期时间 9999-12-31 23:59:59。
属性 | 值 |
---|---|
Parameter group: | MaintenanceWindow Arguments |
获取或设置 maintenanceConfiguration Support 速记语法、json-file 和 yaml-file 的 extensionProperties。 请尝试“??” 以显示更多内容。
属性 | 值 |
---|---|
Parameter group: | Properties Arguments |
特定于修补 Linux 计算机的输入参数。 对于 Windows 计算机,请不要传递此属性。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
属性 | 值 |
---|---|
Parameter group: | InstallPatches Arguments |
特定于修补 Windows 计算机的输入参数。 对于 Linux 计算机,请不要传递此属性。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
属性 | 值 |
---|---|
Parameter group: | InstallPatches Arguments |
获取或设置资源的位置。
属性 | 值 |
---|---|
Parameter group: | Configuration Arguments |
获取或设置配置的 maintenanceScope。
属性 | 值 |
---|---|
Parameter group: | Properties Arguments |
接受的值: | Extension, Host, InGuestPatch, OSImage, Resource, SQLDB, SQLManagedInstance |
维护时段应递归的速率。 费率可以表示为每日、每周或每月计划。 每日计划的格式为递归:[频率为整数]['Day(s)']。 如果未提供任何频率,则默认频率为 1。 每日计划示例为 recurEvery:Day、recurEvery:3Days。 每周计划的格式为递归:[频率为整数]['Week(s)'] [可选逗号分隔的工作日星期一-星期日列表]。 每周计划示例为 recurEvery:3Weeks、recurEvery:Week Week,Sunday。 每月计划的格式为 [Frequency as integer]['Month(s)'] [以逗号分隔的月日列表] 或 [Frequency as integer]['Month(s)'] [Month of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. days)]。 偏移值必须介于 -6 到 6(含 6) 之间。 每月计划示例为 recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6.
属性 | 值 |
---|---|
Parameter group: | MaintenanceWindow Arguments |
YYYY-MM-DD hh:mm 格式的维护时段的有效开始日期。 开始日期可以设置为当前日期或将来日期。 该窗口将在提供的时区中创建,并根据该时区调整为夏令时制。
属性 | 值 |
---|---|
Parameter group: | MaintenanceWindow Arguments |
时区的名称。 可以通过在 PowerShell 中执行 [System.TimeZoneInfo]::GetSystemTimeZones()来获取时区列表。 示例:太平洋标准时间、UTC、W. 欧洲标准时间、韩国标准时间、Cen。 澳大利亚标准时间。
属性 | 值 |
---|---|
Parameter group: | MaintenanceWindow Arguments |
获取或设置资源的命名空间。
属性 | 值 |
---|---|
Parameter group: | Properties Arguments |
根据用户定义的可能的重新启动首选项,根据该首选项,决定在完成修补操作后重启计算机。
属性 | 值 |
---|---|
Parameter group: | InstallPatches Arguments |
接受的值: | Always, IfRequired, Never |
获取或设置资源支持速记语法、json-file 和 yaml-file 的标记。 请尝试“??” 以显示更多内容。
属性 | 值 |
---|---|
Parameter group: | Configuration Arguments |
获取或设置配置的可见性。 默认值为“Custom”。
属性 | 值 |
---|---|
Parameter group: | Properties Arguments |
接受的值: | Custom, Public |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az maintenance configuration delete
删除配置记录。
az maintenance configuration delete [--ids]
[--name --resource-name]
[--resource-group]
[--subscription]
[--yes]
示例
MaintenanceConfigurations_DeleteForResource
az maintenance configuration delete --resource-group "examplerg" --resource-name "example1"
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
维护配置名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不要提示确认。
属性 | 值 |
---|---|
默认值: | False |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az maintenance configuration list
列出订阅和资源组中的配置记录。
az maintenance configuration list [--resource-group]
示例
MaintenanceConfigurations_List
az maintenance configuration list
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az maintenance configuration show
获取配置记录。
az maintenance configuration show [--ids]
[--name --resource-name]
[--resource-group]
[--subscription]
示例
MaintenanceConfigurations_GetForResource
az maintenance configuration show --resource-group "examplerg" --resource-name "configuration1"
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
维护配置名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az maintenance configuration update
更新配置记录。
az maintenance configuration update [--duration --maintenance-window-duration]
[--expiration-date-time --maintenance-window-expiration-date-time]
[--extension-properties]
[--ids]
[--install-patches-linux-parameters --linux-parameters]
[--install-patches-windows-parameters --windows-parameters]
[--location]
[--maintenance-scope {Extension, Host, InGuestPatch, OSImage, Resource, SQLDB, SQLManagedInstance}]
[--maintenance-window-recur-every --recur-every]
[--maintenance-window-start-date-time --start-date-time]
[--maintenance-window-time-zone --time-zone]
[--name --resource-name]
[--namespace]
[--reboot-setting {Always, IfRequired, Never}]
[--resource-group]
[--subscription]
[--tags]
[--visibility {Custom, Public}]
示例
MaintenanceConfigurations_UpdateForResource
az maintenance configuration update --location "westus2" --maintenance-scope "OSImage" --maintenance-window-duration "05:00" --maintenance-window-expiration-date-time "9999-12-31 00:00" --maintenance-window-recur-every "Month Third Sunday" --maintenance-window-start-date-time "2020-04-30 08:00" --maintenance-window-time-zone "Pacific Standard Time" --namespace "Microsoft.Maintenance" --visibility "Custom" --resource-group "examplerg" --resource-name "configuration1"
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
HH:mm 格式的维护时段持续时间。 如果未提供,将根据提供的维护范围使用默认值。 Example: 05:00.
属性 | 值 |
---|---|
Parameter group: | MaintenanceWindow Arguments |
YYYY-MM-DD hh:mm 格式的维护时段的有效到期日期。 该窗口将在提供的时区中创建,并根据该时区调整为夏令时制。 到期日期必须设置为将来的日期。 如果未提供,它将设置为最大日期时间 9999-12-31 23:59:59。
属性 | 值 |
---|---|
Parameter group: | MaintenanceWindow Arguments |
获取或设置 maintenanceConfiguration Support 速记语法、json-file 和 yaml-file 的 extensionProperties。 请尝试“??” 以显示更多内容。
属性 | 值 |
---|---|
Parameter group: | Properties Arguments |
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
特定于修补 Linux 计算机的输入参数。 对于 Windows 计算机,请不要传递此属性。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
属性 | 值 |
---|---|
Parameter group: | InstallPatches Arguments |
特定于修补 Windows 计算机的输入参数。 对于 Linux 计算机,请不要传递此属性。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
属性 | 值 |
---|---|
Parameter group: | InstallPatches Arguments |
获取或设置资源的位置。
属性 | 值 |
---|---|
Parameter group: | Configuration Arguments |
获取或设置配置的 maintenanceScope。
属性 | 值 |
---|---|
Parameter group: | Properties Arguments |
接受的值: | Extension, Host, InGuestPatch, OSImage, Resource, SQLDB, SQLManagedInstance |
维护时段应递归的速率。 费率可以表示为每日、每周或每月计划。 每日计划的格式为递归:[频率为整数]['Day(s)']。 如果未提供任何频率,则默认频率为 1。 每日计划示例为 recurEvery:Day、recurEvery:3Days。 每周计划的格式为递归:[频率为整数]['Week(s)'] [可选逗号分隔的工作日星期一-星期日列表]。 每周计划示例为 recurEvery:3Weeks、recurEvery:Week Week,Sunday。 每月计划的格式为 [Frequency as integer]['Month(s)'] [以逗号分隔的月日列表] 或 [Frequency as integer]['Month(s)'] [Month of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. days)]。 偏移值必须介于 -6 到 6(含 6) 之间。 每月计划示例为 recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6.
属性 | 值 |
---|---|
Parameter group: | MaintenanceWindow Arguments |
YYYY-MM-DD hh:mm 格式的维护时段的有效开始日期。 开始日期可以设置为当前日期或将来日期。 该窗口将在提供的时区中创建,并根据该时区调整为夏令时制。
属性 | 值 |
---|---|
Parameter group: | MaintenanceWindow Arguments |
时区的名称。 可以通过在 PowerShell 中执行 [System.TimeZoneInfo]::GetSystemTimeZones()来获取时区列表。 示例:太平洋标准时间、UTC、W. 欧洲标准时间、韩国标准时间、Cen。 澳大利亚标准时间。
属性 | 值 |
---|---|
Parameter group: | MaintenanceWindow Arguments |
维护配置名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
获取或设置资源的命名空间。
属性 | 值 |
---|---|
Parameter group: | Properties Arguments |
根据用户定义的可能的重新启动首选项,根据该首选项,决定在完成修补操作后重启计算机。
属性 | 值 |
---|---|
Parameter group: | InstallPatches Arguments |
接受的值: | Always, IfRequired, Never |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
获取或设置资源支持速记语法、json-file 和 yaml-file 的标记。 请尝试“??” 以显示更多内容。
属性 | 值 |
---|---|
Parameter group: | Configuration Arguments |
获取或设置配置的可见性。 默认值为“Custom”。
属性 | 值 |
---|---|
Parameter group: | Properties Arguments |
接受的值: | Custom, Public |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |