Generate maintenance extension using 2021-09-01-preview version. (#3913)
Co-authored-by: Kalpesh Chavan <kachavan@microsoft.com>
This commit is contained in:
Родитель
f469ebfaee
Коммит
10c758beca
|
@ -1251,6 +1251,14 @@ maintenance assignment create:
|
|||
maintenance_configuration_id:
|
||||
rule_exclusions:
|
||||
- option_length_too_long
|
||||
maintenance assignment create-or-update-parent:
|
||||
parameters:
|
||||
configuration_assignment_name:
|
||||
rule_exclusions:
|
||||
- option_length_too_long
|
||||
maintenance_configuration_id:
|
||||
rule_exclusions:
|
||||
- option_length_too_long
|
||||
maintenance assignment delete:
|
||||
parameters:
|
||||
configuration_assignment_name:
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
Release History
|
||||
===============
|
||||
|
||||
1.3.0
|
||||
++++++
|
||||
* Added support for VM patch maintenance.
|
||||
|
||||
1.2.0
|
||||
++++++
|
||||
* Added support for VMSS OSImage and extension.
|
||||
|
|
|
@ -7,16 +7,13 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
# pylint: disable=unused-import
|
||||
|
||||
import azext_maintenance._help
|
||||
from azure.cli.core import AzCommandsLoader
|
||||
from azext_maintenance.generated._help import helps # pylint: disable=unused-import
|
||||
try:
|
||||
from azext_maintenance.manual._help import helps # pylint: disable=reimported
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
class MaintenanceClientCommandsLoader(AzCommandsLoader):
|
||||
class MaintenanceManagementClientCommandsLoader(AzCommandsLoader):
|
||||
|
||||
def __init__(self, cli_ctx=None):
|
||||
from azure.cli.core.commands import CliCommandType
|
||||
|
@ -24,7 +21,7 @@ class MaintenanceClientCommandsLoader(AzCommandsLoader):
|
|||
maintenance_custom = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.custom#{}',
|
||||
client_factory=cf_maintenance_cl)
|
||||
parent = super(MaintenanceClientCommandsLoader, self)
|
||||
parent = super(MaintenanceManagementClientCommandsLoader, self)
|
||||
parent.__init__(cli_ctx=cli_ctx, custom_command_type=maintenance_custom)
|
||||
|
||||
def load_command_table(self, args):
|
||||
|
@ -33,8 +30,11 @@ class MaintenanceClientCommandsLoader(AzCommandsLoader):
|
|||
try:
|
||||
from azext_maintenance.manual.commands import load_command_table as load_command_table_manual
|
||||
load_command_table_manual(self, args)
|
||||
except ImportError:
|
||||
pass
|
||||
except ImportError as e:
|
||||
if e.name.endswith('manual.commands'):
|
||||
pass
|
||||
else:
|
||||
raise e
|
||||
return self.command_table
|
||||
|
||||
def load_arguments(self, command):
|
||||
|
@ -43,8 +43,11 @@ class MaintenanceClientCommandsLoader(AzCommandsLoader):
|
|||
try:
|
||||
from azext_maintenance.manual._params import load_arguments as load_arguments_manual
|
||||
load_arguments_manual(self, command)
|
||||
except ImportError:
|
||||
pass
|
||||
except ImportError as e:
|
||||
if e.name.endswith('manual._params'):
|
||||
pass
|
||||
else:
|
||||
raise e
|
||||
|
||||
|
||||
COMMAND_LOADER_CLS = MaintenanceClientCommandsLoader
|
||||
COMMAND_LOADER_CLS = MaintenanceManagementClientCommandsLoader
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for
|
||||
# license information.
|
||||
#
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
# pylint: disable=wildcard-import
|
||||
# pylint: disable=unused-wildcard-import
|
||||
# pylint: disable=unused-import
|
||||
from .generated._help import helps # pylint: disable=reimported
|
||||
try:
|
||||
from .manual._help import helps # pylint: disable=reimported
|
||||
except ImportError as e:
|
||||
if e.name.endswith('manual._help'):
|
||||
pass
|
||||
else:
|
||||
raise e
|
|
@ -13,5 +13,8 @@
|
|||
from .generated.action import * # noqa: F403
|
||||
try:
|
||||
from .manual.action import * # noqa: F403
|
||||
except ImportError:
|
||||
pass
|
||||
except ImportError as e:
|
||||
if e.name.endswith('manual.action'):
|
||||
pass
|
||||
else:
|
||||
raise e
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"azext.isExperimental": true,
|
||||
"azext.minCliCoreVersion": "2.15.0"
|
||||
}
|
|
@ -13,5 +13,8 @@
|
|||
from .generated.custom import * # noqa: F403
|
||||
try:
|
||||
from .manual.custom import * # noqa: F403
|
||||
except ImportError:
|
||||
pass
|
||||
except ImportError as e:
|
||||
if e.name.endswith('manual.custom'):
|
||||
pass
|
||||
else:
|
||||
raise e
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
|
||||
def cf_maintenance_cl(cli_ctx, *_):
|
||||
from azure.cli.core.commands.client_factory import get_mgmt_service_client
|
||||
from azext_maintenance.vendored_sdks.maintenance import MaintenanceClient
|
||||
from azext_maintenance.vendored_sdks.maintenance import MaintenanceManagementClient
|
||||
return get_mgmt_service_client(cli_ctx,
|
||||
MaintenanceClient)
|
||||
MaintenanceManagementClient)
|
||||
|
||||
|
||||
def cf_public_maintenance_configuration(cli_ctx, *_):
|
||||
|
@ -32,13 +32,5 @@ def cf_maintenance_configuration(cli_ctx, *_):
|
|||
return cf_maintenance_cl(cli_ctx).maintenance_configurations
|
||||
|
||||
|
||||
def cf_maintenance_configuration_for_resource_group(cli_ctx, *_):
|
||||
return cf_maintenance_cl(cli_ctx).maintenance_configurations_for_resource_group
|
||||
|
||||
|
||||
def cf_apply_update_for_resource_group(cli_ctx, *_):
|
||||
return cf_maintenance_cl(cli_ctx).apply_update_for_resource_group
|
||||
|
||||
|
||||
def cf_update(cli_ctx, *_):
|
||||
return cf_maintenance_cl(cli_ctx).updates
|
||||
|
|
|
@ -12,6 +12,11 @@
|
|||
from knack.help_files import helps
|
||||
|
||||
|
||||
helps['maintenance'] = '''
|
||||
type: group
|
||||
short-summary: Manage Maintenance
|
||||
'''
|
||||
|
||||
helps['maintenance public-configuration'] = """
|
||||
type: group
|
||||
short-summary: Manage public maintenance configuration with maintenance
|
||||
|
@ -61,13 +66,8 @@ helps['maintenance applyupdate show'] = """
|
|||
|
||||
helps['maintenance applyupdate create'] = """
|
||||
type: command
|
||||
short-summary: "Apply maintenance updates to resource with parent And Apply maintenance updates to resource."
|
||||
short-summary: "Apply maintenance updates to resource."
|
||||
examples:
|
||||
- name: ApplyUpdates_CreateOrUpdateParent
|
||||
text: |-
|
||||
az maintenance applyupdate create --provider-name "Microsoft.Compute" --resource-group "examplerg" \
|
||||
--resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type "virtualMachineScaleSets" \
|
||||
--resource-type "virtualMachines"
|
||||
- name: ApplyUpdates_CreateOrUpdate
|
||||
text: |-
|
||||
az maintenance applyupdate create --provider-name "Microsoft.Compute" --resource-group "examplerg" \
|
||||
|
@ -79,6 +79,17 @@ helps['maintenance applyupdate update'] = """
|
|||
short-summary: "Apply maintenance updates to resource."
|
||||
"""
|
||||
|
||||
helps['maintenance applyupdate create-or-update-parent'] = """
|
||||
type: command
|
||||
short-summary: "Apply maintenance updates to resource with parent."
|
||||
examples:
|
||||
- name: ApplyUpdates_CreateOrUpdateParent
|
||||
text: |-
|
||||
az maintenance applyupdate create-or-update-parent --provider-name "Microsoft.Compute" --resource-group \
|
||||
"examplerg" --resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type \
|
||||
"virtualMachineScaleSets" --resource-type "virtualMachines"
|
||||
"""
|
||||
|
||||
helps['maintenance applyupdate show-parent'] = """
|
||||
type: command
|
||||
short-summary: "Track maintenance updates to resource with parent."
|
||||
|
@ -116,16 +127,20 @@ helps['maintenance assignment list'] = """
|
|||
--resource-name "smdtest1" --resource-type "virtualMachineScaleSets"
|
||||
"""
|
||||
|
||||
helps['maintenance assignment show'] = """
|
||||
type: command
|
||||
short-summary: "Get configuration for resource."
|
||||
examples:
|
||||
- name: ConfigurationAssignments_Get
|
||||
text: |-
|
||||
az maintenance assignment show --name "workervmConfiguration" --provider-name "Microsoft.Compute" \
|
||||
--resource-group "examplerg" --resource-name "smdtest1" --resource-type "virtualMachineScaleSets"
|
||||
"""
|
||||
|
||||
helps['maintenance assignment create'] = """
|
||||
type: command
|
||||
short-summary: "Register configuration for resource. And Register configuration for resource."
|
||||
short-summary: "Register configuration for resource."
|
||||
examples:
|
||||
- name: ConfigurationAssignments_CreateOrUpdateParent
|
||||
text: |-
|
||||
az maintenance assignment create --maintenance-configuration-id "/subscriptions/5b4b650e-28b9-4790-b3ab-\
|
||||
ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1" --name \
|
||||
"workervmPolicy" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdvm1" \
|
||||
--resource-parent-name "smdtest1" --resource-parent-type "virtualMachineScaleSets" --resource-type "virtualMachines"
|
||||
- name: ConfigurationAssignments_CreateOrUpdate
|
||||
text: |-
|
||||
az maintenance assignment create --maintenance-configuration-id "/subscriptions/5b4b650e-28b9-4790-b3ab-\
|
||||
|
@ -141,19 +156,38 @@ helps['maintenance assignment update'] = """
|
|||
|
||||
helps['maintenance assignment delete'] = """
|
||||
type: command
|
||||
short-summary: "Unregister configuration for resource. And Unregister configuration for resource."
|
||||
short-summary: "Unregister configuration for resource."
|
||||
examples:
|
||||
- name: ConfigurationAssignments_DeleteParent
|
||||
text: |-
|
||||
az maintenance assignment delete --name "workervmConfiguration" --provider-name "Microsoft.Compute" \
|
||||
--resource-group "examplerg" --resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type \
|
||||
"virtualMachineScaleSets" --resource-type "virtualMachines"
|
||||
- name: ConfigurationAssignments_Delete
|
||||
text: |-
|
||||
az maintenance assignment delete --name "workervmConfiguration" --provider-name "Microsoft.Compute" \
|
||||
--resource-group "examplerg" --resource-name "smdtest1" --resource-type "virtualMachineScaleSets"
|
||||
"""
|
||||
|
||||
helps['maintenance assignment create-or-update-parent'] = """
|
||||
type: command
|
||||
short-summary: "Register configuration for resource."
|
||||
examples:
|
||||
- name: ConfigurationAssignments_CreateOrUpdateParent
|
||||
text: |-
|
||||
az maintenance assignment create-or-update-parent --maintenance-configuration-id \
|
||||
"/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenan\
|
||||
ceConfigurations/policy1" --name "workervmPolicy" --provider-name "Microsoft.Compute" --resource-group "examplerg" \
|
||||
--resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type "virtualMachineScaleSets" \
|
||||
--resource-type "virtualMachines"
|
||||
"""
|
||||
|
||||
helps['maintenance assignment delete-parent'] = """
|
||||
type: command
|
||||
short-summary: "Unregister configuration for resource."
|
||||
examples:
|
||||
- name: ConfigurationAssignments_DeleteParent
|
||||
text: |-
|
||||
az maintenance assignment delete-parent --name "workervmConfiguration" --provider-name \
|
||||
"Microsoft.Compute" --resource-group "examplerg" --resource-name "smdvm1" --resource-parent-name "smdtest1" \
|
||||
--resource-parent-type "virtualMachineScaleSets" --resource-type "virtualMachines"
|
||||
"""
|
||||
|
||||
helps['maintenance assignment list-parent'] = """
|
||||
type: command
|
||||
short-summary: "List configurationAssignments for resource."
|
||||
|
@ -165,6 +199,17 @@ helps['maintenance assignment list-parent'] = """
|
|||
--resource-type "virtualMachines"
|
||||
"""
|
||||
|
||||
helps['maintenance assignment show-parent'] = """
|
||||
type: command
|
||||
short-summary: "Get configuration for resource."
|
||||
examples:
|
||||
- name: ConfigurationAssignments_GetParent
|
||||
text: |-
|
||||
az maintenance assignment show-parent --name "workervmPolicy" --provider-name "Microsoft.Compute" \
|
||||
--resource-group "examplerg" --resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type \
|
||||
"virtualMachineScaleSets" --resource-type "virtualMachines"
|
||||
"""
|
||||
|
||||
helps['maintenance configuration'] = """
|
||||
type: group
|
||||
short-summary: Manage maintenance configuration with maintenance
|
||||
|
@ -186,17 +231,45 @@ helps['maintenance configuration show'] = """
|
|||
- name: MaintenanceConfigurations_GetForResource
|
||||
text: |-
|
||||
az maintenance configuration show --resource-group "examplerg" --resource-name "configuration1"
|
||||
- name: MaintenanceConfigurations_GetForResource_GuestOSPatchLinux
|
||||
text: |-
|
||||
az maintenance configuration show --resource-group "examplerg" --resource-name "configuration1"
|
||||
- name: MaintenanceConfigurations_GetForResource_GuestOSPatchWindows
|
||||
text: |-
|
||||
az maintenance configuration show --resource-group "examplerg" --resource-name "configuration1"
|
||||
"""
|
||||
|
||||
helps['maintenance configuration create'] = """
|
||||
type: command
|
||||
short-summary: "Create configuration record."
|
||||
parameters:
|
||||
- name: --install-patches-windows-parameters --windows-parameters
|
||||
short-summary: "Input parameters specific to patching a Windows machine. For Linux machines, do not pass this \
|
||||
property."
|
||||
long-summary: |
|
||||
Usage: --install-patches-windows-parameters kb-numbers-to-exclude=XX kb-numbers-to-include=XX \
|
||||
classifications-to-include=XX exclude-kbs-requiring-reboot=XX
|
||||
|
||||
kb-numbers-to-exclude: Windows KBID to be excluded for patching.
|
||||
kb-numbers-to-include: Windows KBID to be included for patching.
|
||||
classifications-to-include: Classification category of patches to be patched
|
||||
exclude-kbs-requiring-reboot: Exclude patches which need reboot
|
||||
- name: --install-patches-linux-parameters --linux-parameters
|
||||
short-summary: "Input parameters specific to patching Linux machine. For Windows machines, do not pass this \
|
||||
property."
|
||||
long-summary: |
|
||||
Usage: --install-patches-linux-parameters package-name-masks-to-exclude=XX package-name-masks-to-include=XX\
|
||||
classifications-to-include=XX
|
||||
|
||||
package-name-masks-to-exclude: Package names to be excluded for patching.
|
||||
package-name-masks-to-include: Package names to be included for patching.
|
||||
classifications-to-include: Classification category of patches to be patched
|
||||
examples:
|
||||
- name: MaintenanceConfigurations_CreateOrUpdateForResource
|
||||
text: |-
|
||||
az maintenance configuration create --location "westus2" --maintenance-scope "Host" \
|
||||
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 "2025-04-30 08: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"
|
||||
"""
|
||||
|
@ -204,12 +277,34 @@ helps['maintenance configuration create'] = """
|
|||
helps['maintenance configuration update'] = """
|
||||
type: command
|
||||
short-summary: "Patch configuration record."
|
||||
parameters:
|
||||
- name: --install-patches-windows-parameters --windows-parameters
|
||||
short-summary: "Input parameters specific to patching a Windows machine. For Linux machines, do not pass this \
|
||||
property."
|
||||
long-summary: |
|
||||
Usage: --install-patches-windows-parameters kb-numbers-to-exclude=XX kb-numbers-to-include=XX \
|
||||
classifications-to-include=XX exclude-kbs-requiring-reboot=XX
|
||||
|
||||
kb-numbers-to-exclude: Windows KBID to be excluded for patching.
|
||||
kb-numbers-to-include: Windows KBID to be included for patching.
|
||||
classifications-to-include: Classification category of patches to be patched
|
||||
exclude-kbs-requiring-reboot: Exclude patches which need reboot
|
||||
- name: --install-patches-linux-parameters --linux-parameters
|
||||
short-summary: "Input parameters specific to patching Linux machine. For Windows machines, do not pass this \
|
||||
property."
|
||||
long-summary: |
|
||||
Usage: --install-patches-linux-parameters package-name-masks-to-exclude=XX package-name-masks-to-include=XX\
|
||||
classifications-to-include=XX
|
||||
|
||||
package-name-masks-to-exclude: Package names to be excluded for patching.
|
||||
package-name-masks-to-include: Package names to be included for patching.
|
||||
classifications-to-include: Classification category of patches to be patched
|
||||
examples:
|
||||
- name: MaintenanceConfigurations_UpdateForResource
|
||||
text: |-
|
||||
az maintenance configuration update --location "westus2" --maintenance-scope "Host" \
|
||||
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 "2025-04-30 08: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"
|
||||
"""
|
||||
|
@ -223,34 +318,6 @@ helps['maintenance configuration delete'] = """
|
|||
az maintenance configuration delete --resource-group "examplerg" --resource-name "example1"
|
||||
"""
|
||||
|
||||
helps['maintenance configuration-for-resource-group'] = """
|
||||
type: group
|
||||
short-summary: Manage maintenance configuration for resource group with maintenance
|
||||
"""
|
||||
|
||||
helps['maintenance configuration-for-resource-group list'] = """
|
||||
type: command
|
||||
short-summary: "Get Configuration records within a subscription and resource group."
|
||||
examples:
|
||||
- name: MaintenanceConfigurationsResourceGroup_List
|
||||
text: |-
|
||||
az maintenance configuration-for-resource-group list --resource-group "examplerg"
|
||||
"""
|
||||
|
||||
helps['maintenance applyupdate-for-resource-group'] = """
|
||||
type: group
|
||||
short-summary: Manage apply update for resource group with maintenance
|
||||
"""
|
||||
|
||||
helps['maintenance applyupdate-for-resource-group list'] = """
|
||||
type: command
|
||||
short-summary: "Get Configuration records within a subscription and resource group."
|
||||
examples:
|
||||
- name: ApplyUpdatesResourceGroup_List
|
||||
text: |-
|
||||
az maintenance applyupdate-for-resource-group list --resource-group "examplerg"
|
||||
"""
|
||||
|
||||
helps['maintenance update'] = """
|
||||
type: group
|
||||
short-summary: Manage update with maintenance
|
||||
|
|
|
@ -16,8 +16,15 @@ from azure.cli.core.commands.parameters import (
|
|||
resource_group_name_type,
|
||||
get_location_type
|
||||
)
|
||||
from azure.cli.core.commands.validators import get_default_location_from_resource_group
|
||||
from azext_maintenance.action import AddExtensionProperties
|
||||
from azure.cli.core.commands.validators import (
|
||||
get_default_location_from_resource_group,
|
||||
validate_file_or_dict
|
||||
)
|
||||
from azext_maintenance.action import (
|
||||
AddExtensionProperties,
|
||||
AddWindowsParameters,
|
||||
AddLinuxParameters
|
||||
)
|
||||
|
||||
|
||||
def load_arguments(self, _):
|
||||
|
@ -36,8 +43,6 @@ def load_arguments(self, _):
|
|||
with self.argument_context('maintenance applyupdate create') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('provider_name', type=str, help='Resource provider name')
|
||||
c.argument('resource_parent_type', type=str, help='Resource parent type')
|
||||
c.argument('resource_parent_name', type=str, help='Resource parent identifier')
|
||||
c.argument('resource_type', type=str, help='Resource type')
|
||||
c.argument('resource_name', type=str, help='Resource identifier')
|
||||
|
||||
|
@ -47,6 +52,14 @@ def load_arguments(self, _):
|
|||
c.argument('resource_type', type=str, help='Resource type')
|
||||
c.argument('resource_name', type=str, help='Resource identifier')
|
||||
|
||||
with self.argument_context('maintenance applyupdate create-or-update-parent') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('provider_name', type=str, help='Resource provider name')
|
||||
c.argument('resource_parent_type', type=str, help='Resource parent type')
|
||||
c.argument('resource_parent_name', type=str, help='Resource parent identifier')
|
||||
c.argument('resource_type', type=str, help='Resource type')
|
||||
c.argument('resource_name', type=str, help='Resource identifier')
|
||||
|
||||
with self.argument_context('maintenance applyupdate show-parent') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('resource_parent_type', type=str, help='Resource parent type')
|
||||
|
@ -63,11 +76,17 @@ def load_arguments(self, _):
|
|||
c.argument('resource_type', type=str, help='Resource type')
|
||||
c.argument('resource_name', type=str, help='Resource identifier')
|
||||
|
||||
with self.argument_context('maintenance assignment show') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('provider_name', type=str, help='Resource provider name')
|
||||
c.argument('resource_type', type=str, help='Resource type')
|
||||
c.argument('resource_name', type=str, help='Resource identifier')
|
||||
c.argument('configuration_assignment_name', options_list=['--name', '-n', '--configuration-assignment-name'],
|
||||
type=str, help='Configuration assignment name')
|
||||
|
||||
with self.argument_context('maintenance assignment create') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('provider_name', type=str, help='Resource provider name')
|
||||
c.argument('resource_parent_type', type=str, help='Resource parent type')
|
||||
c.argument('resource_parent_name', type=str, help='Resource parent identifier')
|
||||
c.argument('resource_type', type=str, help='Resource type')
|
||||
c.argument('resource_name', type=str, help='Resource identifier')
|
||||
c.argument('configuration_assignment_name', options_list=['--name', '-n', '--configuration-assignment-name'],
|
||||
|
@ -88,8 +107,31 @@ def load_arguments(self, _):
|
|||
validator=get_default_location_from_resource_group)
|
||||
c.argument('maintenance_configuration_id', type=str, help='The maintenance configuration Id')
|
||||
c.argument('resource_id', type=str, help='The unique resourceId')
|
||||
c.ignore('configuration_assignment')
|
||||
|
||||
with self.argument_context('maintenance assignment delete') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('provider_name', type=str, help='Resource provider name')
|
||||
c.argument('resource_type', type=str, help='Resource type')
|
||||
c.argument('resource_name', type=str, help='Resource identifier')
|
||||
c.argument('configuration_assignment_name', options_list=['--name', '-n', '--configuration-assignment-name'],
|
||||
type=str, help='Unique configuration assignment name')
|
||||
|
||||
with self.argument_context('maintenance assignment create-or-update-parent') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('provider_name', type=str, help='Resource provider name')
|
||||
c.argument('resource_parent_type', type=str, help='Resource parent type')
|
||||
c.argument('resource_parent_name', type=str, help='Resource parent identifier')
|
||||
c.argument('resource_type', type=str, help='Resource type')
|
||||
c.argument('resource_name', type=str, help='Resource identifier')
|
||||
c.argument('configuration_assignment_name', options_list=['--name', '-n', '--configuration-assignment-name'],
|
||||
type=str, help='Configuration assignment name')
|
||||
c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False,
|
||||
validator=get_default_location_from_resource_group)
|
||||
c.argument('maintenance_configuration_id', type=str, help='The maintenance configuration Id')
|
||||
c.argument('resource_id', type=str, help='The unique resourceId')
|
||||
|
||||
with self.argument_context('maintenance assignment delete-parent') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('provider_name', type=str, help='Resource provider name')
|
||||
c.argument('resource_parent_type', type=str, help='Resource parent type')
|
||||
|
@ -107,6 +149,16 @@ def load_arguments(self, _):
|
|||
c.argument('resource_type', type=str, help='Resource type')
|
||||
c.argument('resource_name', type=str, help='Resource identifier')
|
||||
|
||||
with self.argument_context('maintenance assignment show-parent') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('provider_name', type=str, help='Resource provider name')
|
||||
c.argument('resource_parent_type', type=str, help='Resource parent type')
|
||||
c.argument('resource_parent_name', type=str, help='Resource parent identifier')
|
||||
c.argument('resource_type', type=str, help='Resource type')
|
||||
c.argument('resource_name', type=str, help='Resource identifier')
|
||||
c.argument('configuration_assignment_name', options_list=['--name', '-n', '--configuration-assignment-name'],
|
||||
type=str, help='Configuration assignment name')
|
||||
|
||||
with self.argument_context('maintenance configuration show') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('resource_name', type=str, help='Maintenance Configuration Name')
|
||||
|
@ -152,9 +204,27 @@ def load_arguments(self, _):
|
|||
'Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly '
|
||||
'schedules are formatted as [Frequency as integer][\'Month(s)\'] [Comma separated list of month '
|
||||
'days] or [Frequency as integer][\'Month(s)\'] [Week of Month (First, Second, Third, Fourth, Last)] '
|
||||
'[Weekday Monday-Sunday]. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, '
|
||||
'recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday.',
|
||||
arg_group='Maintenance Window')
|
||||
'[Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 '
|
||||
'inclusive. Monthly schedule examples are 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.', arg_group='Maintenance Window')
|
||||
c.argument('reboot_setting', arg_type=get_enum_type(['IfRequired', 'Never', 'Always']), help='Possible reboot '
|
||||
'preference as defined by the user based on which it would be decided to reboot the machine or not '
|
||||
'after the patch operation is completed.', arg_group='Install Patches')
|
||||
c.argument('windows_parameters', options_list=['--install-patches-windows-parameters', '--windows-parameters'],
|
||||
action=AddWindowsParameters, nargs='+', help='Input parameters specific to patching a Windows '
|
||||
'machine. For Linux machines, do not pass this property.', arg_group='Install Patches')
|
||||
c.argument('linux_parameters', options_list=['--install-patches-linux-parameters', '--linux-parameters'],
|
||||
action=AddLinuxParameters, nargs='+', help='Input parameters specific to patching Linux machine. '
|
||||
'For Windows machines, do not pass this property.', arg_group='Install Patches')
|
||||
c.argument('pre_tasks', options_list=['--install-patches-pre-tasks', '--pre-tasks'],
|
||||
type=validate_file_or_dict, help='List of pre tasks. e.g. [{\'source\' :\'runbook\', \'taskScope\': '
|
||||
'\'Global\', \'parameters\': { \'arg1\': \'value1\'}}] Expected value: '
|
||||
'json-string/json-file/@json-file.', arg_group='Install Patches Tasks')
|
||||
c.argument('post_tasks', options_list=['--install-patches-post-tasks', '--post-tasks'],
|
||||
type=validate_file_or_dict, help='List of post tasks. e.g. [{\'source\' :\'runbook\', '
|
||||
'\'taskScope\': \'Resource\', \'parameters\': { \'arg1\': \'value1\'}}] Expected value: '
|
||||
'json-string/json-file/@json-file.', arg_group='Install Patches Tasks')
|
||||
|
||||
with self.argument_context('maintenance configuration update') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
|
@ -197,20 +267,32 @@ def load_arguments(self, _):
|
|||
'Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly '
|
||||
'schedules are formatted as [Frequency as integer][\'Month(s)\'] [Comma separated list of month '
|
||||
'days] or [Frequency as integer][\'Month(s)\'] [Week of Month (First, Second, Third, Fourth, Last)] '
|
||||
'[Weekday Monday-Sunday]. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, '
|
||||
'recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday.',
|
||||
arg_group='Maintenance Window')
|
||||
'[Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 '
|
||||
'inclusive. Monthly schedule examples are 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.', arg_group='Maintenance Window')
|
||||
c.argument('reboot_setting', arg_type=get_enum_type(['IfRequired', 'Never', 'Always']), help='Possible reboot '
|
||||
'preference as defined by the user based on which it would be decided to reboot the machine or not '
|
||||
'after the patch operation is completed.', arg_group='Install Patches')
|
||||
c.argument('windows_parameters', options_list=['--install-patches-windows-parameters', '--windows-parameters'],
|
||||
action=AddWindowsParameters, nargs='+', help='Input parameters specific to patching a Windows '
|
||||
'machine. For Linux machines, do not pass this property.', arg_group='Install Patches')
|
||||
c.argument('linux_parameters', options_list=['--install-patches-linux-parameters', '--linux-parameters'],
|
||||
action=AddLinuxParameters, nargs='+', help='Input parameters specific to patching Linux machine. '
|
||||
'For Windows machines, do not pass this property.', arg_group='Install Patches')
|
||||
c.argument('pre_tasks', options_list=['--install-patches-pre-tasks', '--pre-tasks'],
|
||||
type=validate_file_or_dict, help='List of pre tasks. e.g. [{\'source\' :\'runbook\', \'taskScope\': '
|
||||
'\'Global\', \'parameters\': { \'arg1\': \'value1\'}}] Expected value: '
|
||||
'json-string/json-file/@json-file.', arg_group='Install Patches Tasks')
|
||||
c.argument('post_tasks', options_list=['--install-patches-post-tasks', '--post-tasks'],
|
||||
type=validate_file_or_dict, help='List of post tasks. e.g. [{\'source\' :\'runbook\', '
|
||||
'\'taskScope\': \'Resource\', \'parameters\': { \'arg1\': \'value1\'}}] Expected value: '
|
||||
'json-string/json-file/@json-file.', arg_group='Install Patches Tasks')
|
||||
|
||||
with self.argument_context('maintenance configuration delete') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('resource_name', type=str, help='Maintenance Configuration Name')
|
||||
|
||||
with self.argument_context('maintenance configuration-for-resource-group list') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
|
||||
with self.argument_context('maintenance applyupdate-for-resource-group list') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
|
||||
with self.argument_context('maintenance update list') as c:
|
||||
c.argument('resource_group_name', resource_group_name_type)
|
||||
c.argument('provider_name', type=str, help='Resource provider name')
|
||||
|
|
|
@ -7,8 +7,13 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
|
||||
# pylint: disable=protected-access
|
||||
|
||||
# pylint: disable=no-self-use
|
||||
|
||||
|
||||
import argparse
|
||||
from collections import defaultdict
|
||||
from knack.util import CLIError
|
||||
|
@ -19,7 +24,7 @@ class AddExtensionProperties(argparse.Action):
|
|||
action = self.get_action(values, option_string)
|
||||
namespace.extension_properties = action
|
||||
|
||||
def get_action(self, values, option_string): # pylint: disable=no-self-use
|
||||
def get_action(self, values, option_string):
|
||||
try:
|
||||
properties = defaultdict(list)
|
||||
for (k, v) in (x.split('=', 1) for x in values):
|
||||
|
@ -30,5 +35,85 @@ class AddExtensionProperties(argparse.Action):
|
|||
d = {}
|
||||
for k in properties:
|
||||
v = properties[k]
|
||||
|
||||
d[k] = v[0]
|
||||
|
||||
return d
|
||||
|
||||
|
||||
class AddWindowsParameters(argparse.Action):
|
||||
def __call__(self, parser, namespace, values, option_string=None):
|
||||
action = self.get_action(values, option_string)
|
||||
namespace.windows_parameters = action
|
||||
|
||||
def get_action(self, values, option_string):
|
||||
try:
|
||||
properties = defaultdict(list)
|
||||
for (k, v) in (x.split('=', 1) for x in values):
|
||||
properties[k].append(v)
|
||||
properties = dict(properties)
|
||||
except ValueError:
|
||||
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
|
||||
d = {}
|
||||
for k in properties:
|
||||
kl = k.lower()
|
||||
v = properties[k]
|
||||
|
||||
if kl == 'kb-numbers-to-exclude':
|
||||
d['kb_numbers_to_exclude'] = v
|
||||
|
||||
elif kl == 'kb-numbers-to-include':
|
||||
d['kb_numbers_to_include'] = v
|
||||
|
||||
elif kl == 'classifications-to-include':
|
||||
d['classifications_to_include'] = v
|
||||
|
||||
elif kl == 'exclude-kbs-requiring-reboot':
|
||||
d['exclude_kbs_requiring_reboot'] = v[0]
|
||||
|
||||
else:
|
||||
raise CLIError(
|
||||
'Unsupported Key {} is provided for parameter windows-parameters. All possible keys are:'
|
||||
' kb-numbers-to-exclude, kb-numbers-to-include, classifications-to-include,'
|
||||
' exclude-kbs-requiring-reboot'.format(k)
|
||||
)
|
||||
|
||||
return d
|
||||
|
||||
|
||||
class AddLinuxParameters(argparse.Action):
|
||||
def __call__(self, parser, namespace, values, option_string=None):
|
||||
action = self.get_action(values, option_string)
|
||||
namespace.linux_parameters = action
|
||||
|
||||
def get_action(self, values, option_string):
|
||||
try:
|
||||
properties = defaultdict(list)
|
||||
for (k, v) in (x.split('=', 1) for x in values):
|
||||
properties[k].append(v)
|
||||
properties = dict(properties)
|
||||
except ValueError:
|
||||
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
|
||||
d = {}
|
||||
for k in properties:
|
||||
kl = k.lower()
|
||||
v = properties[k]
|
||||
|
||||
if kl == 'package-name-masks-to-exclude':
|
||||
d['package_name_masks_to_exclude'] = v
|
||||
|
||||
elif kl == 'package-name-masks-to-include':
|
||||
d['package_name_masks_to_include'] = v
|
||||
|
||||
elif kl == 'classifications-to-include':
|
||||
d['classifications_to_include'] = v
|
||||
|
||||
else:
|
||||
raise CLIError(
|
||||
'Unsupported Key {} is provided for parameter linux-parameters. All possible keys are:'
|
||||
' package-name-masks-to-exclude, package-name-masks-to-include, classifications-to-include'.format(
|
||||
k
|
||||
)
|
||||
)
|
||||
|
||||
return d
|
||||
|
|
|
@ -9,84 +9,96 @@
|
|||
# --------------------------------------------------------------------------
|
||||
# pylint: disable=too-many-statements
|
||||
# pylint: disable=too-many-locals
|
||||
# pylint: disable=bad-continuation
|
||||
# pylint: disable=line-too-long
|
||||
|
||||
from azure.cli.core.commands import CliCommandType
|
||||
from azext_maintenance.generated._client_factory import (
|
||||
cf_public_maintenance_configuration,
|
||||
cf_apply_update,
|
||||
cf_configuration_assignment,
|
||||
cf_maintenance_configuration,
|
||||
cf_update,
|
||||
)
|
||||
|
||||
|
||||
maintenance_apply_update = CliCommandType(
|
||||
operations_tmpl=(
|
||||
'azext_maintenance.vendored_sdks.maintenance.operations._apply_updates_operations#ApplyUpdatesOperations.{}'
|
||||
),
|
||||
client_factory=cf_apply_update,
|
||||
)
|
||||
|
||||
|
||||
maintenance_configuration_assignment = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._configuration_assignments_operations#ConfigurationAssignmentsOperations.{}',
|
||||
client_factory=cf_configuration_assignment,
|
||||
)
|
||||
|
||||
|
||||
maintenance_maintenance_configuration = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._maintenance_configurations_operations#MaintenanceConfigurationsOperations.{}',
|
||||
client_factory=cf_maintenance_configuration,
|
||||
)
|
||||
|
||||
|
||||
maintenance_public_maintenance_configuration = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._public_maintenance_configurations_operations#PublicMaintenanceConfigurationsOperations.{}',
|
||||
client_factory=cf_public_maintenance_configuration,
|
||||
)
|
||||
|
||||
|
||||
maintenance_update = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._updates_operations#UpdatesOperations.{}',
|
||||
client_factory=cf_update,
|
||||
)
|
||||
|
||||
|
||||
def load_command_table(self, _):
|
||||
|
||||
from azext_maintenance.generated._client_factory import cf_public_maintenance_configuration
|
||||
maintenance_public_maintenance_configuration = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._public_maintenance_configurations_oper'
|
||||
'ations#PublicMaintenanceConfigurationsOperations.{}',
|
||||
client_factory=cf_public_maintenance_configuration)
|
||||
with self.command_group('maintenance public-configuration', maintenance_public_maintenance_configuration,
|
||||
client_factory=cf_public_maintenance_configuration) as g:
|
||||
g.custom_command('list', 'maintenance_public_configuration_list')
|
||||
g.custom_show_command('show', 'maintenance_public_configuration_show')
|
||||
|
||||
from azext_maintenance.generated._client_factory import cf_apply_update
|
||||
maintenance_apply_update = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._apply_updates_operations#ApplyUpdatesO'
|
||||
'perations.{}',
|
||||
client_factory=cf_apply_update)
|
||||
with self.command_group('maintenance applyupdate', maintenance_apply_update, client_factory=cf_apply_update) as g:
|
||||
g.custom_command('list', 'maintenance_applyupdate_list')
|
||||
g.custom_show_command('show', 'maintenance_applyupdate_show')
|
||||
g.custom_command('create', 'maintenance_applyupdate_create')
|
||||
g.custom_command('update', 'maintenance_applyupdate_update')
|
||||
g.custom_command('create-or-update-parent', 'maintenance_applyupdate_create_or_update_parent')
|
||||
g.custom_command('show-parent', 'maintenance_applyupdate_show_parent')
|
||||
|
||||
from azext_maintenance.generated._client_factory import cf_configuration_assignment
|
||||
maintenance_configuration_assignment = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._configuration_assignments_operations#C'
|
||||
'onfigurationAssignmentsOperations.{}',
|
||||
client_factory=cf_configuration_assignment)
|
||||
with self.command_group('maintenance assignment', maintenance_configuration_assignment,
|
||||
client_factory=cf_configuration_assignment) as g:
|
||||
with self.command_group(
|
||||
'maintenance assignment', maintenance_configuration_assignment, client_factory=cf_configuration_assignment
|
||||
) as g:
|
||||
g.custom_command('list', 'maintenance_assignment_list')
|
||||
g.custom_show_command('show', 'maintenance_assignment_show')
|
||||
g.custom_command('create', 'maintenance_assignment_create')
|
||||
g.custom_command('update', 'maintenance_assignment_update')
|
||||
g.generic_update_command(
|
||||
'update', custom_func_name='maintenance_assignment_update', setter_arg_name='configuration_assignment'
|
||||
)
|
||||
g.custom_command('delete', 'maintenance_assignment_delete', confirmation=True)
|
||||
g.custom_command('create-or-update-parent', 'maintenance_assignment_create_or_update_parent')
|
||||
g.custom_command('delete-parent', 'maintenance_assignment_delete_parent')
|
||||
g.custom_command('list-parent', 'maintenance_assignment_list_parent')
|
||||
g.custom_command('show-parent', 'maintenance_assignment_show_parent')
|
||||
|
||||
from azext_maintenance.generated._client_factory import cf_maintenance_configuration
|
||||
maintenance_maintenance_configuration = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._maintenance_configurations_operations#'
|
||||
'MaintenanceConfigurationsOperations.{}',
|
||||
client_factory=cf_maintenance_configuration)
|
||||
with self.command_group('maintenance configuration', maintenance_maintenance_configuration,
|
||||
client_factory=cf_maintenance_configuration) as g:
|
||||
with self.command_group(
|
||||
'maintenance configuration', maintenance_maintenance_configuration, client_factory=cf_maintenance_configuration
|
||||
) as g:
|
||||
g.custom_command('list', 'maintenance_configuration_list')
|
||||
g.custom_show_command('show', 'maintenance_configuration_show')
|
||||
g.custom_command('create', 'maintenance_configuration_create')
|
||||
g.custom_command('update', 'maintenance_configuration_update')
|
||||
g.custom_command('delete', 'maintenance_configuration_delete', confirmation=True)
|
||||
|
||||
from azext_maintenance.generated._client_factory import cf_maintenance_configuration_for_resource_group
|
||||
maintenance_maintenance_configuration_for_resource_group = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._maintenance_configurations_for_resourc'
|
||||
'e_group_operations#MaintenanceConfigurationsForResourceGroupOperations.{}',
|
||||
client_factory=cf_maintenance_configuration_for_resource_group)
|
||||
with self.command_group('maintenance configuration-for-resource-group',
|
||||
maintenance_maintenance_configuration_for_resource_group,
|
||||
client_factory=cf_maintenance_configuration_for_resource_group) as g:
|
||||
g.custom_command('list', 'maintenance_configuration_for_resource_group_list')
|
||||
with self.command_group(
|
||||
'maintenance public-configuration',
|
||||
maintenance_public_maintenance_configuration,
|
||||
client_factory=cf_public_maintenance_configuration,
|
||||
) as g:
|
||||
g.custom_command('list', 'maintenance_public_configuration_list')
|
||||
g.custom_show_command('show', 'maintenance_public_configuration_show')
|
||||
|
||||
from azext_maintenance.generated._client_factory import cf_apply_update_for_resource_group
|
||||
maintenance_apply_update_for_resource_group = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._apply_update_for_resource_group_operat'
|
||||
'ions#ApplyUpdateForResourceGroupOperations.{}',
|
||||
client_factory=cf_apply_update_for_resource_group)
|
||||
with self.command_group('maintenance applyupdate-for-resource-group', maintenance_apply_update_for_resource_group,
|
||||
client_factory=cf_apply_update_for_resource_group) as g:
|
||||
g.custom_command('list', 'maintenance_applyupdate_for_resource_group_list')
|
||||
|
||||
from azext_maintenance.generated._client_factory import cf_update
|
||||
maintenance_update = CliCommandType(
|
||||
operations_tmpl='azext_maintenance.vendored_sdks.maintenance.operations._updates_operations#UpdatesOperations.{'
|
||||
'}',
|
||||
client_factory=cf_update)
|
||||
with self.command_group('maintenance update', maintenance_update, client_factory=cf_update) as g:
|
||||
g.custom_command('list', 'maintenance_update_list')
|
||||
g.custom_command('list-parent', 'maintenance_update_list_parent')
|
||||
|
||||
with self.command_group('maintenance', is_experimental=True):
|
||||
pass
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
# pylint: disable=line-too-long
|
||||
# pylint: disable=too-many-lines
|
||||
# pylint: disable=unused-argument
|
||||
|
||||
|
||||
def maintenance_public_configuration_list(client):
|
||||
|
@ -41,16 +41,7 @@ def maintenance_applyupdate_create(client,
|
|||
resource_group_name,
|
||||
provider_name,
|
||||
resource_type,
|
||||
resource_name,
|
||||
resource_parent_type=None,
|
||||
resource_parent_name=None):
|
||||
if resource_group_name and provider_name is not None and resource_parent_type is not None and resource_parent_name is not None and resource_type is not None and resource_name is not None:
|
||||
return client.create_or_update_parent(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_parent_type=resource_parent_type,
|
||||
resource_parent_name=resource_parent_name,
|
||||
resource_type=resource_type,
|
||||
resource_name=resource_name)
|
||||
resource_name):
|
||||
return client.create_or_update(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_type=resource_type,
|
||||
|
@ -68,6 +59,21 @@ def maintenance_applyupdate_update(client,
|
|||
resource_name=resource_name)
|
||||
|
||||
|
||||
def maintenance_applyupdate_create_or_update_parent(client,
|
||||
resource_group_name,
|
||||
provider_name,
|
||||
resource_parent_type,
|
||||
resource_parent_name,
|
||||
resource_type,
|
||||
resource_name):
|
||||
return client.create_or_update_parent(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_parent_type=resource_parent_type,
|
||||
resource_parent_name=resource_parent_name,
|
||||
resource_type=resource_type,
|
||||
resource_name=resource_name)
|
||||
|
||||
|
||||
def maintenance_applyupdate_show_parent(client,
|
||||
resource_group_name,
|
||||
resource_parent_type,
|
||||
|
@ -96,34 +102,35 @@ def maintenance_assignment_list(client,
|
|||
resource_name=resource_name)
|
||||
|
||||
|
||||
def maintenance_assignment_show(client,
|
||||
resource_group_name,
|
||||
provider_name,
|
||||
resource_type,
|
||||
resource_name,
|
||||
configuration_assignment_name):
|
||||
return client.get(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_type=resource_type,
|
||||
resource_name=resource_name,
|
||||
configuration_assignment_name=configuration_assignment_name)
|
||||
|
||||
|
||||
def maintenance_assignment_create(client,
|
||||
resource_group_name,
|
||||
provider_name,
|
||||
resource_type,
|
||||
resource_name,
|
||||
configuration_assignment_name,
|
||||
resource_parent_type=None,
|
||||
resource_parent_name=None,
|
||||
location=None,
|
||||
maintenance_configuration_id=None,
|
||||
resource_id=None):
|
||||
configuration_assignment = {}
|
||||
configuration_assignment['location'] = location
|
||||
configuration_assignment['maintenance_configuration_id'] = maintenance_configuration_id
|
||||
configuration_assignment['resource_id'] = resource_id
|
||||
configuration_assignment = {}
|
||||
configuration_assignment['location'] = location
|
||||
configuration_assignment['maintenance_configuration_id'] = maintenance_configuration_id
|
||||
configuration_assignment['resource_id'] = resource_id
|
||||
if resource_group_name and provider_name is not None and resource_parent_type is not None and resource_parent_name is not None and resource_type is not None and resource_name is not None and configuration_assignment_name is not None:
|
||||
return client.create_or_update_parent(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_parent_type=resource_parent_type,
|
||||
resource_parent_name=resource_parent_name,
|
||||
resource_type=resource_type,
|
||||
resource_name=resource_name,
|
||||
configuration_assignment_name=configuration_assignment_name,
|
||||
configuration_assignment=configuration_assignment)
|
||||
if location is not None:
|
||||
configuration_assignment['location'] = location
|
||||
if maintenance_configuration_id is not None:
|
||||
configuration_assignment['maintenance_configuration_id'] = maintenance_configuration_id
|
||||
if resource_id is not None:
|
||||
configuration_assignment['resource_id'] = resource_id
|
||||
return client.create_or_update(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_type=resource_type,
|
||||
|
@ -132,7 +139,7 @@ def maintenance_assignment_create(client,
|
|||
configuration_assignment=configuration_assignment)
|
||||
|
||||
|
||||
def maintenance_assignment_update(client,
|
||||
def maintenance_assignment_update(instance,
|
||||
resource_group_name,
|
||||
provider_name,
|
||||
resource_type,
|
||||
|
@ -141,16 +148,13 @@ def maintenance_assignment_update(client,
|
|||
location=None,
|
||||
maintenance_configuration_id=None,
|
||||
resource_id=None):
|
||||
configuration_assignment = {}
|
||||
configuration_assignment['location'] = location
|
||||
configuration_assignment['maintenance_configuration_id'] = maintenance_configuration_id
|
||||
configuration_assignment['resource_id'] = resource_id
|
||||
return client.create_or_update(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_type=resource_type,
|
||||
resource_name=resource_name,
|
||||
configuration_assignment_name=configuration_assignment_name,
|
||||
configuration_assignment=configuration_assignment)
|
||||
if location is not None:
|
||||
instance.location = location
|
||||
if maintenance_configuration_id is not None:
|
||||
instance.maintenance_configuration_id = maintenance_configuration_id
|
||||
if resource_id is not None:
|
||||
instance.resource_id = resource_id
|
||||
return instance
|
||||
|
||||
|
||||
def maintenance_assignment_delete(client,
|
||||
|
@ -158,17 +162,7 @@ def maintenance_assignment_delete(client,
|
|||
provider_name,
|
||||
resource_type,
|
||||
resource_name,
|
||||
configuration_assignment_name,
|
||||
resource_parent_type=None,
|
||||
resource_parent_name=None):
|
||||
if resource_group_name and provider_name is not None and resource_parent_type is not None and resource_parent_name is not None and resource_type is not None and resource_name is not None and configuration_assignment_name is not None:
|
||||
return client.delete_parent(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_parent_type=resource_parent_type,
|
||||
resource_parent_name=resource_parent_name,
|
||||
resource_type=resource_type,
|
||||
resource_name=resource_name,
|
||||
configuration_assignment_name=configuration_assignment_name)
|
||||
configuration_assignment_name):
|
||||
return client.delete(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_type=resource_type,
|
||||
|
@ -176,6 +170,51 @@ def maintenance_assignment_delete(client,
|
|||
configuration_assignment_name=configuration_assignment_name)
|
||||
|
||||
|
||||
def maintenance_assignment_create_or_update_parent(client,
|
||||
resource_group_name,
|
||||
provider_name,
|
||||
resource_parent_type,
|
||||
resource_parent_name,
|
||||
resource_type,
|
||||
resource_name,
|
||||
configuration_assignment_name,
|
||||
location=None,
|
||||
maintenance_configuration_id=None,
|
||||
resource_id=None):
|
||||
configuration_assignment = {}
|
||||
if location is not None:
|
||||
configuration_assignment['location'] = location
|
||||
if maintenance_configuration_id is not None:
|
||||
configuration_assignment['maintenance_configuration_id'] = maintenance_configuration_id
|
||||
if resource_id is not None:
|
||||
configuration_assignment['resource_id'] = resource_id
|
||||
return client.create_or_update_parent(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_parent_type=resource_parent_type,
|
||||
resource_parent_name=resource_parent_name,
|
||||
resource_type=resource_type,
|
||||
resource_name=resource_name,
|
||||
configuration_assignment_name=configuration_assignment_name,
|
||||
configuration_assignment=configuration_assignment)
|
||||
|
||||
|
||||
def maintenance_assignment_delete_parent(client,
|
||||
resource_group_name,
|
||||
provider_name,
|
||||
resource_parent_type,
|
||||
resource_parent_name,
|
||||
resource_type,
|
||||
resource_name,
|
||||
configuration_assignment_name):
|
||||
return client.delete_parent(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_parent_type=resource_parent_type,
|
||||
resource_parent_name=resource_parent_name,
|
||||
resource_type=resource_type,
|
||||
resource_name=resource_name,
|
||||
configuration_assignment_name=configuration_assignment_name)
|
||||
|
||||
|
||||
def maintenance_assignment_list_parent(client,
|
||||
resource_group_name,
|
||||
provider_name,
|
||||
|
@ -191,6 +230,23 @@ def maintenance_assignment_list_parent(client,
|
|||
resource_name=resource_name)
|
||||
|
||||
|
||||
def maintenance_assignment_show_parent(client,
|
||||
resource_group_name,
|
||||
provider_name,
|
||||
resource_parent_type,
|
||||
resource_parent_name,
|
||||
resource_type,
|
||||
resource_name,
|
||||
configuration_assignment_name):
|
||||
return client.get_parent(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_parent_type=resource_parent_type,
|
||||
resource_parent_name=resource_parent_name,
|
||||
resource_type=resource_type,
|
||||
resource_name=resource_name,
|
||||
configuration_assignment_name=configuration_assignment_name)
|
||||
|
||||
|
||||
def maintenance_configuration_list(client):
|
||||
return client.list()
|
||||
|
||||
|
@ -215,19 +271,50 @@ def maintenance_configuration_create(client,
|
|||
expiration_date_time=None,
|
||||
duration=None,
|
||||
time_zone=None,
|
||||
recur_every=None):
|
||||
recur_every=None,
|
||||
reboot_setting=None,
|
||||
windows_parameters=None,
|
||||
linux_parameters=None,
|
||||
pre_tasks=None,
|
||||
post_tasks=None):
|
||||
configuration = {}
|
||||
configuration['location'] = location
|
||||
configuration['tags'] = tags
|
||||
configuration['namespace'] = namespace
|
||||
configuration['extension_properties'] = extension_properties
|
||||
configuration['maintenance_scope'] = maintenance_scope
|
||||
configuration['visibility'] = visibility
|
||||
configuration['start_date_time'] = start_date_time
|
||||
configuration['expiration_date_time'] = expiration_date_time
|
||||
configuration['duration'] = duration
|
||||
configuration['time_zone'] = time_zone
|
||||
configuration['recur_every'] = recur_every
|
||||
if location is not None:
|
||||
configuration['location'] = location
|
||||
if tags is not None:
|
||||
configuration['tags'] = tags
|
||||
if namespace is not None:
|
||||
configuration['namespace'] = namespace
|
||||
if extension_properties is not None:
|
||||
configuration['extension_properties'] = extension_properties
|
||||
if maintenance_scope is not None:
|
||||
configuration['maintenance_scope'] = maintenance_scope
|
||||
if visibility is not None:
|
||||
configuration['visibility'] = visibility
|
||||
if start_date_time is not None:
|
||||
configuration['start_date_time'] = start_date_time
|
||||
if expiration_date_time is not None:
|
||||
configuration['expiration_date_time'] = expiration_date_time
|
||||
if duration is not None:
|
||||
configuration['duration'] = duration
|
||||
if time_zone is not None:
|
||||
configuration['time_zone'] = time_zone
|
||||
if recur_every is not None:
|
||||
configuration['recur_every'] = recur_every
|
||||
configuration['install_patches'] = {}
|
||||
if reboot_setting is not None:
|
||||
configuration['install_patches']['reboot_setting'] = reboot_setting
|
||||
else:
|
||||
configuration['install_patches']['reboot_setting'] = "IfRequired"
|
||||
if windows_parameters is not None:
|
||||
configuration['install_patches']['windows_parameters'] = windows_parameters
|
||||
if linux_parameters is not None:
|
||||
configuration['install_patches']['linux_parameters'] = linux_parameters
|
||||
if pre_tasks is not None:
|
||||
configuration['install_patches']['pre_tasks'] = pre_tasks
|
||||
if post_tasks is not None:
|
||||
configuration['install_patches']['post_tasks'] = post_tasks
|
||||
if len(configuration['install_patches']) == 0:
|
||||
del configuration['install_patches']
|
||||
return client.create_or_update(resource_group_name=resource_group_name,
|
||||
resource_name=resource_name,
|
||||
configuration=configuration)
|
||||
|
@ -246,19 +333,50 @@ def maintenance_configuration_update(client,
|
|||
expiration_date_time=None,
|
||||
duration=None,
|
||||
time_zone=None,
|
||||
recur_every=None):
|
||||
recur_every=None,
|
||||
reboot_setting=None,
|
||||
windows_parameters=None,
|
||||
linux_parameters=None,
|
||||
pre_tasks=None,
|
||||
post_tasks=None):
|
||||
configuration = {}
|
||||
configuration['location'] = location
|
||||
configuration['tags'] = tags
|
||||
configuration['namespace'] = namespace
|
||||
configuration['extension_properties'] = extension_properties
|
||||
configuration['maintenance_scope'] = maintenance_scope
|
||||
configuration['visibility'] = visibility
|
||||
configuration['start_date_time'] = start_date_time
|
||||
configuration['expiration_date_time'] = expiration_date_time
|
||||
configuration['duration'] = duration
|
||||
configuration['time_zone'] = time_zone
|
||||
configuration['recur_every'] = recur_every
|
||||
if location is not None:
|
||||
configuration['location'] = location
|
||||
if tags is not None:
|
||||
configuration['tags'] = tags
|
||||
if namespace is not None:
|
||||
configuration['namespace'] = namespace
|
||||
if extension_properties is not None:
|
||||
configuration['extension_properties'] = extension_properties
|
||||
if maintenance_scope is not None:
|
||||
configuration['maintenance_scope'] = maintenance_scope
|
||||
if visibility is not None:
|
||||
configuration['visibility'] = visibility
|
||||
if start_date_time is not None:
|
||||
configuration['start_date_time'] = start_date_time
|
||||
if expiration_date_time is not None:
|
||||
configuration['expiration_date_time'] = expiration_date_time
|
||||
if duration is not None:
|
||||
configuration['duration'] = duration
|
||||
if time_zone is not None:
|
||||
configuration['time_zone'] = time_zone
|
||||
if recur_every is not None:
|
||||
configuration['recur_every'] = recur_every
|
||||
configuration['install_patches'] = {}
|
||||
if reboot_setting is not None:
|
||||
configuration['install_patches']['reboot_setting'] = reboot_setting
|
||||
else:
|
||||
configuration['install_patches']['reboot_setting'] = "IfRequired"
|
||||
if windows_parameters is not None:
|
||||
configuration['install_patches']['windows_parameters'] = windows_parameters
|
||||
if linux_parameters is not None:
|
||||
configuration['install_patches']['linux_parameters'] = linux_parameters
|
||||
if pre_tasks is not None:
|
||||
configuration['install_patches']['pre_tasks'] = pre_tasks
|
||||
if post_tasks is not None:
|
||||
configuration['install_patches']['post_tasks'] = post_tasks
|
||||
if len(configuration['install_patches']) == 0:
|
||||
del configuration['install_patches']
|
||||
return client.update(resource_group_name=resource_group_name,
|
||||
resource_name=resource_name,
|
||||
configuration=configuration)
|
||||
|
@ -271,16 +389,6 @@ def maintenance_configuration_delete(client,
|
|||
resource_name=resource_name)
|
||||
|
||||
|
||||
def maintenance_configuration_for_resource_group_list(client,
|
||||
resource_group_name):
|
||||
return client.list(resource_group_name=resource_group_name)
|
||||
|
||||
|
||||
def maintenance_applyupdate_for_resource_group_list(client,
|
||||
resource_group_name):
|
||||
return client.list(resource_group_name=resource_group_name)
|
||||
|
||||
|
||||
def maintenance_update_list(client,
|
||||
resource_group_name,
|
||||
provider_name,
|
||||
|
|
|
@ -0,0 +1,155 @@
|
|||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for
|
||||
# license information.
|
||||
#
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
# pylint: disable=too-many-lines
|
||||
# pylint: disable=unused-argument
|
||||
|
||||
|
||||
def maintenance_configuration_create(client,
|
||||
resource_group_name,
|
||||
resource_name,
|
||||
location=None,
|
||||
tags=None,
|
||||
namespace=None,
|
||||
extension_properties=None,
|
||||
maintenance_scope=None,
|
||||
visibility=None,
|
||||
start_date_time=None,
|
||||
expiration_date_time=None,
|
||||
duration=None,
|
||||
time_zone=None,
|
||||
recur_every=None,
|
||||
reboot_setting=None,
|
||||
windows_parameters=None,
|
||||
linux_parameters=None,
|
||||
pre_tasks=None,
|
||||
post_tasks=None):
|
||||
configuration = {}
|
||||
if location is not None:
|
||||
configuration['location'] = location
|
||||
if tags is not None:
|
||||
configuration['tags'] = tags
|
||||
if namespace is not None:
|
||||
configuration['namespace'] = namespace
|
||||
if extension_properties is not None:
|
||||
configuration['extension_properties'] = extension_properties
|
||||
if maintenance_scope is not None:
|
||||
configuration['maintenance_scope'] = maintenance_scope
|
||||
if visibility is not None:
|
||||
configuration['visibility'] = visibility
|
||||
if start_date_time is not None:
|
||||
configuration['start_date_time'] = start_date_time
|
||||
if expiration_date_time is not None:
|
||||
configuration['expiration_date_time'] = expiration_date_time
|
||||
if duration is not None:
|
||||
configuration['duration'] = duration
|
||||
if time_zone is not None:
|
||||
configuration['time_zone'] = time_zone
|
||||
if recur_every is not None:
|
||||
configuration['recur_every'] = recur_every
|
||||
configuration['install_patches'] = {}
|
||||
if reboot_setting is not None:
|
||||
configuration['install_patches']['reboot_setting'] = reboot_setting
|
||||
if windows_parameters is not None:
|
||||
configuration['install_patches']['windows_parameters'] = windows_parameters
|
||||
if linux_parameters is not None:
|
||||
configuration['install_patches']['linux_parameters'] = linux_parameters
|
||||
if pre_tasks is not None:
|
||||
configuration['install_patches']['pre_tasks'] = pre_tasks
|
||||
if post_tasks is not None:
|
||||
configuration['install_patches']['post_tasks'] = post_tasks
|
||||
if len(configuration['install_patches']) == 0:
|
||||
del configuration['install_patches']
|
||||
return client.create_or_update(resource_group_name=resource_group_name,
|
||||
resource_name=resource_name,
|
||||
configuration=configuration)
|
||||
|
||||
|
||||
def maintenance_configuration_update(client,
|
||||
resource_group_name,
|
||||
resource_name,
|
||||
location=None,
|
||||
tags=None,
|
||||
namespace=None,
|
||||
extension_properties=None,
|
||||
maintenance_scope=None,
|
||||
visibility=None,
|
||||
start_date_time=None,
|
||||
expiration_date_time=None,
|
||||
duration=None,
|
||||
time_zone=None,
|
||||
recur_every=None,
|
||||
reboot_setting=None,
|
||||
windows_parameters=None,
|
||||
linux_parameters=None,
|
||||
pre_tasks=None,
|
||||
post_tasks=None):
|
||||
configuration = {}
|
||||
if location is not None:
|
||||
configuration['location'] = location
|
||||
if tags is not None:
|
||||
configuration['tags'] = tags
|
||||
if namespace is not None:
|
||||
configuration['namespace'] = namespace
|
||||
if extension_properties is not None:
|
||||
configuration['extension_properties'] = extension_properties
|
||||
if maintenance_scope is not None:
|
||||
configuration['maintenance_scope'] = maintenance_scope
|
||||
if visibility is not None:
|
||||
configuration['visibility'] = visibility
|
||||
if start_date_time is not None:
|
||||
configuration['start_date_time'] = start_date_time
|
||||
if expiration_date_time is not None:
|
||||
configuration['expiration_date_time'] = expiration_date_time
|
||||
if duration is not None:
|
||||
configuration['duration'] = duration
|
||||
if time_zone is not None:
|
||||
configuration['time_zone'] = time_zone
|
||||
if recur_every is not None:
|
||||
configuration['recur_every'] = recur_every
|
||||
configuration['install_patches'] = {}
|
||||
if reboot_setting is not None:
|
||||
configuration['install_patches']['reboot_setting'] = reboot_setting
|
||||
if windows_parameters is not None:
|
||||
configuration['install_patches']['windows_parameters'] = windows_parameters
|
||||
if linux_parameters is not None:
|
||||
configuration['install_patches']['linux_parameters'] = linux_parameters
|
||||
if pre_tasks is not None:
|
||||
configuration['install_patches']['pre_tasks'] = pre_tasks
|
||||
if post_tasks is not None:
|
||||
configuration['install_patches']['post_tasks'] = post_tasks
|
||||
if len(configuration['install_patches']) == 0:
|
||||
del configuration['install_patches']
|
||||
return client.update(resource_group_name=resource_group_name,
|
||||
resource_name=resource_name,
|
||||
configuration=configuration)
|
||||
|
||||
|
||||
def maintenance_assignment_update(client,
|
||||
resource_group_name,
|
||||
provider_name,
|
||||
resource_type,
|
||||
resource_name,
|
||||
configuration_assignment_name,
|
||||
location=None,
|
||||
maintenance_configuration_id=None,
|
||||
resource_id=None):
|
||||
configuration_assignment = {}
|
||||
if location is not None:
|
||||
configuration_assignment['location'] = location
|
||||
if maintenance_configuration_id is not None:
|
||||
configuration_assignment['maintenance_configuration_id'] = maintenance_configuration_id
|
||||
if resource_id is not None:
|
||||
configuration_assignment['resource_id'] = resource_id
|
||||
return client.create_or_update(resource_group_name=resource_group_name,
|
||||
provider_name=provider_name,
|
||||
resource_type=resource_type,
|
||||
resource_name=resource_name,
|
||||
configuration_assignment_name=configuration_assignment_name,
|
||||
configuration_assignment=configuration_assignment)
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -13,7 +13,7 @@ from azure.cli.testsdk import ScenarioTest
|
|||
from azure.cli.testsdk import ResourceGroupPreparer
|
||||
|
||||
|
||||
def setup(test, rg):
|
||||
def setup(test):
|
||||
test.cmd('az vmss create -n "clitestvmss" -g "{rg}" --instance-count 1 --image "Win2016Datacenter" --data-disk-sizes-gb 2 --admin-password "PasswordCLIMaintenanceRP8!" --upgrade-policy-mode Automatic ', checks=[])
|
||||
|
||||
# Disable AutomaticUpdates for VM
|
||||
|
@ -28,7 +28,7 @@ def setup(test, rg):
|
|||
pass
|
||||
|
||||
|
||||
def step__applyupdates_put_applyupdates_createorupdate(test, rg):
|
||||
def step__applyupdates_put_applyupdates_createorupdate(test):
|
||||
test.cmd('az maintenance applyupdate create '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
'--resource-group "{rg}" '
|
||||
|
@ -37,7 +37,7 @@ def step__applyupdates_put_applyupdates_createorupdate(test, rg):
|
|||
checks=[])
|
||||
|
||||
|
||||
def step__applyupdates_get_applyupdates_get(test, rg):
|
||||
def step__applyupdates_get_applyupdates_get(test):
|
||||
test.cmd('az maintenance applyupdate show '
|
||||
'--name "default" '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
|
@ -47,9 +47,9 @@ def step__applyupdates_get_applyupdates_get(test, rg):
|
|||
checks=[])
|
||||
|
||||
|
||||
def step__maintenanceconfigurations_put_maintenanceconfigurations_createorupdateforresource(test, rg):
|
||||
def step__maintenanceconfigurations_put_maintenanceconfigurations_createorupdateforresource(test):
|
||||
test.cmd('az maintenance configuration create '
|
||||
'--location "westus2" '
|
||||
'--location "eastus2euap" '
|
||||
'--maintenance-scope "OSImage" '
|
||||
'--maintenance-window-duration "05:00" '
|
||||
'--maintenance-window-expiration-date-time "9999-12-31 00:00" '
|
||||
|
@ -63,21 +63,21 @@ def step__maintenanceconfigurations_put_maintenanceconfigurations_createorupdate
|
|||
checks=[])
|
||||
|
||||
|
||||
def step__maintenanceconfigurations_get_maintenanceconfigurations_getforresource(test, rg):
|
||||
def step__maintenanceconfigurations_get_maintenanceconfigurations_getforresource(test):
|
||||
test.cmd('az maintenance configuration show '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "configuration1"',
|
||||
checks=[])
|
||||
|
||||
|
||||
def step__maintenanceconfigurations_get_maintenanceconfigurations_list(test, rg):
|
||||
def step__maintenanceconfigurations_get_maintenanceconfigurations_list(test):
|
||||
test.cmd('az maintenance configuration list',
|
||||
checks=[])
|
||||
|
||||
|
||||
def step__maintenanceconfigurations_patch_maintenanceconfigurations_updateforresource(test, rg):
|
||||
def step__maintenanceconfigurations_patch_maintenanceconfigurations_updateforresource(test):
|
||||
test.cmd('az maintenance configuration update '
|
||||
'--location "westus2" '
|
||||
'--location "eastus2euap" '
|
||||
'--maintenance-scope "OSImage" '
|
||||
'--maintenance-window-duration "05:00" '
|
||||
'--maintenance-window-expiration-date-time "9999-12-31 00:00" '
|
||||
|
@ -91,7 +91,7 @@ def step__maintenanceconfigurations_patch_maintenanceconfigurations_updateforres
|
|||
checks=[])
|
||||
|
||||
|
||||
def step__configurationassignments_put_configurationassignments_createorupdate(test, rg):
|
||||
def step__configurationassignments_put_configurationassignments_createorupdate(test):
|
||||
test.cmd('az maintenance assignment create '
|
||||
'--maintenance-configuration-id "/subscriptions/{subscription_id}/resourcegroups/{rg}/providers/Microsoft.'
|
||||
'Maintenance/maintenanceConfigurations/{MaintenanceConfigurations_2}" '
|
||||
|
@ -103,7 +103,7 @@ def step__configurationassignments_put_configurationassignments_createorupdate(t
|
|||
checks=[])
|
||||
|
||||
|
||||
def step__configurationassignments_get_configurationassignments_list(test, rg):
|
||||
def step__configurationassignments_get_configurationassignments_list(test):
|
||||
test.cmd('az maintenance assignment list '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
'--resource-group "{rg}" '
|
||||
|
@ -112,18 +112,18 @@ def step__configurationassignments_get_configurationassignments_list(test, rg):
|
|||
checks=[])
|
||||
|
||||
|
||||
def step__publicmaintenanceconfigurations_get_publicmaintenanceconfigurations_getforresource(test, rg):
|
||||
def step__publicmaintenanceconfigurations_get_publicmaintenanceconfigurations_getforresource(test):
|
||||
test.cmd('az maintenance public-configuration show '
|
||||
'--resource-name "sql2"',
|
||||
checks=[])
|
||||
|
||||
|
||||
def step__publicmaintenanceconfigurations_get_publicmaintenanceconfigurations_list(test, rg):
|
||||
def step__publicmaintenanceconfigurations_get_publicmaintenanceconfigurations_list(test):
|
||||
test.cmd('az maintenance public-configuration list',
|
||||
checks=[])
|
||||
|
||||
|
||||
def step__updates_get_updates_list(test, rg):
|
||||
def step__updates_get_updates_list(test):
|
||||
test.cmd('az maintenance update list '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
'--resource-group "{rg}" '
|
||||
|
@ -132,7 +132,7 @@ def step__updates_get_updates_list(test, rg):
|
|||
checks=[])
|
||||
|
||||
|
||||
def step__configurationassignments_delete_configurationassignments_delete(test, rg):
|
||||
def step__configurationassignments_delete_configurationassignments_delete(test):
|
||||
test.cmd('az maintenance assignment delete '
|
||||
'--name "{MaintenanceConfigurations_2}" '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
|
@ -143,7 +143,7 @@ def step__configurationassignments_delete_configurationassignments_delete(test,
|
|||
checks=[])
|
||||
|
||||
|
||||
def step__maintenanceconfigurations_delete_maintenanceconfigurations_deleteforresource(test, rg):
|
||||
def step__maintenanceconfigurations_delete_maintenanceconfigurations_deleteforresource(test):
|
||||
test.cmd('az maintenance configuration delete '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "configuration1" '
|
||||
|
@ -151,7 +151,7 @@ def step__maintenanceconfigurations_delete_maintenanceconfigurations_deleteforre
|
|||
checks=[])
|
||||
|
||||
|
||||
def step__maintenanceconfigurations_delete_publicmaintenanceconfigurations_delete(test, rg):
|
||||
def step__maintenanceconfigurations_delete_publicmaintenanceconfigurations_delete(test):
|
||||
test.cmd('az maintenance configuration delete '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "sqlcli" '
|
||||
|
@ -159,7 +159,7 @@ def step__maintenanceconfigurations_delete_publicmaintenanceconfigurations_delet
|
|||
checks=[])
|
||||
|
||||
|
||||
def step__maintenanceconfigurations_put_publicmaintenanceconfigurations_createorupdateforresource(test, rg):
|
||||
def step__maintenanceconfigurations_put_publicmaintenanceconfigurations_createorupdateforresource(test):
|
||||
test.cmd('az maintenance configuration create '
|
||||
'--location "eastus2euap" '
|
||||
'--maintenance-scope "SQLDB" '
|
||||
|
@ -175,27 +175,53 @@ def step__maintenanceconfigurations_put_publicmaintenanceconfigurations_createor
|
|||
'--extension-properties publicMaintenanceConfigurationId=sqlcli isAvailable=true',
|
||||
checks=[])
|
||||
|
||||
def step__maintenanceconfigurations_create_maintenanceconfigurations_inguestpatchdefault(test):
|
||||
test.cmd('az maintenance configuration create --maintenance-scope InGuestPatch '
|
||||
'--maintenance-window-duration "01:00" '
|
||||
'--maintenance-window-expiration-date-time "9999-12-31 00:00" '
|
||||
'--maintenance-window-recur-every "Day" '
|
||||
'--maintenance-window-start-date-time "2022-04-30 08:00" '
|
||||
'--maintenance-window-time-zone "Pacific Standard Time" '
|
||||
'--resource-group {rg} '
|
||||
'--resource-name clitestmrpconfinguestdefault '
|
||||
'--install-patches-linux-parameters package-name-masks-to-exclude=pkg1 '
|
||||
' package-name-masks-to-exclude=pkg2 classifications-to-include=Other '
|
||||
'--reboot-setting IfRequired'
|
||||
, checks=[])
|
||||
|
||||
def cleanup(test, rg):
|
||||
def step__maintenanceconfigurations_create_maintenanceconfigurations_inguestpatchadvanced(test):
|
||||
test.cmd('az maintenance configuration create --maintenance-scope InGuestPatch '
|
||||
'--maintenance-window-duration "01:00" '
|
||||
'--maintenance-window-expiration-date-time "9999-12-31 00:00" '
|
||||
'--maintenance-window-recur-every "Day" '
|
||||
'--maintenance-window-start-date-time "2022-04-30 08:00" '
|
||||
'--maintenance-window-time-zone "Pacific Standard Time" '
|
||||
'--resource-group {rg} '
|
||||
'--resource-name clitestmrpconfinguestadvanced '
|
||||
, checks=[])
|
||||
|
||||
def cleanup(test):
|
||||
test.cmd('az vmss delete -n "clitestvmss" -g "{rg}"', checks=[])
|
||||
pass
|
||||
|
||||
|
||||
def call_scenario(test, rg):
|
||||
setup(test, rg)
|
||||
step__maintenanceconfigurations_put_maintenanceconfigurations_createorupdateforresource(test, rg)
|
||||
step__maintenanceconfigurations_get_maintenanceconfigurations_getforresource(test, rg)
|
||||
step__maintenanceconfigurations_get_maintenanceconfigurations_list(test, rg)
|
||||
step__maintenanceconfigurations_patch_maintenanceconfigurations_updateforresource(test, rg)
|
||||
step__configurationassignments_put_configurationassignments_createorupdate(test, rg)
|
||||
step__configurationassignments_get_configurationassignments_list(test, rg)
|
||||
step__publicmaintenanceconfigurations_get_publicmaintenanceconfigurations_getforresource(test, rg)
|
||||
step__publicmaintenanceconfigurations_get_publicmaintenanceconfigurations_list(test, rg)
|
||||
step__updates_get_updates_list(test, rg)
|
||||
step__applyupdates_put_applyupdates_createorupdate(test, rg)
|
||||
step__applyupdates_get_applyupdates_get(test, rg)
|
||||
step__configurationassignments_delete_configurationassignments_delete(test, rg)
|
||||
step__maintenanceconfigurations_delete_maintenanceconfigurations_deleteforresource(test, rg)
|
||||
step__maintenanceconfigurations_put_publicmaintenanceconfigurations_createorupdateforresource(test, rg)
|
||||
step__maintenanceconfigurations_delete_publicmaintenanceconfigurations_delete(test, rg)
|
||||
cleanup(test, rg)
|
||||
def call_scenario(test):
|
||||
setup(test)
|
||||
step__maintenanceconfigurations_put_maintenanceconfigurations_createorupdateforresource(test)
|
||||
step__maintenanceconfigurations_get_maintenanceconfigurations_getforresource(test)
|
||||
step__maintenanceconfigurations_get_maintenanceconfigurations_list(test)
|
||||
step__maintenanceconfigurations_patch_maintenanceconfigurations_updateforresource(test)
|
||||
step__configurationassignments_put_configurationassignments_createorupdate(test)
|
||||
step__configurationassignments_get_configurationassignments_list(test)
|
||||
step__publicmaintenanceconfigurations_get_publicmaintenanceconfigurations_getforresource(test)
|
||||
step__publicmaintenanceconfigurations_get_publicmaintenanceconfigurations_list(test)
|
||||
step__updates_get_updates_list(test)
|
||||
step__applyupdates_put_applyupdates_createorupdate(test)
|
||||
step__applyupdates_get_applyupdates_get(test)
|
||||
step__configurationassignments_delete_configurationassignments_delete(test)
|
||||
step__maintenanceconfigurations_delete_maintenanceconfigurations_deleteforresource(test)
|
||||
step__maintenanceconfigurations_put_publicmaintenanceconfigurations_createorupdateforresource(test)
|
||||
step__maintenanceconfigurations_delete_publicmaintenanceconfigurations_delete(test)
|
||||
step__maintenanceconfigurations_create_maintenanceconfigurations_inguestpatchdefault(test)
|
||||
step__maintenanceconfigurations_create_maintenanceconfigurations_inguestpatchadvanced(test)
|
||||
cleanup(test)
|
||||
|
|
|
@ -12,19 +12,9 @@
|
|||
from .. import try_manual
|
||||
|
||||
|
||||
# EXAMPLE: /ApplyUpdateForResourceGroup/get/ApplyUpdatesResourceGroup_List
|
||||
@try_manual
|
||||
def step_applyupdate_for_resource_group_list(test, rg, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance applyupdate-for-resource-group list '
|
||||
'--resource-group "{rg}"',
|
||||
checks=checks)
|
||||
|
||||
|
||||
# EXAMPLE: /ApplyUpdates/put/ApplyUpdates_CreateOrUpdate
|
||||
@try_manual
|
||||
def step_applyupdate_create(test, rg, checks=None):
|
||||
def step_applyupdate_create(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance applyupdate create '
|
||||
|
@ -37,10 +27,10 @@ def step_applyupdate_create(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /ApplyUpdates/put/ApplyUpdates_CreateOrUpdateParent
|
||||
@try_manual
|
||||
def step_applyupdate_create2(test, rg, checks=None):
|
||||
def step_applyupdate_create_or_update_parent(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance applyupdate create '
|
||||
test.cmd('az maintenance applyupdate create-or-update-parent '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "smdvm1" '
|
||||
|
@ -52,7 +42,7 @@ def step_applyupdate_create2(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /ApplyUpdates/get/ApplyUpdates_Get
|
||||
@try_manual
|
||||
def step_applyupdate_show(test, rg, checks=None):
|
||||
def step_applyupdate_show(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance applyupdate show '
|
||||
|
@ -66,7 +56,7 @@ def step_applyupdate_show(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /ApplyUpdates/get/ApplyUpdates_GetParent
|
||||
@try_manual
|
||||
def step_applyupdate_show_parent(test, rg, checks=None):
|
||||
def step_applyupdate_show_parent(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance applyupdate show-parent '
|
||||
|
@ -82,7 +72,7 @@ def step_applyupdate_show_parent(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /ApplyUpdates/get/ApplyUpdates_List
|
||||
@try_manual
|
||||
def step_applyupdate_list(test, rg, checks=None):
|
||||
def step_applyupdate_list(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance applyupdate list',
|
||||
|
@ -91,38 +81,50 @@ def step_applyupdate_list(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /MaintenanceConfigurations/put/MaintenanceConfigurations_CreateOrUpdateForResource
|
||||
@try_manual
|
||||
def step_configuration_create(test, rg, checks=None):
|
||||
def step_configuration_create(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance configuration create '
|
||||
'--location "westus2" '
|
||||
'--maintenance-scope "Host" '
|
||||
'--location "eastus2euap" '
|
||||
'--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 "2025-04-30 08:00" '
|
||||
'--maintenance-window-start-date-time "2020-04-30 08:00" '
|
||||
'--maintenance-window-time-zone "Pacific Standard Time" '
|
||||
'--namespace "Microsoft.Maintenance" '
|
||||
'--visibility "Custom" '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "{myMaintenanceConfiguration2}"',
|
||||
'--resource-name "{myMaintenanceConfiguration}"',
|
||||
checks=checks)
|
||||
|
||||
|
||||
# EXAMPLE: /MaintenanceConfigurations/get/MaintenanceConfigurations_GetForResource
|
||||
@try_manual
|
||||
def step_configuration_show(test, rg, checks=None):
|
||||
def step_configuration_show(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance configuration show '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "{myMaintenanceConfiguration2}"',
|
||||
'--resource-name "{myMaintenanceConfiguration}"',
|
||||
checks=checks)
|
||||
|
||||
|
||||
# EXAMPLE: /MaintenanceConfigurations/get/MaintenanceConfigurations_GetForResource_GuestOSPatchLinux
|
||||
@try_manual
|
||||
def step_configuration_show2(test, checks=None):
|
||||
return step_configuration_show(test, checks)
|
||||
|
||||
|
||||
# EXAMPLE: /MaintenanceConfigurations/get/MaintenanceConfigurations_GetForResource_GuestOSPatchWindows
|
||||
@try_manual
|
||||
def step_configuration_show3(test, checks=None):
|
||||
return step_configuration_show(test, checks)
|
||||
|
||||
|
||||
# EXAMPLE: /MaintenanceConfigurations/get/MaintenanceConfigurations_List
|
||||
@try_manual
|
||||
def step_configuration_list(test, rg, checks=None):
|
||||
def step_configuration_list(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance configuration list',
|
||||
|
@ -131,33 +133,33 @@ def step_configuration_list(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /MaintenanceConfigurations/patch/MaintenanceConfigurations_UpdateForResource
|
||||
@try_manual
|
||||
def step_configuration_update(test, rg, checks=None):
|
||||
def step_configuration_update(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance configuration update '
|
||||
'--location "westus2" '
|
||||
'--maintenance-scope "Host" '
|
||||
'--location "eastus2euap" '
|
||||
'--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 "2025-04-30 08:00" '
|
||||
'--maintenance-window-start-date-time "2020-04-30 08:00" '
|
||||
'--maintenance-window-time-zone "Pacific Standard Time" '
|
||||
'--namespace "Microsoft.Maintenance" '
|
||||
'--visibility "Custom" '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "{myMaintenanceConfiguration2}"',
|
||||
'--resource-name "{myMaintenanceConfiguration}"',
|
||||
checks=checks)
|
||||
|
||||
|
||||
# EXAMPLE: /ConfigurationAssignments/put/ConfigurationAssignments_CreateOrUpdate
|
||||
@try_manual
|
||||
def step_assignment_create(test, rg, checks=None):
|
||||
def step_assignment_create(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance assignment create '
|
||||
'--maintenance-configuration-id "/subscriptions/{subscription_id}/resourcegroups/{rg}/providers/Microsoft.'
|
||||
'Maintenance/maintenanceConfigurations/{myMaintenanceConfiguration2}" '
|
||||
'--name "{myConfigurationAssignment2}" '
|
||||
'Maintenance/maintenanceConfigurations/{myMaintenanceConfiguration}" '
|
||||
'--name "{myConfigurationAssignment}" '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "smdtest1" '
|
||||
|
@ -167,15 +169,45 @@ def step_assignment_create(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /ConfigurationAssignments/put/ConfigurationAssignments_CreateOrUpdateParent
|
||||
@try_manual
|
||||
def step_assignment_create2(test, rg, checks=None):
|
||||
def step_assignment_create_or_update_parent(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance assignment create '
|
||||
test.cmd('az maintenance assignment create-or-update-parent '
|
||||
'--maintenance-configuration-id "/subscriptions/{subscription_id}/resourcegroups/{rg}/providers/Microsoft.'
|
||||
'Maintenance/maintenanceConfigurations/{myMaintenanceConfiguration}" '
|
||||
'Maintenance/maintenanceConfigurations/{myMaintenanceConfiguration2}" '
|
||||
'--name "{myConfigurationAssignment2}" '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "smdvm1" '
|
||||
'--resource-parent-name "smdtest1" '
|
||||
'--resource-parent-type "virtualMachineScaleSets" '
|
||||
'--resource-type "virtualMachines"',
|
||||
checks=checks)
|
||||
|
||||
|
||||
# EXAMPLE: /ConfigurationAssignments/get/ConfigurationAssignments_Get
|
||||
@try_manual
|
||||
def step_assignment_show(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance assignment show '
|
||||
'--name "{myConfigurationAssignment}" '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "smdtest1" '
|
||||
'--resource-type "virtualMachineScaleSets"',
|
||||
checks=checks)
|
||||
|
||||
|
||||
# EXAMPLE: /ConfigurationAssignments/get/ConfigurationAssignments_GetParent
|
||||
@try_manual
|
||||
def step_assignment_show_parent(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance assignment show-parent '
|
||||
'--name "{myConfigurationAssignment2}" '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "smdvm1" '
|
||||
'--resource-parent-name "smdtest1" '
|
||||
'--resource-parent-type "virtualMachineScaleSets" '
|
||||
|
@ -185,7 +217,7 @@ def step_assignment_create2(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /ConfigurationAssignments/get/ConfigurationAssignments_List
|
||||
@try_manual
|
||||
def step_assignment_list(test, rg, checks=None):
|
||||
def step_assignment_list(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance assignment list '
|
||||
|
@ -198,7 +230,7 @@ def step_assignment_list(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /ConfigurationAssignments/get/ConfigurationAssignments_ListParent
|
||||
@try_manual
|
||||
def step_assignment_list_parent(test, rg, checks=None):
|
||||
def step_assignment_list_parent(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance assignment list-parent '
|
||||
|
@ -213,11 +245,11 @@ def step_assignment_list_parent(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /ConfigurationAssignments/delete/ConfigurationAssignments_Delete
|
||||
@try_manual
|
||||
def step_assignment_delete(test, rg, checks=None):
|
||||
def step_assignment_delete(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance assignment delete -y '
|
||||
'--name "{myConfigurationAssignment2}" '
|
||||
'--name "{myConfigurationAssignment}" '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "smdtest1" '
|
||||
|
@ -227,11 +259,11 @@ def step_assignment_delete(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /ConfigurationAssignments/delete/ConfigurationAssignments_DeleteParent
|
||||
@try_manual
|
||||
def step_assignment_delete2(test, rg, checks=None):
|
||||
def step_assignment_delete_parent(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance assignment delete -y '
|
||||
'--name "{myConfigurationAssignment2}" '
|
||||
test.cmd('az maintenance assignment delete-parent '
|
||||
'--name "{myConfigurationAssignment}" '
|
||||
'--provider-name "Microsoft.Compute" '
|
||||
'--resource-group "{rg}" '
|
||||
'--resource-name "smdvm1" '
|
||||
|
@ -243,7 +275,7 @@ def step_assignment_delete2(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /MaintenanceConfigurations/delete/MaintenanceConfigurations_DeleteForResource
|
||||
@try_manual
|
||||
def step_configuration_delete(test, rg, checks=None):
|
||||
def step_configuration_delete(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance configuration delete -y '
|
||||
|
@ -252,29 +284,19 @@ def step_configuration_delete(test, rg, checks=None):
|
|||
checks=checks)
|
||||
|
||||
|
||||
# EXAMPLE: /MaintenanceConfigurationsForResourceGroup/get/MaintenanceConfigurationsResourceGroup_List
|
||||
@try_manual
|
||||
def step_configuration_for_resource_group_list(test, rg, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance configuration-for-resource-group list '
|
||||
'--resource-group "{rg}"',
|
||||
checks=checks)
|
||||
|
||||
|
||||
# EXAMPLE: /PublicMaintenanceConfigurations/get/PublicMaintenanceConfigurations_GetForResource
|
||||
@try_manual
|
||||
def step_public_configuration_show(test, rg, checks=None):
|
||||
def step_public_configuration_show(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance public-configuration show '
|
||||
'--resource-name "{myMaintenanceConfiguration2}"',
|
||||
'--resource-name "{myMaintenanceConfiguration}"',
|
||||
checks=checks)
|
||||
|
||||
|
||||
# EXAMPLE: /PublicMaintenanceConfigurations/get/PublicMaintenanceConfigurations_List
|
||||
@try_manual
|
||||
def step_public_configuration_list(test, rg, checks=None):
|
||||
def step_public_configuration_list(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance public-configuration list',
|
||||
|
@ -283,7 +305,7 @@ def step_public_configuration_list(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /Updates/get/Updates_List
|
||||
@try_manual
|
||||
def step_update_list(test, rg, checks=None):
|
||||
def step_update_list(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance update list '
|
||||
|
@ -296,7 +318,7 @@ def step_update_list(test, rg, checks=None):
|
|||
|
||||
# EXAMPLE: /Updates/get/Updates_ListParent
|
||||
@try_manual
|
||||
def step_update_list_parent(test, rg, checks=None):
|
||||
def step_update_list_parent(test, checks=None):
|
||||
if checks is None:
|
||||
checks = []
|
||||
test.cmd('az maintenance update list-parent '
|
||||
|
@ -307,4 +329,3 @@ def step_update_list_parent(test, rg, checks=None):
|
|||
'--resource-parent-type "virtualMachineScaleSets" '
|
||||
'--resource-type "virtualMachines"',
|
||||
checks=checks)
|
||||
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -11,24 +11,26 @@
|
|||
import os
|
||||
from azure.cli.testsdk import ScenarioTest
|
||||
from azure.cli.testsdk import ResourceGroupPreparer
|
||||
from .example_steps import step_applyupdate_for_resource_group_list
|
||||
from .example_steps import step_applyupdate_create
|
||||
from .example_steps import step_applyupdate_create2
|
||||
from .example_steps import step_applyupdate_create_or_update_parent
|
||||
from .example_steps import step_applyupdate_show
|
||||
from .example_steps import step_applyupdate_show_parent
|
||||
from .example_steps import step_applyupdate_list
|
||||
from .example_steps import step_configuration_create
|
||||
from .example_steps import step_configuration_show
|
||||
from .example_steps import step_configuration_show2
|
||||
from .example_steps import step_configuration_show3
|
||||
from .example_steps import step_configuration_list
|
||||
from .example_steps import step_configuration_update
|
||||
from .example_steps import step_assignment_create
|
||||
from .example_steps import step_assignment_create2
|
||||
from .example_steps import step_assignment_create_or_update_parent
|
||||
from .example_steps import step_assignment_show
|
||||
from .example_steps import step_assignment_show_parent
|
||||
from .example_steps import step_assignment_list
|
||||
from .example_steps import step_assignment_list_parent
|
||||
from .example_steps import step_assignment_delete
|
||||
from .example_steps import step_assignment_delete2
|
||||
from .example_steps import step_assignment_delete_parent
|
||||
from .example_steps import step_configuration_delete
|
||||
from .example_steps import step_configuration_for_resource_group_list
|
||||
from .example_steps import step_public_configuration_show
|
||||
from .example_steps import step_public_configuration_list
|
||||
from .example_steps import step_update_list
|
||||
|
@ -45,59 +47,60 @@ TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
|
|||
|
||||
# Env setup_scenario
|
||||
@try_manual
|
||||
def setup_scenario(test, rg):
|
||||
def setup_scenario(test):
|
||||
pass
|
||||
|
||||
|
||||
# Env cleanup_scenario
|
||||
@try_manual
|
||||
def cleanup_scenario(test, rg):
|
||||
def cleanup_scenario(test):
|
||||
pass
|
||||
|
||||
|
||||
# Testcase: Scenario
|
||||
@try_manual
|
||||
def call_scenario(test, rg):
|
||||
setup_scenario(test, rg)
|
||||
step_applyupdate_for_resource_group_list(test, rg, checks=[])
|
||||
step_applyupdate_create(test, rg, checks=[])
|
||||
step_applyupdate_create2(test, rg, checks=[])
|
||||
step_applyupdate_show(test, rg, checks=[])
|
||||
step_applyupdate_show_parent(test, rg, checks=[])
|
||||
step_applyupdate_list(test, rg, checks=[])
|
||||
step_configuration_create(test, rg, checks=[])
|
||||
step_configuration_show(test, rg, checks=[])
|
||||
step_configuration_list(test, rg, checks=[])
|
||||
step_configuration_update(test, rg, checks=[])
|
||||
step_assignment_create(test, rg, checks=[
|
||||
test.check("maintenanceConfigurationId", "/subscriptions/{subscription_id}/resourcegroups/{rg}/providers/Micros"
|
||||
"oft.Maintenance/maintenanceConfigurations/{myMaintenanceConfiguration2}", case_sensitive=False),
|
||||
test.check("name", "{myConfigurationAssignment2}", case_sensitive=False),
|
||||
])
|
||||
step_assignment_create2(test, rg, checks=[
|
||||
def call_scenario(test):
|
||||
setup_scenario(test)
|
||||
step_applyupdate_create(test, checks=[])
|
||||
step_applyupdate_create_or_update_parent(test, checks=[])
|
||||
step_applyupdate_show(test, checks=[])
|
||||
step_applyupdate_show_parent(test, checks=[])
|
||||
step_applyupdate_list(test, checks=[])
|
||||
step_configuration_create(test, checks=[])
|
||||
step_configuration_show(test, checks=[])
|
||||
step_configuration_show2(test, checks=[])
|
||||
step_configuration_show3(test, checks=[])
|
||||
step_configuration_list(test, checks=[])
|
||||
step_configuration_update(test, checks=[])
|
||||
step_assignment_create(test, checks=[
|
||||
test.check("maintenanceConfigurationId", "/subscriptions/{subscription_id}/resourcegroups/{rg}/providers/Micros"
|
||||
"oft.Maintenance/maintenanceConfigurations/{myMaintenanceConfiguration}", case_sensitive=False),
|
||||
test.check("name", "{myConfigurationAssignment}", case_sensitive=False),
|
||||
])
|
||||
step_assignment_list(test, rg, checks=[
|
||||
step_assignment_create_or_update_parent(test, checks=[])
|
||||
step_assignment_show(test, checks=[
|
||||
test.check("maintenanceConfigurationId", "/subscriptions/{subscription_id}/resourcegroups/{rg}/providers/Micros"
|
||||
"oft.Maintenance/maintenanceConfigurations/{myMaintenanceConfiguration}", case_sensitive=False),
|
||||
test.check("name", "{myConfigurationAssignment}", case_sensitive=False),
|
||||
])
|
||||
step_assignment_show_parent(test, checks=[])
|
||||
step_assignment_list(test, checks=[
|
||||
test.check('length(@)', 1),
|
||||
])
|
||||
step_assignment_list_parent(test, rg, checks=[])
|
||||
step_assignment_delete(test, rg, checks=[])
|
||||
step_assignment_delete2(test, rg, checks=[])
|
||||
step_configuration_delete(test, rg, checks=[])
|
||||
step_configuration_for_resource_group_list(test, rg, checks=[])
|
||||
step_public_configuration_show(test, rg, checks=[])
|
||||
step_public_configuration_list(test, rg, checks=[])
|
||||
step_update_list(test, rg, checks=[])
|
||||
step_update_list_parent(test, rg, checks=[])
|
||||
cleanup_scenario(test, rg)
|
||||
step_assignment_list_parent(test, checks=[])
|
||||
step_assignment_delete(test, checks=[])
|
||||
step_assignment_delete_parent(test, checks=[])
|
||||
step_configuration_delete(test, checks=[])
|
||||
step_public_configuration_show(test, checks=[])
|
||||
step_public_configuration_list(test, checks=[])
|
||||
step_update_list(test, checks=[])
|
||||
step_update_list_parent(test, checks=[])
|
||||
cleanup_scenario(test)
|
||||
|
||||
|
||||
# Test class for Scenario
|
||||
@try_manual
|
||||
class MaintenanceScenarioTest(ScenarioTest):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(MaintenanceScenarioTest, self).__init__(*args, **kwargs)
|
||||
self.kwargs.update({
|
||||
|
@ -114,8 +117,8 @@ class MaintenanceScenarioTest(ScenarioTest):
|
|||
'HSProbeSettings': '{"protocol": "https", "port": "80", "requestPath": "/"}'
|
||||
})
|
||||
|
||||
@ResourceGroupPreparer(name_prefix='clitestmaintenance_examplerg'[:7], key='rg', parameter_name='rg')
|
||||
@ResourceGroupPreparer(name_prefix='clitestmaintenance_examplerg'[:7], key='rg', parameter_name='rg', location="eastus2euap")
|
||||
def test_maintenance_Scenario(self, rg):
|
||||
call_scenario(self, rg)
|
||||
call_scenario(self)
|
||||
calc_coverage(__file__)
|
||||
raise_if()
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from ._maintenance_client import MaintenanceClient
|
||||
__all__ = ['MaintenanceClient']
|
||||
from ._maintenance_management_client import MaintenanceManagementClient
|
||||
__all__ = ['MaintenanceManagementClient']
|
||||
|
||||
try:
|
||||
from ._patch import patch_sdk # type: ignore
|
||||
|
|
|
@ -20,8 +20,8 @@ if TYPE_CHECKING:
|
|||
|
||||
VERSION = "unknown"
|
||||
|
||||
class MaintenanceClientConfiguration(Configuration):
|
||||
"""Configuration for MaintenanceClient.
|
||||
class MaintenanceManagementClientConfiguration(Configuration):
|
||||
"""Configuration for MaintenanceManagementClient.
|
||||
|
||||
Note that all parameters used to create this instance are saved as instance
|
||||
attributes.
|
||||
|
@ -43,13 +43,13 @@ class MaintenanceClientConfiguration(Configuration):
|
|||
raise ValueError("Parameter 'credential' must not be None.")
|
||||
if subscription_id is None:
|
||||
raise ValueError("Parameter 'subscription_id' must not be None.")
|
||||
super(MaintenanceClientConfiguration, self).__init__(**kwargs)
|
||||
super(MaintenanceManagementClientConfiguration, self).__init__(**kwargs)
|
||||
|
||||
self.credential = credential
|
||||
self.subscription_id = subscription_id
|
||||
self.api_version = "2021-05-01"
|
||||
self.api_version = "2021-09-01-preview"
|
||||
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
|
||||
kwargs.setdefault('sdk_moniker', 'maintenanceclient/{}'.format(VERSION))
|
||||
kwargs.setdefault('sdk_moniker', 'maintenancemanagementclient/{}'.format(VERSION))
|
||||
self._configure(**kwargs)
|
||||
|
||||
def _configure(
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from azure.mgmt.core import ARMPipelineClient
|
||||
from msrest import Deserializer, Serializer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from typing import Any, Optional
|
||||
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
from ._configuration import MaintenanceManagementClientConfiguration
|
||||
from .operations import PublicMaintenanceConfigurationsOperations
|
||||
from .operations import ApplyUpdatesOperations
|
||||
from .operations import ConfigurationAssignmentsOperations
|
||||
from .operations import MaintenanceConfigurationsOperations
|
||||
from .operations import MaintenanceConfigurationsForResourceGroupOperations
|
||||
from .operations import ApplyUpdateForResourceGroupOperations
|
||||
from .operations import ConfigurationAssignmentsWithinSubscriptionOperations
|
||||
from .operations import Operations
|
||||
from .operations import UpdatesOperations
|
||||
from . import models
|
||||
|
||||
|
||||
class MaintenanceManagementClient(object):
|
||||
"""Azure Maintenance Management Client.
|
||||
|
||||
:ivar public_maintenance_configurations: PublicMaintenanceConfigurationsOperations operations
|
||||
:vartype public_maintenance_configurations: maintenance_management_client.operations.PublicMaintenanceConfigurationsOperations
|
||||
:ivar apply_updates: ApplyUpdatesOperations operations
|
||||
:vartype apply_updates: maintenance_management_client.operations.ApplyUpdatesOperations
|
||||
:ivar configuration_assignments: ConfigurationAssignmentsOperations operations
|
||||
:vartype configuration_assignments: maintenance_management_client.operations.ConfigurationAssignmentsOperations
|
||||
:ivar maintenance_configurations: MaintenanceConfigurationsOperations operations
|
||||
:vartype maintenance_configurations: maintenance_management_client.operations.MaintenanceConfigurationsOperations
|
||||
:ivar maintenance_configurations_for_resource_group: MaintenanceConfigurationsForResourceGroupOperations operations
|
||||
:vartype maintenance_configurations_for_resource_group: maintenance_management_client.operations.MaintenanceConfigurationsForResourceGroupOperations
|
||||
:ivar apply_update_for_resource_group: ApplyUpdateForResourceGroupOperations operations
|
||||
:vartype apply_update_for_resource_group: maintenance_management_client.operations.ApplyUpdateForResourceGroupOperations
|
||||
:ivar configuration_assignments_within_subscription: ConfigurationAssignmentsWithinSubscriptionOperations operations
|
||||
:vartype configuration_assignments_within_subscription: maintenance_management_client.operations.ConfigurationAssignmentsWithinSubscriptionOperations
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: maintenance_management_client.operations.Operations
|
||||
:ivar updates: UpdatesOperations operations
|
||||
:vartype updates: maintenance_management_client.operations.UpdatesOperations
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
|
||||
:type subscription_id: str
|
||||
:param str base_url: Service URL
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential, # type: "TokenCredential"
|
||||
subscription_id, # type: str
|
||||
base_url=None, # type: Optional[str]
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> None
|
||||
if not base_url:
|
||||
base_url = 'https://management.azure.com'
|
||||
self._config = MaintenanceManagementClientConfiguration(credential, subscription_id, **kwargs)
|
||||
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
|
||||
|
||||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
||||
self._serialize = Serializer(client_models)
|
||||
self._deserialize = Deserializer(client_models)
|
||||
|
||||
self.public_maintenance_configurations = PublicMaintenanceConfigurationsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.apply_updates = ApplyUpdatesOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.configuration_assignments = ConfigurationAssignmentsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.maintenance_configurations = MaintenanceConfigurationsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.maintenance_configurations_for_resource_group = MaintenanceConfigurationsForResourceGroupOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.apply_update_for_resource_group = ApplyUpdateForResourceGroupOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.configuration_assignments_within_subscription = ConfigurationAssignmentsWithinSubscriptionOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.operations = Operations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.updates = UpdatesOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
def close(self):
|
||||
# type: () -> None
|
||||
self._client.close()
|
||||
|
||||
def __enter__(self):
|
||||
# type: () -> MaintenanceManagementClient
|
||||
self._client.__enter__()
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc_details):
|
||||
# type: (Any) -> None
|
||||
self._client.__exit__(*exc_details)
|
|
@ -6,5 +6,5 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from ._maintenance_client import MaintenanceClient
|
||||
__all__ = ['MaintenanceClient']
|
||||
from ._maintenance_management_client import MaintenanceManagementClient
|
||||
__all__ = ['MaintenanceManagementClient']
|
||||
|
|
|
@ -18,8 +18,8 @@ if TYPE_CHECKING:
|
|||
|
||||
VERSION = "unknown"
|
||||
|
||||
class MaintenanceClientConfiguration(Configuration):
|
||||
"""Configuration for MaintenanceClient.
|
||||
class MaintenanceManagementClientConfiguration(Configuration):
|
||||
"""Configuration for MaintenanceManagementClient.
|
||||
|
||||
Note that all parameters used to create this instance are saved as instance
|
||||
attributes.
|
||||
|
@ -40,13 +40,13 @@ class MaintenanceClientConfiguration(Configuration):
|
|||
raise ValueError("Parameter 'credential' must not be None.")
|
||||
if subscription_id is None:
|
||||
raise ValueError("Parameter 'subscription_id' must not be None.")
|
||||
super(MaintenanceClientConfiguration, self).__init__(**kwargs)
|
||||
super(MaintenanceManagementClientConfiguration, self).__init__(**kwargs)
|
||||
|
||||
self.credential = credential
|
||||
self.subscription_id = subscription_id
|
||||
self.api_version = "2021-05-01"
|
||||
self.api_version = "2021-09-01-preview"
|
||||
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
|
||||
kwargs.setdefault('sdk_moniker', 'maintenanceclient/{}'.format(VERSION))
|
||||
kwargs.setdefault('sdk_moniker', 'maintenancemanagementclient/{}'.format(VERSION))
|
||||
self._configure(**kwargs)
|
||||
|
||||
def _configure(
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from typing import Any, Optional, TYPE_CHECKING
|
||||
|
||||
from azure.mgmt.core import AsyncARMPipelineClient
|
||||
from msrest import Deserializer, Serializer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
from ._configuration import MaintenanceManagementClientConfiguration
|
||||
from .operations import PublicMaintenanceConfigurationsOperations
|
||||
from .operations import ApplyUpdatesOperations
|
||||
from .operations import ConfigurationAssignmentsOperations
|
||||
from .operations import MaintenanceConfigurationsOperations
|
||||
from .operations import MaintenanceConfigurationsForResourceGroupOperations
|
||||
from .operations import ApplyUpdateForResourceGroupOperations
|
||||
from .operations import ConfigurationAssignmentsWithinSubscriptionOperations
|
||||
from .operations import Operations
|
||||
from .operations import UpdatesOperations
|
||||
from .. import models
|
||||
|
||||
|
||||
class MaintenanceManagementClient(object):
|
||||
"""Azure Maintenance Management Client.
|
||||
|
||||
:ivar public_maintenance_configurations: PublicMaintenanceConfigurationsOperations operations
|
||||
:vartype public_maintenance_configurations: maintenance_management_client.aio.operations.PublicMaintenanceConfigurationsOperations
|
||||
:ivar apply_updates: ApplyUpdatesOperations operations
|
||||
:vartype apply_updates: maintenance_management_client.aio.operations.ApplyUpdatesOperations
|
||||
:ivar configuration_assignments: ConfigurationAssignmentsOperations operations
|
||||
:vartype configuration_assignments: maintenance_management_client.aio.operations.ConfigurationAssignmentsOperations
|
||||
:ivar maintenance_configurations: MaintenanceConfigurationsOperations operations
|
||||
:vartype maintenance_configurations: maintenance_management_client.aio.operations.MaintenanceConfigurationsOperations
|
||||
:ivar maintenance_configurations_for_resource_group: MaintenanceConfigurationsForResourceGroupOperations operations
|
||||
:vartype maintenance_configurations_for_resource_group: maintenance_management_client.aio.operations.MaintenanceConfigurationsForResourceGroupOperations
|
||||
:ivar apply_update_for_resource_group: ApplyUpdateForResourceGroupOperations operations
|
||||
:vartype apply_update_for_resource_group: maintenance_management_client.aio.operations.ApplyUpdateForResourceGroupOperations
|
||||
:ivar configuration_assignments_within_subscription: ConfigurationAssignmentsWithinSubscriptionOperations operations
|
||||
:vartype configuration_assignments_within_subscription: maintenance_management_client.aio.operations.ConfigurationAssignmentsWithinSubscriptionOperations
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: maintenance_management_client.aio.operations.Operations
|
||||
:ivar updates: UpdatesOperations operations
|
||||
:vartype updates: maintenance_management_client.aio.operations.UpdatesOperations
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
|
||||
:type subscription_id: str
|
||||
:param str base_url: Service URL
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "AsyncTokenCredential",
|
||||
subscription_id: str,
|
||||
base_url: Optional[str] = None,
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
if not base_url:
|
||||
base_url = 'https://management.azure.com'
|
||||
self._config = MaintenanceManagementClientConfiguration(credential, subscription_id, **kwargs)
|
||||
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
|
||||
|
||||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
||||
self._serialize = Serializer(client_models)
|
||||
self._deserialize = Deserializer(client_models)
|
||||
|
||||
self.public_maintenance_configurations = PublicMaintenanceConfigurationsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.apply_updates = ApplyUpdatesOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.configuration_assignments = ConfigurationAssignmentsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.maintenance_configurations = MaintenanceConfigurationsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.maintenance_configurations_for_resource_group = MaintenanceConfigurationsForResourceGroupOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.apply_update_for_resource_group = ApplyUpdateForResourceGroupOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.configuration_assignments_within_subscription = ConfigurationAssignmentsWithinSubscriptionOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.operations = Operations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
self.updates = UpdatesOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
async def close(self) -> None:
|
||||
await self._client.close()
|
||||
|
||||
async def __aenter__(self) -> "MaintenanceManagementClient":
|
||||
await self._client.__aenter__()
|
||||
return self
|
||||
|
||||
async def __aexit__(self, *exc_details) -> None:
|
||||
await self._client.__aexit__(*exc_details)
|
|
@ -12,6 +12,7 @@ from ._configuration_assignments_operations import ConfigurationAssignmentsOpera
|
|||
from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations
|
||||
from ._maintenance_configurations_for_resource_group_operations import MaintenanceConfigurationsForResourceGroupOperations
|
||||
from ._apply_update_for_resource_group_operations import ApplyUpdateForResourceGroupOperations
|
||||
from ._configuration_assignments_within_subscription_operations import ConfigurationAssignmentsWithinSubscriptionOperations
|
||||
from ._operations import Operations
|
||||
from ._updates_operations import UpdatesOperations
|
||||
|
||||
|
@ -22,6 +23,7 @@ __all__ = [
|
|||
'MaintenanceConfigurationsOperations',
|
||||
'MaintenanceConfigurationsForResourceGroupOperations',
|
||||
'ApplyUpdateForResourceGroupOperations',
|
||||
'ConfigurationAssignmentsWithinSubscriptionOperations',
|
||||
'Operations',
|
||||
'UpdatesOperations',
|
||||
]
|
||||
|
|
|
@ -26,7 +26,7 @@ class ApplyUpdateForResourceGroupOperations:
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -54,7 +54,7 @@ class ApplyUpdateForResourceGroupOperations:
|
|||
:type resource_group_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListApplyUpdate or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_client.models.ListApplyUpdate]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.ListApplyUpdate]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListApplyUpdate"]
|
||||
|
@ -62,7 +62,7 @@ class ApplyUpdateForResourceGroupOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -26,7 +26,7 @@ class ApplyUpdatesOperations:
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -72,7 +72,7 @@ class ApplyUpdatesOperations:
|
|||
:type apply_update_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ApplyUpdate, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ApplyUpdate
|
||||
:rtype: ~maintenance_management_client.models.ApplyUpdate
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ApplyUpdate"]
|
||||
|
@ -80,7 +80,7 @@ class ApplyUpdatesOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -147,7 +147,7 @@ class ApplyUpdatesOperations:
|
|||
:type apply_update_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ApplyUpdate, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ApplyUpdate
|
||||
:rtype: ~maintenance_management_client.models.ApplyUpdate
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ApplyUpdate"]
|
||||
|
@ -155,7 +155,7 @@ class ApplyUpdatesOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -223,7 +223,7 @@ class ApplyUpdatesOperations:
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ApplyUpdate, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ApplyUpdate
|
||||
:rtype: ~maintenance_management_client.models.ApplyUpdate
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ApplyUpdate"]
|
||||
|
@ -231,7 +231,7 @@ class ApplyUpdatesOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -294,7 +294,7 @@ class ApplyUpdatesOperations:
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ApplyUpdate, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ApplyUpdate
|
||||
:rtype: ~maintenance_management_client.models.ApplyUpdate
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ApplyUpdate"]
|
||||
|
@ -302,7 +302,7 @@ class ApplyUpdatesOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -351,7 +351,7 @@ class ApplyUpdatesOperations:
|
|||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListApplyUpdate or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_client.models.ListApplyUpdate]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.ListApplyUpdate]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListApplyUpdate"]
|
||||
|
@ -359,7 +359,7 @@ class ApplyUpdatesOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -26,7 +26,7 @@ class ConfigurationAssignmentsOperations:
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -41,6 +41,87 @@ class ConfigurationAssignmentsOperations:
|
|||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
async def get_parent(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
provider_name: str,
|
||||
resource_parent_type: str,
|
||||
resource_parent_name: str,
|
||||
resource_type: str,
|
||||
resource_name: str,
|
||||
configuration_assignment_name: str,
|
||||
**kwargs
|
||||
) -> "models.ConfigurationAssignment":
|
||||
"""Get configuration assignment.
|
||||
|
||||
Get configuration for resource.
|
||||
|
||||
:param resource_group_name: Resource group name.
|
||||
:type resource_group_name: str
|
||||
:param provider_name: Resource provider name.
|
||||
:type provider_name: str
|
||||
:param resource_parent_type: Resource parent type.
|
||||
:type resource_parent_type: str
|
||||
:param resource_parent_name: Resource parent identifier.
|
||||
:type resource_parent_name: str
|
||||
:param resource_type: Resource type.
|
||||
:type resource_type: str
|
||||
:param resource_name: Resource identifier.
|
||||
:type resource_name: str
|
||||
:param configuration_assignment_name: Configuration assignment name.
|
||||
:type configuration_assignment_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigurationAssignment"]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
url = self.get_parent.metadata['url'] # type: ignore
|
||||
path_format_arguments = {
|
||||
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
|
||||
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
|
||||
'providerName': self._serialize.url("provider_name", provider_name, 'str'),
|
||||
'resourceParentType': self._serialize.url("resource_parent_type", resource_parent_type, 'str'),
|
||||
'resourceParentName': self._serialize.url("resource_parent_name", resource_parent_name, 'str'),
|
||||
'resourceType': self._serialize.url("resource_type", resource_type, 'str'),
|
||||
'resourceName': self._serialize.url("resource_name", resource_name, 'str'),
|
||||
'configurationAssignmentName': self._serialize.url("configuration_assignment_name", configuration_assignment_name, 'str'),
|
||||
}
|
||||
url = self._client.format_url(url, **path_format_arguments)
|
||||
|
||||
# Construct parameters
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
error = self._deserialize(models.MaintenanceError, response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize('ConfigurationAssignment', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
get_parent.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}'} # type: ignore
|
||||
|
||||
async def create_or_update_parent(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
|
@ -72,10 +153,10 @@ class ConfigurationAssignmentsOperations:
|
|||
:param configuration_assignment_name: Configuration assignment name.
|
||||
:type configuration_assignment_name: str
|
||||
:param configuration_assignment: The configurationAssignment.
|
||||
:type configuration_assignment: ~maintenance_client.models.ConfigurationAssignment
|
||||
:type configuration_assignment: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ConfigurationAssignment
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigurationAssignment"]
|
||||
|
@ -83,7 +164,7 @@ class ConfigurationAssignmentsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
content_type = kwargs.pop("content_type", "application/json")
|
||||
accept = "application/json"
|
||||
|
||||
|
@ -161,7 +242,7 @@ class ConfigurationAssignmentsOperations:
|
|||
:type configuration_assignment_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ConfigurationAssignment or None
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment or None
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConfigurationAssignment"]]
|
||||
|
@ -169,7 +250,7 @@ class ConfigurationAssignmentsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -213,6 +294,79 @@ class ConfigurationAssignmentsOperations:
|
|||
return deserialized
|
||||
delete_parent.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}'} # type: ignore
|
||||
|
||||
async def get(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
provider_name: str,
|
||||
resource_type: str,
|
||||
resource_name: str,
|
||||
configuration_assignment_name: str,
|
||||
**kwargs
|
||||
) -> "models.ConfigurationAssignment":
|
||||
"""Get configuration assignment.
|
||||
|
||||
Get configuration for resource.
|
||||
|
||||
:param resource_group_name: Resource group name.
|
||||
:type resource_group_name: str
|
||||
:param provider_name: Resource provider name.
|
||||
:type provider_name: str
|
||||
:param resource_type: Resource type.
|
||||
:type resource_type: str
|
||||
:param resource_name: Resource identifier.
|
||||
:type resource_name: str
|
||||
:param configuration_assignment_name: Configuration assignment name.
|
||||
:type configuration_assignment_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigurationAssignment"]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
url = self.get.metadata['url'] # type: ignore
|
||||
path_format_arguments = {
|
||||
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
|
||||
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
|
||||
'providerName': self._serialize.url("provider_name", provider_name, 'str'),
|
||||
'resourceType': self._serialize.url("resource_type", resource_type, 'str'),
|
||||
'resourceName': self._serialize.url("resource_name", resource_name, 'str'),
|
||||
'configurationAssignmentName': self._serialize.url("configuration_assignment_name", configuration_assignment_name, 'str'),
|
||||
}
|
||||
url = self._client.format_url(url, **path_format_arguments)
|
||||
|
||||
# Construct parameters
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
error = self._deserialize(models.MaintenanceError, response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize('ConfigurationAssignment', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}'} # type: ignore
|
||||
|
||||
async def create_or_update(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
|
@ -238,10 +392,10 @@ class ConfigurationAssignmentsOperations:
|
|||
:param configuration_assignment_name: Configuration assignment name.
|
||||
:type configuration_assignment_name: str
|
||||
:param configuration_assignment: The configurationAssignment.
|
||||
:type configuration_assignment: ~maintenance_client.models.ConfigurationAssignment
|
||||
:type configuration_assignment: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ConfigurationAssignment
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigurationAssignment"]
|
||||
|
@ -249,7 +403,7 @@ class ConfigurationAssignmentsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
content_type = kwargs.pop("content_type", "application/json")
|
||||
accept = "application/json"
|
||||
|
||||
|
@ -319,7 +473,7 @@ class ConfigurationAssignmentsOperations:
|
|||
:type configuration_assignment_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ConfigurationAssignment or None
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment or None
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConfigurationAssignment"]]
|
||||
|
@ -327,7 +481,7 @@ class ConfigurationAssignmentsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -397,7 +551,7 @@ class ConfigurationAssignmentsOperations:
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListConfigurationAssignmentsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_client.models.ListConfigurationAssignmentsResult]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.ListConfigurationAssignmentsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListConfigurationAssignmentsResult"]
|
||||
|
@ -405,7 +559,7 @@ class ConfigurationAssignmentsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
@ -484,7 +638,7 @@ class ConfigurationAssignmentsOperations:
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListConfigurationAssignmentsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_client.models.ListConfigurationAssignmentsResult]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.ListConfigurationAssignmentsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListConfigurationAssignmentsResult"]
|
||||
|
@ -492,7 +646,7 @@ class ConfigurationAssignmentsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
|
||||
import warnings
|
||||
|
||||
from azure.core.async_paging import AsyncItemPaged, AsyncList
|
||||
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models
|
||||
|
||||
T = TypeVar('T')
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
class ConfigurationAssignmentsWithinSubscriptionOperations:
|
||||
"""ConfigurationAssignmentsWithinSubscriptionOperations async operations.
|
||||
|
||||
You should not instantiate this class directly. Instead, you should create a Client instance that
|
||||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
:param deserializer: An object model deserializer.
|
||||
"""
|
||||
|
||||
models = models
|
||||
|
||||
def __init__(self, client, config, serializer, deserializer) -> None:
|
||||
self._client = client
|
||||
self._serialize = serializer
|
||||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
def list(
|
||||
self,
|
||||
**kwargs
|
||||
) -> AsyncIterable["models.ListConfigurationAssignmentsResult"]:
|
||||
"""Get configuration assignment within a subscription.
|
||||
|
||||
Get configuration assignment within a subscription.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListConfigurationAssignmentsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.ListConfigurationAssignmentsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListConfigurationAssignmentsResult"]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
|
||||
|
||||
if not next_link:
|
||||
# Construct URL
|
||||
url = self.list.metadata['url'] # type: ignore
|
||||
path_format_arguments = {
|
||||
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
|
||||
}
|
||||
url = self._client.format_url(url, **path_format_arguments)
|
||||
# Construct parameters
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
else:
|
||||
url = next_link
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
return request
|
||||
|
||||
async def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize('ListConfigurationAssignmentsResult', pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem)
|
||||
return None, AsyncList(list_of_elem)
|
||||
|
||||
async def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
error = self._deserialize(models.MaintenanceError, response)
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return AsyncItemPaged(
|
||||
get_next, extract_data
|
||||
)
|
||||
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments'} # type: ignore
|
|
@ -26,7 +26,7 @@ class MaintenanceConfigurationsForResourceGroupOperations:
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -54,7 +54,7 @@ class MaintenanceConfigurationsForResourceGroupOperations:
|
|||
:type resource_group_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListMaintenanceConfigurationsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_client.models.ListMaintenanceConfigurationsResult]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.ListMaintenanceConfigurationsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListMaintenanceConfigurationsResult"]
|
||||
|
@ -62,7 +62,7 @@ class MaintenanceConfigurationsForResourceGroupOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -26,7 +26,7 @@ class MaintenanceConfigurationsOperations:
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -57,7 +57,7 @@ class MaintenanceConfigurationsOperations:
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MaintenanceConfiguration, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:rtype: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MaintenanceConfiguration"]
|
||||
|
@ -65,7 +65,7 @@ class MaintenanceConfigurationsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -118,10 +118,10 @@ class MaintenanceConfigurationsOperations:
|
|||
:param resource_name: Maintenance Configuration Name.
|
||||
:type resource_name: str
|
||||
:param configuration: The configuration.
|
||||
:type configuration: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:type configuration: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MaintenanceConfiguration, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:rtype: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MaintenanceConfiguration"]
|
||||
|
@ -129,7 +129,7 @@ class MaintenanceConfigurationsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
content_type = kwargs.pop("content_type", "application/json")
|
||||
accept = "application/json"
|
||||
|
||||
|
@ -187,7 +187,7 @@ class MaintenanceConfigurationsOperations:
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MaintenanceConfiguration, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.MaintenanceConfiguration or None
|
||||
:rtype: ~maintenance_management_client.models.MaintenanceConfiguration or None
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MaintenanceConfiguration"]]
|
||||
|
@ -195,7 +195,7 @@ class MaintenanceConfigurationsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -250,10 +250,10 @@ class MaintenanceConfigurationsOperations:
|
|||
:param resource_name: Maintenance Configuration Name.
|
||||
:type resource_name: str
|
||||
:param configuration: The configuration.
|
||||
:type configuration: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:type configuration: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MaintenanceConfiguration, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:rtype: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MaintenanceConfiguration"]
|
||||
|
@ -261,7 +261,7 @@ class MaintenanceConfigurationsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
content_type = kwargs.pop("content_type", "application/json")
|
||||
accept = "application/json"
|
||||
|
||||
|
@ -313,7 +313,7 @@ class MaintenanceConfigurationsOperations:
|
|||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListMaintenanceConfigurationsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_client.models.ListMaintenanceConfigurationsResult]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.ListMaintenanceConfigurationsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListMaintenanceConfigurationsResult"]
|
||||
|
@ -321,7 +321,7 @@ class MaintenanceConfigurationsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -26,7 +26,7 @@ class Operations:
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -51,7 +51,7 @@ class Operations:
|
|||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either OperationsListResult or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_client.models.OperationsListResult]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.OperationsListResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationsListResult"]
|
||||
|
@ -59,7 +59,7 @@ class Operations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -26,7 +26,7 @@ class PublicMaintenanceConfigurationsOperations:
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -51,7 +51,7 @@ class PublicMaintenanceConfigurationsOperations:
|
|||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListMaintenanceConfigurationsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_client.models.ListMaintenanceConfigurationsResult]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.ListMaintenanceConfigurationsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListMaintenanceConfigurationsResult"]
|
||||
|
@ -59,7 +59,7 @@ class PublicMaintenanceConfigurationsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
@ -123,7 +123,7 @@ class PublicMaintenanceConfigurationsOperations:
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MaintenanceConfiguration, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:rtype: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MaintenanceConfiguration"]
|
||||
|
@ -131,7 +131,7 @@ class PublicMaintenanceConfigurationsOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
|
|
@ -26,7 +26,7 @@ class UpdatesOperations:
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -69,7 +69,7 @@ class UpdatesOperations:
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListUpdatesResult or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_client.models.ListUpdatesResult]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.ListUpdatesResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListUpdatesResult"]
|
||||
|
@ -77,7 +77,7 @@ class UpdatesOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
@ -156,7 +156,7 @@ class UpdatesOperations:
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListUpdatesResult or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_client.models.ListUpdatesResult]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~maintenance_management_client.models.ListUpdatesResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListUpdatesResult"]
|
||||
|
@ -164,7 +164,7 @@ class UpdatesOperations:
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -10,6 +10,9 @@ try:
|
|||
from ._models_py3 import ApplyUpdate
|
||||
from ._models_py3 import ConfigurationAssignment
|
||||
from ._models_py3 import ErrorDetails
|
||||
from ._models_py3 import InputLinuxParameters
|
||||
from ._models_py3 import InputPatchConfiguration
|
||||
from ._models_py3 import InputWindowsParameters
|
||||
from ._models_py3 import ListApplyUpdate
|
||||
from ._models_py3 import ListConfigurationAssignmentsResult
|
||||
from ._models_py3 import ListMaintenanceConfigurationsResult
|
||||
|
@ -21,11 +24,15 @@ try:
|
|||
from ._models_py3 import OperationsListResult
|
||||
from ._models_py3 import Resource
|
||||
from ._models_py3 import SystemData
|
||||
from ._models_py3 import TaskProperties
|
||||
from ._models_py3 import Update
|
||||
except (SyntaxError, ImportError):
|
||||
from ._models import ApplyUpdate # type: ignore
|
||||
from ._models import ConfigurationAssignment # type: ignore
|
||||
from ._models import ErrorDetails # type: ignore
|
||||
from ._models import InputLinuxParameters # type: ignore
|
||||
from ._models import InputPatchConfiguration # type: ignore
|
||||
from ._models import InputWindowsParameters # type: ignore
|
||||
from ._models import ListApplyUpdate # type: ignore
|
||||
from ._models import ListConfigurationAssignmentsResult # type: ignore
|
||||
from ._models import ListMaintenanceConfigurationsResult # type: ignore
|
||||
|
@ -37,12 +44,15 @@ except (SyntaxError, ImportError):
|
|||
from ._models import OperationsListResult # type: ignore
|
||||
from ._models import Resource # type: ignore
|
||||
from ._models import SystemData # type: ignore
|
||||
from ._models import TaskProperties # type: ignore
|
||||
from ._models import Update # type: ignore
|
||||
|
||||
from ._maintenance_client_enums import (
|
||||
from ._maintenance_management_client_enums import (
|
||||
CreatedByType,
|
||||
ImpactType,
|
||||
MaintenanceScope,
|
||||
RebootOptions,
|
||||
TaskScope,
|
||||
UpdateStatus,
|
||||
Visibility,
|
||||
)
|
||||
|
@ -51,6 +61,9 @@ __all__ = [
|
|||
'ApplyUpdate',
|
||||
'ConfigurationAssignment',
|
||||
'ErrorDetails',
|
||||
'InputLinuxParameters',
|
||||
'InputPatchConfiguration',
|
||||
'InputWindowsParameters',
|
||||
'ListApplyUpdate',
|
||||
'ListConfigurationAssignmentsResult',
|
||||
'ListMaintenanceConfigurationsResult',
|
||||
|
@ -62,10 +75,13 @@ __all__ = [
|
|||
'OperationsListResult',
|
||||
'Resource',
|
||||
'SystemData',
|
||||
'TaskProperties',
|
||||
'Update',
|
||||
'CreatedByType',
|
||||
'ImpactType',
|
||||
'MaintenanceScope',
|
||||
'RebootOptions',
|
||||
'TaskScope',
|
||||
'UpdateStatus',
|
||||
'Visibility',
|
||||
]
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from enum import Enum, EnumMeta
|
||||
from six import with_metaclass
|
||||
|
||||
class _CaseInsensitiveEnumMeta(EnumMeta):
|
||||
def __getitem__(self, name):
|
||||
return super().__getitem__(name.upper())
|
||||
|
||||
def __getattr__(cls, name):
|
||||
"""Return the enum member matching `name`
|
||||
We use __getattr__ instead of descriptors or inserting into the enum
|
||||
class' __dict__ in order to support `name` and `value` being both
|
||||
properties for enum members (which live in the class' __dict__) and
|
||||
enum members themselves.
|
||||
"""
|
||||
try:
|
||||
return cls._member_map_[name.upper()]
|
||||
except KeyError:
|
||||
raise AttributeError(name)
|
||||
|
||||
|
||||
class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""The type of identity that created the resource.
|
||||
"""
|
||||
|
||||
USER = "User"
|
||||
APPLICATION = "Application"
|
||||
MANAGED_IDENTITY = "ManagedIdentity"
|
||||
KEY = "Key"
|
||||
|
||||
class ImpactType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""The impact type
|
||||
"""
|
||||
|
||||
NONE = "None" #: Pending updates has no impact on resource.
|
||||
FREEZE = "Freeze" #: Pending updates can freeze network or disk io operation on resource.
|
||||
RESTART = "Restart" #: Pending updates can cause resource to restart.
|
||||
REDEPLOY = "Redeploy" #: Pending updates can redeploy resource.
|
||||
|
||||
class MaintenanceScope(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""Gets or sets maintenanceScope of the configuration
|
||||
"""
|
||||
|
||||
HOST = "Host" #: This maintenance scope controls installation of azure platform updates i.e. services on physical nodes hosting customer VMs.
|
||||
OS_IMAGE = "OSImage" #: This maintenance scope controls os image installation on VM/VMSS.
|
||||
EXTENSION = "Extension" #: This maintenance scope controls extension installation on VM/VMSS.
|
||||
IN_GUEST_PATCH = "InGuestPatch" #: This maintenance scope controls installation of windows and linux packages on VM/VMSS.
|
||||
SQLDB = "SQLDB" #: This maintenance scope controls installation of SQL server platform updates.
|
||||
SQL_MANAGED_INSTANCE = "SQLManagedInstance" #: This maintenance scope controls installation of SQL managed instance platform update.
|
||||
|
||||
class RebootOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""Possible reboot preference as defined by the user based on which it would be decided to reboot
|
||||
the machine or not after the patch operation is completed.
|
||||
"""
|
||||
|
||||
IF_REQUIRED = "IfRequired"
|
||||
NEVER = "Never"
|
||||
ALWAYS = "Always"
|
||||
|
||||
class TaskScope(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""Global Task execute once when schedule trigger. Resource task execute for each VM.
|
||||
"""
|
||||
|
||||
GLOBAL_ENUM = "Global"
|
||||
RESOURCE = "Resource"
|
||||
|
||||
class UpdateStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""The status
|
||||
"""
|
||||
|
||||
PENDING = "Pending" #: There are pending updates to be installed.
|
||||
IN_PROGRESS = "InProgress" #: Updates installation are in progress.
|
||||
COMPLETED = "Completed" #: All updates are successfully applied.
|
||||
RETRY_NOW = "RetryNow" #: Updates installation failed but are ready to retry again.
|
||||
RETRY_LATER = "RetryLater" #: Updates installation failed and should be retried later.
|
||||
|
||||
class Visibility(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""Gets or sets the visibility of the configuration. The default value is 'Custom'
|
||||
"""
|
||||
|
||||
CUSTOM = "Custom" #: Only visible to users with permissions.
|
||||
PUBLIC = "Public" #: Visible to all users.
|
|
@ -23,7 +23,7 @@ class Resource(msrest.serialization.Model):
|
|||
:vartype type: str
|
||||
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
|
||||
information.
|
||||
:vartype system_data: ~maintenance_client.models.SystemData
|
||||
:vartype system_data: ~maintenance_management_client.models.SystemData
|
||||
"""
|
||||
|
||||
_validation = {
|
||||
|
@ -64,10 +64,10 @@ class ApplyUpdate(Resource):
|
|||
:vartype type: str
|
||||
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
|
||||
information.
|
||||
:vartype system_data: ~maintenance_client.models.SystemData
|
||||
:vartype system_data: ~maintenance_management_client.models.SystemData
|
||||
:param status: The status. Possible values include: "Pending", "InProgress", "Completed",
|
||||
"RetryNow", "RetryLater".
|
||||
:type status: str or ~maintenance_client.models.UpdateStatus
|
||||
:type status: str or ~maintenance_management_client.models.UpdateStatus
|
||||
:param resource_id: The resourceId.
|
||||
:type resource_id: str
|
||||
:param last_update_time: Last Update time.
|
||||
|
@ -114,7 +114,7 @@ class ConfigurationAssignment(Resource):
|
|||
:vartype type: str
|
||||
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
|
||||
information.
|
||||
:vartype system_data: ~maintenance_client.models.SystemData
|
||||
:vartype system_data: ~maintenance_management_client.models.SystemData
|
||||
:param location: Location of the resource.
|
||||
:type location: str
|
||||
:param maintenance_configuration_id: The maintenance configuration Id.
|
||||
|
@ -174,11 +174,110 @@ class ErrorDetails(msrest.serialization.Model):
|
|||
self.message = kwargs.get('message', None)
|
||||
|
||||
|
||||
class InputLinuxParameters(msrest.serialization.Model):
|
||||
"""Input properties for patching a Linux machine.
|
||||
|
||||
:param package_name_masks_to_exclude: Package names to be excluded for patching.
|
||||
:type package_name_masks_to_exclude: list[str]
|
||||
:param package_name_masks_to_include: Package names to be included for patching.
|
||||
:type package_name_masks_to_include: list[str]
|
||||
:param classifications_to_include: Classification category of patches to be patched.
|
||||
:type classifications_to_include: list[str]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'package_name_masks_to_exclude': {'key': 'packageNameMasksToExclude', 'type': '[str]'},
|
||||
'package_name_masks_to_include': {'key': 'packageNameMasksToInclude', 'type': '[str]'},
|
||||
'classifications_to_include': {'key': 'classificationsToInclude', 'type': '[str]'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
super(InputLinuxParameters, self).__init__(**kwargs)
|
||||
self.package_name_masks_to_exclude = kwargs.get('package_name_masks_to_exclude', None)
|
||||
self.package_name_masks_to_include = kwargs.get('package_name_masks_to_include', None)
|
||||
self.classifications_to_include = kwargs.get('classifications_to_include', None)
|
||||
|
||||
|
||||
class InputPatchConfiguration(msrest.serialization.Model):
|
||||
"""Input configuration for a patch run.
|
||||
|
||||
:param reboot_setting: Possible reboot preference as defined by the user based on which it
|
||||
would be decided to reboot the machine or not after the patch operation is completed. Possible
|
||||
values include: "IfRequired", "Never", "Always". Default value: "IfRequired".
|
||||
:type reboot_setting: str or ~maintenance_management_client.models.RebootOptions
|
||||
:param windows_parameters: Input parameters specific to patching a Windows machine. For Linux
|
||||
machines, do not pass this property.
|
||||
:type windows_parameters: ~maintenance_management_client.models.InputWindowsParameters
|
||||
:param linux_parameters: Input parameters specific to patching Linux machine. For Windows
|
||||
machines, do not pass this property.
|
||||
:type linux_parameters: ~maintenance_management_client.models.InputLinuxParameters
|
||||
:param pre_tasks: List of pre tasks. e.g. [{'source' :'runbook', 'taskScope': 'Global',
|
||||
'parameters': { 'arg1': 'value1'}}].
|
||||
:type pre_tasks: list[~maintenance_management_client.models.TaskProperties]
|
||||
:param post_tasks: List of post tasks. e.g. [{'source' :'runbook', 'taskScope': 'Resource',
|
||||
'parameters': { 'arg1': 'value1'}}].
|
||||
:type post_tasks: list[~maintenance_management_client.models.TaskProperties]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'reboot_setting': {'key': 'rebootSetting', 'type': 'str'},
|
||||
'windows_parameters': {'key': 'windowsParameters', 'type': 'InputWindowsParameters'},
|
||||
'linux_parameters': {'key': 'linuxParameters', 'type': 'InputLinuxParameters'},
|
||||
'pre_tasks': {'key': 'tasks.preTasks', 'type': '[TaskProperties]'},
|
||||
'post_tasks': {'key': 'tasks.postTasks', 'type': '[TaskProperties]'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
super(InputPatchConfiguration, self).__init__(**kwargs)
|
||||
self.reboot_setting = kwargs.get('reboot_setting', "IfRequired")
|
||||
self.windows_parameters = kwargs.get('windows_parameters', None)
|
||||
self.linux_parameters = kwargs.get('linux_parameters', None)
|
||||
self.pre_tasks = kwargs.get('pre_tasks', None)
|
||||
self.post_tasks = kwargs.get('post_tasks', None)
|
||||
|
||||
|
||||
class InputWindowsParameters(msrest.serialization.Model):
|
||||
"""Input properties for patching a Windows machine.
|
||||
|
||||
:param kb_numbers_to_exclude: Windows KBID to be excluded for patching.
|
||||
:type kb_numbers_to_exclude: list[str]
|
||||
:param kb_numbers_to_include: Windows KBID to be included for patching.
|
||||
:type kb_numbers_to_include: list[str]
|
||||
:param classifications_to_include: Classification category of patches to be patched.
|
||||
:type classifications_to_include: list[str]
|
||||
:param exclude_kbs_requiring_reboot: Exclude patches which need reboot.
|
||||
:type exclude_kbs_requiring_reboot: bool
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'kb_numbers_to_exclude': {'key': 'kbNumbersToExclude', 'type': '[str]'},
|
||||
'kb_numbers_to_include': {'key': 'kbNumbersToInclude', 'type': '[str]'},
|
||||
'classifications_to_include': {'key': 'classificationsToInclude', 'type': '[str]'},
|
||||
'exclude_kbs_requiring_reboot': {'key': 'excludeKbsRequiringReboot', 'type': 'bool'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
super(InputWindowsParameters, self).__init__(**kwargs)
|
||||
self.kb_numbers_to_exclude = kwargs.get('kb_numbers_to_exclude', None)
|
||||
self.kb_numbers_to_include = kwargs.get('kb_numbers_to_include', None)
|
||||
self.classifications_to_include = kwargs.get('classifications_to_include', None)
|
||||
self.exclude_kbs_requiring_reboot = kwargs.get('exclude_kbs_requiring_reboot', None)
|
||||
|
||||
|
||||
class ListApplyUpdate(msrest.serialization.Model):
|
||||
"""Response for ApplyUpdate list.
|
||||
|
||||
:param value: The list of apply updates.
|
||||
:type value: list[~maintenance_client.models.ApplyUpdate]
|
||||
:type value: list[~maintenance_management_client.models.ApplyUpdate]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -197,7 +296,7 @@ class ListConfigurationAssignmentsResult(msrest.serialization.Model):
|
|||
"""Response for ConfigurationAssignments list.
|
||||
|
||||
:param value: The list of configuration Assignments.
|
||||
:type value: list[~maintenance_client.models.ConfigurationAssignment]
|
||||
:type value: list[~maintenance_management_client.models.ConfigurationAssignment]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -216,7 +315,7 @@ class ListMaintenanceConfigurationsResult(msrest.serialization.Model):
|
|||
"""Response for MaintenanceConfigurations list.
|
||||
|
||||
:param value: The list of maintenance Configurations.
|
||||
:type value: list[~maintenance_client.models.MaintenanceConfiguration]
|
||||
:type value: list[~maintenance_management_client.models.MaintenanceConfiguration]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -235,7 +334,7 @@ class ListUpdatesResult(msrest.serialization.Model):
|
|||
"""Response for Updates list.
|
||||
|
||||
:param value: The pending updates.
|
||||
:type value: list[~maintenance_client.models.Update]
|
||||
:type value: list[~maintenance_management_client.models.Update]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -263,7 +362,7 @@ class MaintenanceConfiguration(Resource):
|
|||
:vartype type: str
|
||||
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
|
||||
information.
|
||||
:vartype system_data: ~maintenance_client.models.SystemData
|
||||
:vartype system_data: ~maintenance_management_client.models.SystemData
|
||||
:param location: Gets or sets location of the resource.
|
||||
:type location: str
|
||||
:param tags: A set of tags. Gets or sets tags of the resource.
|
||||
|
@ -274,10 +373,12 @@ class MaintenanceConfiguration(Resource):
|
|||
:type extension_properties: dict[str, str]
|
||||
:param maintenance_scope: Gets or sets maintenanceScope of the configuration. Possible values
|
||||
include: "Host", "OSImage", "Extension", "InGuestPatch", "SQLDB", "SQLManagedInstance".
|
||||
:type maintenance_scope: str or ~maintenance_client.models.MaintenanceScope
|
||||
:type maintenance_scope: str or ~maintenance_management_client.models.MaintenanceScope
|
||||
:param visibility: Gets or sets the visibility of the configuration. The default value is
|
||||
'Custom'. Possible values include: "Custom", "Public".
|
||||
:type visibility: str or ~maintenance_client.models.Visibility
|
||||
:type visibility: str or ~maintenance_management_client.models.Visibility
|
||||
:param install_patches: The input parameters to be passed to the patch run operation.
|
||||
:type install_patches: ~maintenance_management_client.models.InputPatchConfiguration
|
||||
:param start_date_time: Effective start date of the maintenance window in YYYY-MM-DD hh:mm
|
||||
format. The start date can be set to either the current date or future date. The window will be
|
||||
created in the time zone provided and adjusted to daylight savings according to that time zone.
|
||||
|
@ -302,9 +403,11 @@ class MaintenanceConfiguration(Resource):
|
|||
Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week
|
||||
Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma
|
||||
separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First,
|
||||
Second, Third, Fourth, Last)] [Weekday Monday-Sunday]. Monthly schedule examples are
|
||||
recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last
|
||||
Sunday, recurEvery: Month Fourth Monday.
|
||||
Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset
|
||||
value must be between -6 to 6 inclusive. Monthly schedule examples are 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.
|
||||
:type recur_every: str
|
||||
"""
|
||||
|
||||
|
@ -326,6 +429,7 @@ class MaintenanceConfiguration(Resource):
|
|||
'extension_properties': {'key': 'properties.extensionProperties', 'type': '{str}'},
|
||||
'maintenance_scope': {'key': 'properties.maintenanceScope', 'type': 'str'},
|
||||
'visibility': {'key': 'properties.visibility', 'type': 'str'},
|
||||
'install_patches': {'key': 'properties.installPatches', 'type': 'InputPatchConfiguration'},
|
||||
'start_date_time': {'key': 'properties.maintenanceWindow.startDateTime', 'type': 'str'},
|
||||
'expiration_date_time': {'key': 'properties.maintenanceWindow.expirationDateTime', 'type': 'str'},
|
||||
'duration': {'key': 'properties.maintenanceWindow.duration', 'type': 'str'},
|
||||
|
@ -344,6 +448,7 @@ class MaintenanceConfiguration(Resource):
|
|||
self.extension_properties = kwargs.get('extension_properties', None)
|
||||
self.maintenance_scope = kwargs.get('maintenance_scope', None)
|
||||
self.visibility = kwargs.get('visibility', None)
|
||||
self.install_patches = kwargs.get('install_patches', None)
|
||||
self.start_date_time = kwargs.get('start_date_time', None)
|
||||
self.expiration_date_time = kwargs.get('expiration_date_time', None)
|
||||
self.duration = kwargs.get('duration', None)
|
||||
|
@ -355,7 +460,7 @@ class MaintenanceError(msrest.serialization.Model):
|
|||
"""An error response received from the Azure Maintenance service.
|
||||
|
||||
:param error: Details of the error.
|
||||
:type error: ~maintenance_client.models.ErrorDetails
|
||||
:type error: ~maintenance_management_client.models.ErrorDetails
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -376,7 +481,7 @@ class Operation(msrest.serialization.Model):
|
|||
:param name: Name of the operation.
|
||||
:type name: str
|
||||
:param display: Display name of the operation.
|
||||
:type display: ~maintenance_client.models.OperationInfo
|
||||
:type display: ~maintenance_management_client.models.OperationInfo
|
||||
:param origin: Origin of the operation.
|
||||
:type origin: str
|
||||
:param properties: Properties of the operation.
|
||||
|
@ -440,7 +545,7 @@ class OperationsListResult(msrest.serialization.Model):
|
|||
"""Result of the List Operations operation.
|
||||
|
||||
:param value: A collection of operations.
|
||||
:type value: list[~maintenance_client.models.Operation]
|
||||
:type value: list[~maintenance_management_client.models.Operation]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -462,14 +567,14 @@ class SystemData(msrest.serialization.Model):
|
|||
:type created_by: str
|
||||
:param created_by_type: The type of identity that created the resource. Possible values
|
||||
include: "User", "Application", "ManagedIdentity", "Key".
|
||||
:type created_by_type: str or ~maintenance_client.models.CreatedByType
|
||||
:type created_by_type: str or ~maintenance_management_client.models.CreatedByType
|
||||
:param created_at: The timestamp of resource creation (UTC).
|
||||
:type created_at: ~datetime.datetime
|
||||
:param last_modified_by: The identity that last modified the resource.
|
||||
:type last_modified_by: str
|
||||
:param last_modified_by_type: The type of identity that last modified the resource. Possible
|
||||
values include: "User", "Application", "ManagedIdentity", "Key".
|
||||
:type last_modified_by_type: str or ~maintenance_client.models.CreatedByType
|
||||
:type last_modified_by_type: str or ~maintenance_management_client.models.CreatedByType
|
||||
:param last_modified_at: The timestamp of resource last modification (UTC).
|
||||
:type last_modified_at: ~datetime.datetime
|
||||
"""
|
||||
|
@ -496,18 +601,46 @@ class SystemData(msrest.serialization.Model):
|
|||
self.last_modified_at = kwargs.get('last_modified_at', None)
|
||||
|
||||
|
||||
class TaskProperties(msrest.serialization.Model):
|
||||
"""Task properties of the software update configuration.
|
||||
|
||||
:param parameters: Gets or sets the parameters of the task.
|
||||
:type parameters: dict[str, str]
|
||||
:param source: Gets or sets the name of the runbook.
|
||||
:type source: str
|
||||
:param task_scope: Global Task execute once when schedule trigger. Resource task execute for
|
||||
each VM. Possible values include: "Global", "Resource". Default value: "Global".
|
||||
:type task_scope: str or ~maintenance_management_client.models.TaskScope
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'parameters': {'key': 'parameters', 'type': '{str}'},
|
||||
'source': {'key': 'source', 'type': 'str'},
|
||||
'task_scope': {'key': 'taskScope', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
super(TaskProperties, self).__init__(**kwargs)
|
||||
self.parameters = kwargs.get('parameters', None)
|
||||
self.source = kwargs.get('source', None)
|
||||
self.task_scope = kwargs.get('task_scope', "Global")
|
||||
|
||||
|
||||
class Update(msrest.serialization.Model):
|
||||
"""Maintenance update on a resource.
|
||||
|
||||
:param maintenance_scope: The impact area. Possible values include: "Host", "OSImage",
|
||||
"Extension", "InGuestPatch", "SQLDB", "SQLManagedInstance".
|
||||
:type maintenance_scope: str or ~maintenance_client.models.MaintenanceScope
|
||||
:type maintenance_scope: str or ~maintenance_management_client.models.MaintenanceScope
|
||||
:param impact_type: The impact type. Possible values include: "None", "Freeze", "Restart",
|
||||
"Redeploy".
|
||||
:type impact_type: str or ~maintenance_client.models.ImpactType
|
||||
:type impact_type: str or ~maintenance_management_client.models.ImpactType
|
||||
:param status: The status. Possible values include: "Pending", "InProgress", "Completed",
|
||||
"RetryNow", "RetryLater".
|
||||
:type status: str or ~maintenance_client.models.UpdateStatus
|
||||
:type status: str or ~maintenance_management_client.models.UpdateStatus
|
||||
:param impact_duration_in_sec: Duration of impact in seconds.
|
||||
:type impact_duration_in_sec: int
|
||||
:param not_before: Time when Azure will start force updates if not self-updated by customer
|
||||
|
|
|
@ -12,7 +12,7 @@ from typing import Dict, List, Optional, Union
|
|||
from azure.core.exceptions import HttpResponseError
|
||||
import msrest.serialization
|
||||
|
||||
from ._maintenance_client_enums import *
|
||||
from ._maintenance_management_client_enums import *
|
||||
|
||||
|
||||
class Resource(msrest.serialization.Model):
|
||||
|
@ -28,7 +28,7 @@ class Resource(msrest.serialization.Model):
|
|||
:vartype type: str
|
||||
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
|
||||
information.
|
||||
:vartype system_data: ~maintenance_client.models.SystemData
|
||||
:vartype system_data: ~maintenance_management_client.models.SystemData
|
||||
"""
|
||||
|
||||
_validation = {
|
||||
|
@ -69,10 +69,10 @@ class ApplyUpdate(Resource):
|
|||
:vartype type: str
|
||||
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
|
||||
information.
|
||||
:vartype system_data: ~maintenance_client.models.SystemData
|
||||
:vartype system_data: ~maintenance_management_client.models.SystemData
|
||||
:param status: The status. Possible values include: "Pending", "InProgress", "Completed",
|
||||
"RetryNow", "RetryLater".
|
||||
:type status: str or ~maintenance_client.models.UpdateStatus
|
||||
:type status: str or ~maintenance_management_client.models.UpdateStatus
|
||||
:param resource_id: The resourceId.
|
||||
:type resource_id: str
|
||||
:param last_update_time: Last Update time.
|
||||
|
@ -123,7 +123,7 @@ class ConfigurationAssignment(Resource):
|
|||
:vartype type: str
|
||||
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
|
||||
information.
|
||||
:vartype system_data: ~maintenance_client.models.SystemData
|
||||
:vartype system_data: ~maintenance_management_client.models.SystemData
|
||||
:param location: Location of the resource.
|
||||
:type location: str
|
||||
:param maintenance_configuration_id: The maintenance configuration Id.
|
||||
|
@ -190,11 +190,125 @@ class ErrorDetails(msrest.serialization.Model):
|
|||
self.message = message
|
||||
|
||||
|
||||
class InputLinuxParameters(msrest.serialization.Model):
|
||||
"""Input properties for patching a Linux machine.
|
||||
|
||||
:param package_name_masks_to_exclude: Package names to be excluded for patching.
|
||||
:type package_name_masks_to_exclude: list[str]
|
||||
:param package_name_masks_to_include: Package names to be included for patching.
|
||||
:type package_name_masks_to_include: list[str]
|
||||
:param classifications_to_include: Classification category of patches to be patched.
|
||||
:type classifications_to_include: list[str]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'package_name_masks_to_exclude': {'key': 'packageNameMasksToExclude', 'type': '[str]'},
|
||||
'package_name_masks_to_include': {'key': 'packageNameMasksToInclude', 'type': '[str]'},
|
||||
'classifications_to_include': {'key': 'classificationsToInclude', 'type': '[str]'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
package_name_masks_to_exclude: Optional[List[str]] = None,
|
||||
package_name_masks_to_include: Optional[List[str]] = None,
|
||||
classifications_to_include: Optional[List[str]] = None,
|
||||
**kwargs
|
||||
):
|
||||
super(InputLinuxParameters, self).__init__(**kwargs)
|
||||
self.package_name_masks_to_exclude = package_name_masks_to_exclude
|
||||
self.package_name_masks_to_include = package_name_masks_to_include
|
||||
self.classifications_to_include = classifications_to_include
|
||||
|
||||
|
||||
class InputPatchConfiguration(msrest.serialization.Model):
|
||||
"""Input configuration for a patch run.
|
||||
|
||||
:param reboot_setting: Possible reboot preference as defined by the user based on which it
|
||||
would be decided to reboot the machine or not after the patch operation is completed. Possible
|
||||
values include: "IfRequired", "Never", "Always". Default value: "IfRequired".
|
||||
:type reboot_setting: str or ~maintenance_management_client.models.RebootOptions
|
||||
:param windows_parameters: Input parameters specific to patching a Windows machine. For Linux
|
||||
machines, do not pass this property.
|
||||
:type windows_parameters: ~maintenance_management_client.models.InputWindowsParameters
|
||||
:param linux_parameters: Input parameters specific to patching Linux machine. For Windows
|
||||
machines, do not pass this property.
|
||||
:type linux_parameters: ~maintenance_management_client.models.InputLinuxParameters
|
||||
:param pre_tasks: List of pre tasks. e.g. [{'source' :'runbook', 'taskScope': 'Global',
|
||||
'parameters': { 'arg1': 'value1'}}].
|
||||
:type pre_tasks: list[~maintenance_management_client.models.TaskProperties]
|
||||
:param post_tasks: List of post tasks. e.g. [{'source' :'runbook', 'taskScope': 'Resource',
|
||||
'parameters': { 'arg1': 'value1'}}].
|
||||
:type post_tasks: list[~maintenance_management_client.models.TaskProperties]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'reboot_setting': {'key': 'rebootSetting', 'type': 'str'},
|
||||
'windows_parameters': {'key': 'windowsParameters', 'type': 'InputWindowsParameters'},
|
||||
'linux_parameters': {'key': 'linuxParameters', 'type': 'InputLinuxParameters'},
|
||||
'pre_tasks': {'key': 'tasks.preTasks', 'type': '[TaskProperties]'},
|
||||
'post_tasks': {'key': 'tasks.postTasks', 'type': '[TaskProperties]'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
reboot_setting: Optional[Union[str, "RebootOptions"]] = "IfRequired",
|
||||
windows_parameters: Optional["InputWindowsParameters"] = None,
|
||||
linux_parameters: Optional["InputLinuxParameters"] = None,
|
||||
pre_tasks: Optional[List["TaskProperties"]] = None,
|
||||
post_tasks: Optional[List["TaskProperties"]] = None,
|
||||
**kwargs
|
||||
):
|
||||
super(InputPatchConfiguration, self).__init__(**kwargs)
|
||||
self.reboot_setting = reboot_setting
|
||||
self.windows_parameters = windows_parameters
|
||||
self.linux_parameters = linux_parameters
|
||||
self.pre_tasks = pre_tasks
|
||||
self.post_tasks = post_tasks
|
||||
|
||||
|
||||
class InputWindowsParameters(msrest.serialization.Model):
|
||||
"""Input properties for patching a Windows machine.
|
||||
|
||||
:param kb_numbers_to_exclude: Windows KBID to be excluded for patching.
|
||||
:type kb_numbers_to_exclude: list[str]
|
||||
:param kb_numbers_to_include: Windows KBID to be included for patching.
|
||||
:type kb_numbers_to_include: list[str]
|
||||
:param classifications_to_include: Classification category of patches to be patched.
|
||||
:type classifications_to_include: list[str]
|
||||
:param exclude_kbs_requiring_reboot: Exclude patches which need reboot.
|
||||
:type exclude_kbs_requiring_reboot: bool
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'kb_numbers_to_exclude': {'key': 'kbNumbersToExclude', 'type': '[str]'},
|
||||
'kb_numbers_to_include': {'key': 'kbNumbersToInclude', 'type': '[str]'},
|
||||
'classifications_to_include': {'key': 'classificationsToInclude', 'type': '[str]'},
|
||||
'exclude_kbs_requiring_reboot': {'key': 'excludeKbsRequiringReboot', 'type': 'bool'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
kb_numbers_to_exclude: Optional[List[str]] = None,
|
||||
kb_numbers_to_include: Optional[List[str]] = None,
|
||||
classifications_to_include: Optional[List[str]] = None,
|
||||
exclude_kbs_requiring_reboot: Optional[bool] = None,
|
||||
**kwargs
|
||||
):
|
||||
super(InputWindowsParameters, self).__init__(**kwargs)
|
||||
self.kb_numbers_to_exclude = kb_numbers_to_exclude
|
||||
self.kb_numbers_to_include = kb_numbers_to_include
|
||||
self.classifications_to_include = classifications_to_include
|
||||
self.exclude_kbs_requiring_reboot = exclude_kbs_requiring_reboot
|
||||
|
||||
|
||||
class ListApplyUpdate(msrest.serialization.Model):
|
||||
"""Response for ApplyUpdate list.
|
||||
|
||||
:param value: The list of apply updates.
|
||||
:type value: list[~maintenance_client.models.ApplyUpdate]
|
||||
:type value: list[~maintenance_management_client.models.ApplyUpdate]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -215,7 +329,7 @@ class ListConfigurationAssignmentsResult(msrest.serialization.Model):
|
|||
"""Response for ConfigurationAssignments list.
|
||||
|
||||
:param value: The list of configuration Assignments.
|
||||
:type value: list[~maintenance_client.models.ConfigurationAssignment]
|
||||
:type value: list[~maintenance_management_client.models.ConfigurationAssignment]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -236,7 +350,7 @@ class ListMaintenanceConfigurationsResult(msrest.serialization.Model):
|
|||
"""Response for MaintenanceConfigurations list.
|
||||
|
||||
:param value: The list of maintenance Configurations.
|
||||
:type value: list[~maintenance_client.models.MaintenanceConfiguration]
|
||||
:type value: list[~maintenance_management_client.models.MaintenanceConfiguration]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -257,7 +371,7 @@ class ListUpdatesResult(msrest.serialization.Model):
|
|||
"""Response for Updates list.
|
||||
|
||||
:param value: The pending updates.
|
||||
:type value: list[~maintenance_client.models.Update]
|
||||
:type value: list[~maintenance_management_client.models.Update]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -287,7 +401,7 @@ class MaintenanceConfiguration(Resource):
|
|||
:vartype type: str
|
||||
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
|
||||
information.
|
||||
:vartype system_data: ~maintenance_client.models.SystemData
|
||||
:vartype system_data: ~maintenance_management_client.models.SystemData
|
||||
:param location: Gets or sets location of the resource.
|
||||
:type location: str
|
||||
:param tags: A set of tags. Gets or sets tags of the resource.
|
||||
|
@ -298,10 +412,12 @@ class MaintenanceConfiguration(Resource):
|
|||
:type extension_properties: dict[str, str]
|
||||
:param maintenance_scope: Gets or sets maintenanceScope of the configuration. Possible values
|
||||
include: "Host", "OSImage", "Extension", "InGuestPatch", "SQLDB", "SQLManagedInstance".
|
||||
:type maintenance_scope: str or ~maintenance_client.models.MaintenanceScope
|
||||
:type maintenance_scope: str or ~maintenance_management_client.models.MaintenanceScope
|
||||
:param visibility: Gets or sets the visibility of the configuration. The default value is
|
||||
'Custom'. Possible values include: "Custom", "Public".
|
||||
:type visibility: str or ~maintenance_client.models.Visibility
|
||||
:type visibility: str or ~maintenance_management_client.models.Visibility
|
||||
:param install_patches: The input parameters to be passed to the patch run operation.
|
||||
:type install_patches: ~maintenance_management_client.models.InputPatchConfiguration
|
||||
:param start_date_time: Effective start date of the maintenance window in YYYY-MM-DD hh:mm
|
||||
format. The start date can be set to either the current date or future date. The window will be
|
||||
created in the time zone provided and adjusted to daylight savings according to that time zone.
|
||||
|
@ -326,9 +442,11 @@ class MaintenanceConfiguration(Resource):
|
|||
Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week
|
||||
Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma
|
||||
separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First,
|
||||
Second, Third, Fourth, Last)] [Weekday Monday-Sunday]. Monthly schedule examples are
|
||||
recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last
|
||||
Sunday, recurEvery: Month Fourth Monday.
|
||||
Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset
|
||||
value must be between -6 to 6 inclusive. Monthly schedule examples are 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.
|
||||
:type recur_every: str
|
||||
"""
|
||||
|
||||
|
@ -350,6 +468,7 @@ class MaintenanceConfiguration(Resource):
|
|||
'extension_properties': {'key': 'properties.extensionProperties', 'type': '{str}'},
|
||||
'maintenance_scope': {'key': 'properties.maintenanceScope', 'type': 'str'},
|
||||
'visibility': {'key': 'properties.visibility', 'type': 'str'},
|
||||
'install_patches': {'key': 'properties.installPatches', 'type': 'InputPatchConfiguration'},
|
||||
'start_date_time': {'key': 'properties.maintenanceWindow.startDateTime', 'type': 'str'},
|
||||
'expiration_date_time': {'key': 'properties.maintenanceWindow.expirationDateTime', 'type': 'str'},
|
||||
'duration': {'key': 'properties.maintenanceWindow.duration', 'type': 'str'},
|
||||
|
@ -366,6 +485,7 @@ class MaintenanceConfiguration(Resource):
|
|||
extension_properties: Optional[Dict[str, str]] = None,
|
||||
maintenance_scope: Optional[Union[str, "MaintenanceScope"]] = None,
|
||||
visibility: Optional[Union[str, "Visibility"]] = None,
|
||||
install_patches: Optional["InputPatchConfiguration"] = None,
|
||||
start_date_time: Optional[str] = None,
|
||||
expiration_date_time: Optional[str] = None,
|
||||
duration: Optional[str] = None,
|
||||
|
@ -380,6 +500,7 @@ class MaintenanceConfiguration(Resource):
|
|||
self.extension_properties = extension_properties
|
||||
self.maintenance_scope = maintenance_scope
|
||||
self.visibility = visibility
|
||||
self.install_patches = install_patches
|
||||
self.start_date_time = start_date_time
|
||||
self.expiration_date_time = expiration_date_time
|
||||
self.duration = duration
|
||||
|
@ -391,7 +512,7 @@ class MaintenanceError(msrest.serialization.Model):
|
|||
"""An error response received from the Azure Maintenance service.
|
||||
|
||||
:param error: Details of the error.
|
||||
:type error: ~maintenance_client.models.ErrorDetails
|
||||
:type error: ~maintenance_management_client.models.ErrorDetails
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -414,7 +535,7 @@ class Operation(msrest.serialization.Model):
|
|||
:param name: Name of the operation.
|
||||
:type name: str
|
||||
:param display: Display name of the operation.
|
||||
:type display: ~maintenance_client.models.OperationInfo
|
||||
:type display: ~maintenance_management_client.models.OperationInfo
|
||||
:param origin: Origin of the operation.
|
||||
:type origin: str
|
||||
:param properties: Properties of the operation.
|
||||
|
@ -489,7 +610,7 @@ class OperationsListResult(msrest.serialization.Model):
|
|||
"""Result of the List Operations operation.
|
||||
|
||||
:param value: A collection of operations.
|
||||
:type value: list[~maintenance_client.models.Operation]
|
||||
:type value: list[~maintenance_management_client.models.Operation]
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
|
@ -513,14 +634,14 @@ class SystemData(msrest.serialization.Model):
|
|||
:type created_by: str
|
||||
:param created_by_type: The type of identity that created the resource. Possible values
|
||||
include: "User", "Application", "ManagedIdentity", "Key".
|
||||
:type created_by_type: str or ~maintenance_client.models.CreatedByType
|
||||
:type created_by_type: str or ~maintenance_management_client.models.CreatedByType
|
||||
:param created_at: The timestamp of resource creation (UTC).
|
||||
:type created_at: ~datetime.datetime
|
||||
:param last_modified_by: The identity that last modified the resource.
|
||||
:type last_modified_by: str
|
||||
:param last_modified_by_type: The type of identity that last modified the resource. Possible
|
||||
values include: "User", "Application", "ManagedIdentity", "Key".
|
||||
:type last_modified_by_type: str or ~maintenance_client.models.CreatedByType
|
||||
:type last_modified_by_type: str or ~maintenance_management_client.models.CreatedByType
|
||||
:param last_modified_at: The timestamp of resource last modification (UTC).
|
||||
:type last_modified_at: ~datetime.datetime
|
||||
"""
|
||||
|
@ -554,18 +675,50 @@ class SystemData(msrest.serialization.Model):
|
|||
self.last_modified_at = last_modified_at
|
||||
|
||||
|
||||
class TaskProperties(msrest.serialization.Model):
|
||||
"""Task properties of the software update configuration.
|
||||
|
||||
:param parameters: Gets or sets the parameters of the task.
|
||||
:type parameters: dict[str, str]
|
||||
:param source: Gets or sets the name of the runbook.
|
||||
:type source: str
|
||||
:param task_scope: Global Task execute once when schedule trigger. Resource task execute for
|
||||
each VM. Possible values include: "Global", "Resource". Default value: "Global".
|
||||
:type task_scope: str or ~maintenance_management_client.models.TaskScope
|
||||
"""
|
||||
|
||||
_attribute_map = {
|
||||
'parameters': {'key': 'parameters', 'type': '{str}'},
|
||||
'source': {'key': 'source', 'type': 'str'},
|
||||
'task_scope': {'key': 'taskScope', 'type': 'str'},
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
parameters: Optional[Dict[str, str]] = None,
|
||||
source: Optional[str] = None,
|
||||
task_scope: Optional[Union[str, "TaskScope"]] = "Global",
|
||||
**kwargs
|
||||
):
|
||||
super(TaskProperties, self).__init__(**kwargs)
|
||||
self.parameters = parameters
|
||||
self.source = source
|
||||
self.task_scope = task_scope
|
||||
|
||||
|
||||
class Update(msrest.serialization.Model):
|
||||
"""Maintenance update on a resource.
|
||||
|
||||
:param maintenance_scope: The impact area. Possible values include: "Host", "OSImage",
|
||||
"Extension", "InGuestPatch", "SQLDB", "SQLManagedInstance".
|
||||
:type maintenance_scope: str or ~maintenance_client.models.MaintenanceScope
|
||||
:type maintenance_scope: str or ~maintenance_management_client.models.MaintenanceScope
|
||||
:param impact_type: The impact type. Possible values include: "None", "Freeze", "Restart",
|
||||
"Redeploy".
|
||||
:type impact_type: str or ~maintenance_client.models.ImpactType
|
||||
:type impact_type: str or ~maintenance_management_client.models.ImpactType
|
||||
:param status: The status. Possible values include: "Pending", "InProgress", "Completed",
|
||||
"RetryNow", "RetryLater".
|
||||
:type status: str or ~maintenance_client.models.UpdateStatus
|
||||
:type status: str or ~maintenance_management_client.models.UpdateStatus
|
||||
:param impact_duration_in_sec: Duration of impact in seconds.
|
||||
:type impact_duration_in_sec: int
|
||||
:param not_before: Time when Azure will start force updates if not self-updated by customer
|
||||
|
|
|
@ -12,6 +12,7 @@ from ._configuration_assignments_operations import ConfigurationAssignmentsOpera
|
|||
from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations
|
||||
from ._maintenance_configurations_for_resource_group_operations import MaintenanceConfigurationsForResourceGroupOperations
|
||||
from ._apply_update_for_resource_group_operations import ApplyUpdateForResourceGroupOperations
|
||||
from ._configuration_assignments_within_subscription_operations import ConfigurationAssignmentsWithinSubscriptionOperations
|
||||
from ._operations import Operations
|
||||
from ._updates_operations import UpdatesOperations
|
||||
|
||||
|
@ -22,6 +23,7 @@ __all__ = [
|
|||
'MaintenanceConfigurationsOperations',
|
||||
'MaintenanceConfigurationsForResourceGroupOperations',
|
||||
'ApplyUpdateForResourceGroupOperations',
|
||||
'ConfigurationAssignmentsWithinSubscriptionOperations',
|
||||
'Operations',
|
||||
'UpdatesOperations',
|
||||
]
|
||||
|
|
|
@ -30,7 +30,7 @@ class ApplyUpdateForResourceGroupOperations(object):
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -59,7 +59,7 @@ class ApplyUpdateForResourceGroupOperations(object):
|
|||
:type resource_group_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListApplyUpdate or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_client.models.ListApplyUpdate]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.ListApplyUpdate]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListApplyUpdate"]
|
||||
|
@ -67,7 +67,7 @@ class ApplyUpdateForResourceGroupOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -30,7 +30,7 @@ class ApplyUpdatesOperations(object):
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -77,7 +77,7 @@ class ApplyUpdatesOperations(object):
|
|||
:type apply_update_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ApplyUpdate, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ApplyUpdate
|
||||
:rtype: ~maintenance_management_client.models.ApplyUpdate
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ApplyUpdate"]
|
||||
|
@ -85,7 +85,7 @@ class ApplyUpdatesOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -153,7 +153,7 @@ class ApplyUpdatesOperations(object):
|
|||
:type apply_update_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ApplyUpdate, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ApplyUpdate
|
||||
:rtype: ~maintenance_management_client.models.ApplyUpdate
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ApplyUpdate"]
|
||||
|
@ -161,7 +161,7 @@ class ApplyUpdatesOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -230,7 +230,7 @@ class ApplyUpdatesOperations(object):
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ApplyUpdate, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ApplyUpdate
|
||||
:rtype: ~maintenance_management_client.models.ApplyUpdate
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ApplyUpdate"]
|
||||
|
@ -238,7 +238,7 @@ class ApplyUpdatesOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -302,7 +302,7 @@ class ApplyUpdatesOperations(object):
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ApplyUpdate, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ApplyUpdate
|
||||
:rtype: ~maintenance_management_client.models.ApplyUpdate
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ApplyUpdate"]
|
||||
|
@ -310,7 +310,7 @@ class ApplyUpdatesOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -360,7 +360,7 @@ class ApplyUpdatesOperations(object):
|
|||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListApplyUpdate or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_client.models.ListApplyUpdate]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.ListApplyUpdate]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListApplyUpdate"]
|
||||
|
@ -368,7 +368,7 @@ class ApplyUpdatesOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -30,7 +30,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -45,6 +45,88 @@ class ConfigurationAssignmentsOperations(object):
|
|||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
def get_parent(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
provider_name, # type: str
|
||||
resource_parent_type, # type: str
|
||||
resource_parent_name, # type: str
|
||||
resource_type, # type: str
|
||||
resource_name, # type: str
|
||||
configuration_assignment_name, # type: str
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> "models.ConfigurationAssignment"
|
||||
"""Get configuration assignment.
|
||||
|
||||
Get configuration for resource.
|
||||
|
||||
:param resource_group_name: Resource group name.
|
||||
:type resource_group_name: str
|
||||
:param provider_name: Resource provider name.
|
||||
:type provider_name: str
|
||||
:param resource_parent_type: Resource parent type.
|
||||
:type resource_parent_type: str
|
||||
:param resource_parent_name: Resource parent identifier.
|
||||
:type resource_parent_name: str
|
||||
:param resource_type: Resource type.
|
||||
:type resource_type: str
|
||||
:param resource_name: Resource identifier.
|
||||
:type resource_name: str
|
||||
:param configuration_assignment_name: Configuration assignment name.
|
||||
:type configuration_assignment_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigurationAssignment"]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
url = self.get_parent.metadata['url'] # type: ignore
|
||||
path_format_arguments = {
|
||||
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
|
||||
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
|
||||
'providerName': self._serialize.url("provider_name", provider_name, 'str'),
|
||||
'resourceParentType': self._serialize.url("resource_parent_type", resource_parent_type, 'str'),
|
||||
'resourceParentName': self._serialize.url("resource_parent_name", resource_parent_name, 'str'),
|
||||
'resourceType': self._serialize.url("resource_type", resource_type, 'str'),
|
||||
'resourceName': self._serialize.url("resource_name", resource_name, 'str'),
|
||||
'configurationAssignmentName': self._serialize.url("configuration_assignment_name", configuration_assignment_name, 'str'),
|
||||
}
|
||||
url = self._client.format_url(url, **path_format_arguments)
|
||||
|
||||
# Construct parameters
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
error = self._deserialize(models.MaintenanceError, response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize('ConfigurationAssignment', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
get_parent.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}'} # type: ignore
|
||||
|
||||
def create_or_update_parent(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
|
@ -77,10 +159,10 @@ class ConfigurationAssignmentsOperations(object):
|
|||
:param configuration_assignment_name: Configuration assignment name.
|
||||
:type configuration_assignment_name: str
|
||||
:param configuration_assignment: The configurationAssignment.
|
||||
:type configuration_assignment: ~maintenance_client.models.ConfigurationAssignment
|
||||
:type configuration_assignment: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ConfigurationAssignment
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigurationAssignment"]
|
||||
|
@ -88,7 +170,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
content_type = kwargs.pop("content_type", "application/json")
|
||||
accept = "application/json"
|
||||
|
||||
|
@ -167,7 +249,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
:type configuration_assignment_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ConfigurationAssignment or None
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment or None
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConfigurationAssignment"]]
|
||||
|
@ -175,7 +257,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -219,6 +301,80 @@ class ConfigurationAssignmentsOperations(object):
|
|||
return deserialized
|
||||
delete_parent.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}'} # type: ignore
|
||||
|
||||
def get(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
provider_name, # type: str
|
||||
resource_type, # type: str
|
||||
resource_name, # type: str
|
||||
configuration_assignment_name, # type: str
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> "models.ConfigurationAssignment"
|
||||
"""Get configuration assignment.
|
||||
|
||||
Get configuration for resource.
|
||||
|
||||
:param resource_group_name: Resource group name.
|
||||
:type resource_group_name: str
|
||||
:param provider_name: Resource provider name.
|
||||
:type provider_name: str
|
||||
:param resource_type: Resource type.
|
||||
:type resource_type: str
|
||||
:param resource_name: Resource identifier.
|
||||
:type resource_name: str
|
||||
:param configuration_assignment_name: Configuration assignment name.
|
||||
:type configuration_assignment_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigurationAssignment"]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
url = self.get.metadata['url'] # type: ignore
|
||||
path_format_arguments = {
|
||||
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
|
||||
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
|
||||
'providerName': self._serialize.url("provider_name", provider_name, 'str'),
|
||||
'resourceType': self._serialize.url("resource_type", resource_type, 'str'),
|
||||
'resourceName': self._serialize.url("resource_name", resource_name, 'str'),
|
||||
'configurationAssignmentName': self._serialize.url("configuration_assignment_name", configuration_assignment_name, 'str'),
|
||||
}
|
||||
url = self._client.format_url(url, **path_format_arguments)
|
||||
|
||||
# Construct parameters
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
error = self._deserialize(models.MaintenanceError, response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize('ConfigurationAssignment', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}'} # type: ignore
|
||||
|
||||
def create_or_update(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
|
@ -245,10 +401,10 @@ class ConfigurationAssignmentsOperations(object):
|
|||
:param configuration_assignment_name: Configuration assignment name.
|
||||
:type configuration_assignment_name: str
|
||||
:param configuration_assignment: The configurationAssignment.
|
||||
:type configuration_assignment: ~maintenance_client.models.ConfigurationAssignment
|
||||
:type configuration_assignment: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ConfigurationAssignment
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigurationAssignment"]
|
||||
|
@ -256,7 +412,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
content_type = kwargs.pop("content_type", "application/json")
|
||||
accept = "application/json"
|
||||
|
||||
|
@ -327,7 +483,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
:type configuration_assignment_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ConfigurationAssignment, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.ConfigurationAssignment or None
|
||||
:rtype: ~maintenance_management_client.models.ConfigurationAssignment or None
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConfigurationAssignment"]]
|
||||
|
@ -335,7 +491,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -406,7 +562,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListConfigurationAssignmentsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_client.models.ListConfigurationAssignmentsResult]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.ListConfigurationAssignmentsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListConfigurationAssignmentsResult"]
|
||||
|
@ -414,7 +570,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
@ -494,7 +650,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListConfigurationAssignmentsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_client.models.ListConfigurationAssignmentsResult]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.ListConfigurationAssignmentsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListConfigurationAssignmentsResult"]
|
||||
|
@ -502,7 +658,7 @@ class ConfigurationAssignmentsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
from typing import TYPE_CHECKING
|
||||
import warnings
|
||||
|
||||
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
|
||||
from azure.core.paging import ItemPaged
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpRequest, HttpResponse
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from .. import models
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
|
||||
|
||||
T = TypeVar('T')
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
class ConfigurationAssignmentsWithinSubscriptionOperations(object):
|
||||
"""ConfigurationAssignmentsWithinSubscriptionOperations operations.
|
||||
|
||||
You should not instantiate this class directly. Instead, you should create a Client instance that
|
||||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
:param deserializer: An object model deserializer.
|
||||
"""
|
||||
|
||||
models = models
|
||||
|
||||
def __init__(self, client, config, serializer, deserializer):
|
||||
self._client = client
|
||||
self._serialize = serializer
|
||||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
def list(
|
||||
self,
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> Iterable["models.ListConfigurationAssignmentsResult"]
|
||||
"""Get configuration assignment within a subscription.
|
||||
|
||||
Get configuration assignment within a subscription.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListConfigurationAssignmentsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.ListConfigurationAssignmentsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListConfigurationAssignmentsResult"]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
|
||||
|
||||
if not next_link:
|
||||
# Construct URL
|
||||
url = self.list.metadata['url'] # type: ignore
|
||||
path_format_arguments = {
|
||||
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
|
||||
}
|
||||
url = self._client.format_url(url, **path_format_arguments)
|
||||
# Construct parameters
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
else:
|
||||
url = next_link
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
return request
|
||||
|
||||
def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize('ListConfigurationAssignmentsResult', pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem)
|
||||
return None, iter(list_of_elem)
|
||||
|
||||
def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
error = self._deserialize(models.MaintenanceError, response)
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return ItemPaged(
|
||||
get_next, extract_data
|
||||
)
|
||||
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments'} # type: ignore
|
|
@ -30,7 +30,7 @@ class MaintenanceConfigurationsForResourceGroupOperations(object):
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -59,7 +59,7 @@ class MaintenanceConfigurationsForResourceGroupOperations(object):
|
|||
:type resource_group_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListMaintenanceConfigurationsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_client.models.ListMaintenanceConfigurationsResult]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.ListMaintenanceConfigurationsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListMaintenanceConfigurationsResult"]
|
||||
|
@ -67,7 +67,7 @@ class MaintenanceConfigurationsForResourceGroupOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -30,7 +30,7 @@ class MaintenanceConfigurationsOperations(object):
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -62,7 +62,7 @@ class MaintenanceConfigurationsOperations(object):
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MaintenanceConfiguration, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:rtype: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MaintenanceConfiguration"]
|
||||
|
@ -70,7 +70,7 @@ class MaintenanceConfigurationsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -124,10 +124,10 @@ class MaintenanceConfigurationsOperations(object):
|
|||
:param resource_name: Maintenance Configuration Name.
|
||||
:type resource_name: str
|
||||
:param configuration: The configuration.
|
||||
:type configuration: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:type configuration: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MaintenanceConfiguration, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:rtype: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MaintenanceConfiguration"]
|
||||
|
@ -135,7 +135,7 @@ class MaintenanceConfigurationsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
content_type = kwargs.pop("content_type", "application/json")
|
||||
accept = "application/json"
|
||||
|
||||
|
@ -194,7 +194,7 @@ class MaintenanceConfigurationsOperations(object):
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MaintenanceConfiguration, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.MaintenanceConfiguration or None
|
||||
:rtype: ~maintenance_management_client.models.MaintenanceConfiguration or None
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MaintenanceConfiguration"]]
|
||||
|
@ -202,7 +202,7 @@ class MaintenanceConfigurationsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
@ -258,10 +258,10 @@ class MaintenanceConfigurationsOperations(object):
|
|||
:param resource_name: Maintenance Configuration Name.
|
||||
:type resource_name: str
|
||||
:param configuration: The configuration.
|
||||
:type configuration: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:type configuration: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MaintenanceConfiguration, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:rtype: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MaintenanceConfiguration"]
|
||||
|
@ -269,7 +269,7 @@ class MaintenanceConfigurationsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
content_type = kwargs.pop("content_type", "application/json")
|
||||
accept = "application/json"
|
||||
|
||||
|
@ -322,7 +322,7 @@ class MaintenanceConfigurationsOperations(object):
|
|||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListMaintenanceConfigurationsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_client.models.ListMaintenanceConfigurationsResult]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.ListMaintenanceConfigurationsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListMaintenanceConfigurationsResult"]
|
||||
|
@ -330,7 +330,7 @@ class MaintenanceConfigurationsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -30,7 +30,7 @@ class Operations(object):
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -56,7 +56,7 @@ class Operations(object):
|
|||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either OperationsListResult or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_client.models.OperationsListResult]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.OperationsListResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationsListResult"]
|
||||
|
@ -64,7 +64,7 @@ class Operations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -30,7 +30,7 @@ class PublicMaintenanceConfigurationsOperations(object):
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -56,7 +56,7 @@ class PublicMaintenanceConfigurationsOperations(object):
|
|||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListMaintenanceConfigurationsResult or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_client.models.ListMaintenanceConfigurationsResult]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.ListMaintenanceConfigurationsResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListMaintenanceConfigurationsResult"]
|
||||
|
@ -64,7 +64,7 @@ class PublicMaintenanceConfigurationsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
@ -129,7 +129,7 @@ class PublicMaintenanceConfigurationsOperations(object):
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MaintenanceConfiguration, or the result of cls(response)
|
||||
:rtype: ~maintenance_client.models.MaintenanceConfiguration
|
||||
:rtype: ~maintenance_management_client.models.MaintenanceConfiguration
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MaintenanceConfiguration"]
|
||||
|
@ -137,7 +137,7 @@ class PublicMaintenanceConfigurationsOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
# Construct URL
|
||||
|
|
|
@ -30,7 +30,7 @@ class UpdatesOperations(object):
|
|||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~maintenance_client.models
|
||||
:type models: ~maintenance_management_client.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
|
@ -74,7 +74,7 @@ class UpdatesOperations(object):
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListUpdatesResult or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_client.models.ListUpdatesResult]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.ListUpdatesResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListUpdatesResult"]
|
||||
|
@ -82,7 +82,7 @@ class UpdatesOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
@ -162,7 +162,7 @@ class UpdatesOperations(object):
|
|||
:type resource_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ListUpdatesResult or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_client.models.ListUpdatesResult]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~maintenance_management_client.models.ListUpdatesResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.ListUpdatesResult"]
|
||||
|
@ -170,7 +170,7 @@ class UpdatesOperations(object):
|
|||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2021-05-01"
|
||||
api_version = "2021-09-01-preview"
|
||||
accept = "application/json"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
|
|
|
@ -9,12 +9,10 @@
|
|||
### <a name="CommandGroups">Command groups in `az maintenance` extension </a>
|
||||
|CLI Command Group|Group Swagger name|Commands|
|
||||
|---------|------------|--------|
|
||||
|az maintenance public-configuration|PublicMaintenanceConfigurations|[commands](#CommandsInPublicMaintenanceConfigurations)|
|
||||
|az maintenance applyupdate|ApplyUpdates|[commands](#CommandsInApplyUpdates)|
|
||||
|az maintenance assignment|ConfigurationAssignments|[commands](#CommandsInConfigurationAssignments)|
|
||||
|az maintenance configuration|MaintenanceConfigurations|[commands](#CommandsInMaintenanceConfigurations)|
|
||||
|az maintenance configuration-for-resource-group|MaintenanceConfigurationsForResourceGroup|[commands](#CommandsInMaintenanceConfigurationsForResourceGroup)|
|
||||
|az maintenance applyupdate-for-resource-group|ApplyUpdateForResourceGroup|[commands](#CommandsInApplyUpdateForResourceGroup)|
|
||||
|az maintenance public-configuration|PublicMaintenanceConfigurations|[commands](#CommandsInPublicMaintenanceConfigurations)|
|
||||
|az maintenance update|Updates|[commands](#CommandsInUpdates)|
|
||||
|
||||
## COMMANDS
|
||||
|
@ -23,26 +21,24 @@
|
|||
|---------|------------|--------|-----------|
|
||||
|[az maintenance applyupdate list](#ApplyUpdatesList)|List|[Parameters](#ParametersApplyUpdatesList)|[Example](#ExamplesApplyUpdatesList)|
|
||||
|[az maintenance applyupdate show](#ApplyUpdatesGet)|Get|[Parameters](#ParametersApplyUpdatesGet)|[Example](#ExamplesApplyUpdatesGet)|
|
||||
|[az maintenance applyupdate create](#ApplyUpdatesCreateOrUpdateParent)|CreateOrUpdateParent|[Parameters](#ParametersApplyUpdatesCreateOrUpdateParent)|[Example](#ExamplesApplyUpdatesCreateOrUpdateParent)|
|
||||
|[az maintenance applyupdate create](#ApplyUpdatesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersApplyUpdatesCreateOrUpdate#Create)|[Example](#ExamplesApplyUpdatesCreateOrUpdate#Create)|
|
||||
|[az maintenance applyupdate update](#ApplyUpdatesCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersApplyUpdatesCreateOrUpdate#Update)|Not Found|
|
||||
|[az maintenance applyupdate create-or-update-parent](#ApplyUpdatesCreateOrUpdateParent)|CreateOrUpdateParent|[Parameters](#ParametersApplyUpdatesCreateOrUpdateParent)|[Example](#ExamplesApplyUpdatesCreateOrUpdateParent)|
|
||||
|[az maintenance applyupdate show-parent](#ApplyUpdatesGetParent)|GetParent|[Parameters](#ParametersApplyUpdatesGetParent)|[Example](#ExamplesApplyUpdatesGetParent)|
|
||||
|
||||
### <a name="CommandsInApplyUpdateForResourceGroup">Commands in `az maintenance applyupdate-for-resource-group` group</a>
|
||||
|CLI Command|Operation Swagger name|Parameters|Examples|
|
||||
|---------|------------|--------|-----------|
|
||||
|[az maintenance applyupdate-for-resource-group list](#ApplyUpdateForResourceGroupList)|List|[Parameters](#ParametersApplyUpdateForResourceGroupList)|[Example](#ExamplesApplyUpdateForResourceGroupList)|
|
||||
|[az maintenance applyupdate get-parent](#ApplyUpdatesGetParentAlias)|GetParent|[Parameters](#ParametersApplyUpdatesGetParentAlias)|[Example](#ExamplesApplyUpdatesGetParentAlias)|
|
||||
|
||||
### <a name="CommandsInConfigurationAssignments">Commands in `az maintenance assignment` group</a>
|
||||
|CLI Command|Operation Swagger name|Parameters|Examples|
|
||||
|---------|------------|--------|-----------|
|
||||
|[az maintenance assignment list](#ConfigurationAssignmentsList)|List|[Parameters](#ParametersConfigurationAssignmentsList)|[Example](#ExamplesConfigurationAssignmentsList)|
|
||||
|[az maintenance assignment create](#ConfigurationAssignmentsCreateOrUpdateParent)|CreateOrUpdateParent|[Parameters](#ParametersConfigurationAssignmentsCreateOrUpdateParent)|[Example](#ExamplesConfigurationAssignmentsCreateOrUpdateParent)|
|
||||
|[az maintenance assignment show](#ConfigurationAssignmentsGet)|Get|[Parameters](#ParametersConfigurationAssignmentsGet)|[Example](#ExamplesConfigurationAssignmentsGet)|
|
||||
|[az maintenance assignment create](#ConfigurationAssignmentsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersConfigurationAssignmentsCreateOrUpdate#Create)|[Example](#ExamplesConfigurationAssignmentsCreateOrUpdate#Create)|
|
||||
|[az maintenance assignment update](#ConfigurationAssignmentsCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersConfigurationAssignmentsCreateOrUpdate#Update)|Not Found|
|
||||
|[az maintenance assignment delete](#ConfigurationAssignmentsDeleteParent)|DeleteParent|[Parameters](#ParametersConfigurationAssignmentsDeleteParent)|[Example](#ExamplesConfigurationAssignmentsDeleteParent)|
|
||||
|[az maintenance assignment delete](#ConfigurationAssignmentsDelete)|Delete|[Parameters](#ParametersConfigurationAssignmentsDelete)|[Example](#ExamplesConfigurationAssignmentsDelete)|
|
||||
|[az maintenance assignment create-or-update-parent](#ConfigurationAssignmentsCreateOrUpdateParent)|CreateOrUpdateParent|[Parameters](#ParametersConfigurationAssignmentsCreateOrUpdateParent)|[Example](#ExamplesConfigurationAssignmentsCreateOrUpdateParent)|
|
||||
|[az maintenance assignment delete-parent](#ConfigurationAssignmentsDeleteParent)|DeleteParent|[Parameters](#ParametersConfigurationAssignmentsDeleteParent)|[Example](#ExamplesConfigurationAssignmentsDeleteParent)|
|
||||
|[az maintenance assignment list-parent](#ConfigurationAssignmentsListParent)|ListParent|[Parameters](#ParametersConfigurationAssignmentsListParent)|[Example](#ExamplesConfigurationAssignmentsListParent)|
|
||||
|[az maintenance assignment show-parent](#ConfigurationAssignmentsGetParent)|GetParent|[Parameters](#ParametersConfigurationAssignmentsGetParent)|[Example](#ExamplesConfigurationAssignmentsGetParent)|
|
||||
|
||||
### <a name="CommandsInMaintenanceConfigurations">Commands in `az maintenance configuration` group</a>
|
||||
|CLI Command|Operation Swagger name|Parameters|Examples|
|
||||
|
@ -53,11 +49,6 @@
|
|||
|[az maintenance configuration update](#MaintenanceConfigurationsUpdate)|Update|[Parameters](#ParametersMaintenanceConfigurationsUpdate)|[Example](#ExamplesMaintenanceConfigurationsUpdate)|
|
||||
|[az maintenance configuration delete](#MaintenanceConfigurationsDelete)|Delete|[Parameters](#ParametersMaintenanceConfigurationsDelete)|[Example](#ExamplesMaintenanceConfigurationsDelete)|
|
||||
|
||||
### <a name="CommandsInMaintenanceConfigurationsForResourceGroup">Commands in `az maintenance configuration-for-resource-group` group</a>
|
||||
|CLI Command|Operation Swagger name|Parameters|Examples|
|
||||
|---------|------------|--------|-----------|
|
||||
|[az maintenance configuration-for-resource-group list](#MaintenanceConfigurationsForResourceGroupList)|List|[Parameters](#ParametersMaintenanceConfigurationsForResourceGroupList)|[Example](#ExamplesMaintenanceConfigurationsForResourceGroupList)|
|
||||
|
||||
### <a name="CommandsInPublicMaintenanceConfigurations">Commands in `az maintenance public-configuration` group</a>
|
||||
|CLI Command|Operation Swagger name|Parameters|Examples|
|
||||
|---------|------------|--------|-----------|
|
||||
|
@ -72,7 +63,6 @@
|
|||
|
||||
|
||||
## COMMAND DETAILS
|
||||
|
||||
### group `az maintenance applyupdate`
|
||||
#### <a name="ApplyUpdatesList">Command `az maintenance applyupdate list`</a>
|
||||
|
||||
|
@ -83,6 +73,7 @@ az maintenance applyupdate list
|
|||
##### <a name="ParametersApplyUpdatesList">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|
||||
#### <a name="ApplyUpdatesGet">Command `az maintenance applyupdate show`</a>
|
||||
|
||||
##### <a name="ExamplesApplyUpdatesGet">Example</a>
|
||||
|
@ -99,24 +90,6 @@ az maintenance applyupdate show --name "e9b9685d-78e4-44c4-a81c-64a14f9b87b6" --
|
|||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|**--apply-update-name**|string|applyUpdate Id|apply_update_name|applyUpdateName|
|
||||
|
||||
#### <a name="ApplyUpdatesCreateOrUpdateParent">Command `az maintenance applyupdate create`</a>
|
||||
|
||||
##### <a name="ExamplesApplyUpdatesCreateOrUpdateParent">Example</a>
|
||||
```
|
||||
az maintenance applyupdate create --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name \
|
||||
"smdvm1" --resource-parent-name "smdtest1" --resource-parent-type "virtualMachineScaleSets" --resource-type \
|
||||
"virtualMachines"
|
||||
```
|
||||
##### <a name="ParametersApplyUpdatesCreateOrUpdateParent">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource group name|resource_group_name|resourceGroupName|
|
||||
|**--provider-name**|string|Resource provider name|provider_name|providerName|
|
||||
|**--resource-parent-type**|string|Resource parent type|resource_parent_type|resourceParentType|
|
||||
|**--resource-parent-name**|string|Resource parent identifier|resource_parent_name|resourceParentName|
|
||||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|
||||
#### <a name="ApplyUpdatesCreateOrUpdate#Create">Command `az maintenance applyupdate create`</a>
|
||||
|
||||
##### <a name="ExamplesApplyUpdatesCreateOrUpdate#Create">Example</a>
|
||||
|
@ -127,8 +100,14 @@ az maintenance applyupdate create --provider-name "Microsoft.Compute" --resource
|
|||
##### <a name="ParametersApplyUpdatesCreateOrUpdate#Create">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource group name|resource_group_name|resourceGroupName|
|
||||
|**--provider-name**|string|Resource provider name|provider_name|providerName|
|
||||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|
||||
#### <a name="ApplyUpdatesCreateOrUpdate#Update">Command `az maintenance applyupdate update`</a>
|
||||
|
||||
|
||||
##### <a name="ParametersApplyUpdatesCreateOrUpdate#Update">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|
@ -137,6 +116,24 @@ az maintenance applyupdate create --provider-name "Microsoft.Compute" --resource
|
|||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|
||||
#### <a name="ApplyUpdatesCreateOrUpdateParent">Command `az maintenance applyupdate create-or-update-parent`</a>
|
||||
|
||||
##### <a name="ExamplesApplyUpdatesCreateOrUpdateParent">Example</a>
|
||||
```
|
||||
az maintenance applyupdate create-or-update-parent --provider-name "Microsoft.Compute" --resource-group "examplerg" \
|
||||
--resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type "virtualMachineScaleSets" \
|
||||
--resource-type "virtualMachines"
|
||||
```
|
||||
##### <a name="ParametersApplyUpdatesCreateOrUpdateParent">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource group name|resource_group_name|resourceGroupName|
|
||||
|**--provider-name**|string|Resource provider name|provider_name|providerName|
|
||||
|**--resource-parent-type**|string|Resource parent type|resource_parent_type|resourceParentType|
|
||||
|**--resource-parent-name**|string|Resource parent identifier|resource_parent_name|resourceParentName|
|
||||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|
||||
#### <a name="ApplyUpdatesGetParent">Command `az maintenance applyupdate show-parent`</a>
|
||||
|
||||
##### <a name="ExamplesApplyUpdatesGetParent">Example</a>
|
||||
|
@ -156,17 +153,24 @@ az maintenance applyupdate show-parent --name "e9b9685d-78e4-44c4-a81c-64a14f9b8
|
|||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|**--apply-update-name**|string|applyUpdate Id|apply_update_name|applyUpdateName|
|
||||
|
||||
### group `az maintenance applyupdate-for-resource-group`
|
||||
#### <a name="ApplyUpdateForResourceGroupList">Command `az maintenance applyupdate-for-resource-group list`</a>
|
||||
#### <a name="ApplyUpdatesGetParentAlias">Command `az maintenance applyupdate get-parent`</a>
|
||||
|
||||
##### <a name="ExamplesApplyUpdateForResourceGroupList">Example</a>
|
||||
##### <a name="ExamplesApplyUpdatesGetParentAlias">Example</a>
|
||||
```
|
||||
az maintenance applyupdate-for-resource-group list --resource-group "examplerg"
|
||||
az maintenance applyupdate get-parent --name "e9b9685d-78e4-44c4-a81c-64a14f9b87b6" --provider-name \
|
||||
"Microsoft.Compute" --resource-group "examplerg" --resource-name "smdvm1" --resource-parent-name "smdtest1" \
|
||||
--resource-parent-type "virtualMachineScaleSets" --resource-type "virtualMachines"
|
||||
```
|
||||
##### <a name="ParametersApplyUpdateForResourceGroupList">Parameters</a>
|
||||
##### <a name="ParametersApplyUpdatesGetParentAlias">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource Group Name|resource_group_name|resourceGroupName|
|
||||
|**--resource-group-name**|string|Resource group name|resource_group_name|resourceGroupName|
|
||||
|**--resource-parent-type**|string|Resource parent type|resource_parent_type|resourceParentType|
|
||||
|**--resource-parent-name**|string|Resource parent identifier|resource_parent_name|resourceParentName|
|
||||
|**--provider-name**|string|Resource provider name|provider_name|providerName|
|
||||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|**--apply-update-name**|string|applyUpdate Id|apply_update_name|applyUpdateName|
|
||||
|
||||
### group `az maintenance assignment`
|
||||
#### <a name="ConfigurationAssignmentsList">Command `az maintenance assignment list`</a>
|
||||
|
@ -184,14 +188,82 @@ az maintenance assignment list --provider-name "Microsoft.Compute" --resource-gr
|
|||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|
||||
#### <a name="ConfigurationAssignmentsCreateOrUpdateParent">Command `az maintenance assignment create`</a>
|
||||
#### <a name="ConfigurationAssignmentsGet">Command `az maintenance assignment show`</a>
|
||||
|
||||
##### <a name="ExamplesConfigurationAssignmentsGet">Example</a>
|
||||
```
|
||||
az maintenance assignment show --name "workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group \
|
||||
"examplerg" --resource-name "smdtest1" --resource-type "virtualMachineScaleSets"
|
||||
```
|
||||
##### <a name="ParametersConfigurationAssignmentsGet">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource group name|resource_group_name|resourceGroupName|
|
||||
|**--provider-name**|string|Resource provider name|provider_name|providerName|
|
||||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|**--configuration-assignment-name**|string|Configuration assignment name|configuration_assignment_name|configurationAssignmentName|
|
||||
|
||||
#### <a name="ConfigurationAssignmentsCreateOrUpdate#Create">Command `az maintenance assignment create`</a>
|
||||
|
||||
##### <a name="ExamplesConfigurationAssignmentsCreateOrUpdate#Create">Example</a>
|
||||
```
|
||||
az maintenance assignment create --maintenance-configuration-id "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/re\
|
||||
sourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1" --name \
|
||||
"workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdtest1" \
|
||||
--resource-type "virtualMachineScaleSets"
|
||||
```
|
||||
##### <a name="ParametersConfigurationAssignmentsCreateOrUpdate#Create">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource group name|resource_group_name|resourceGroupName|
|
||||
|**--provider-name**|string|Resource provider name|provider_name|providerName|
|
||||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|**--configuration-assignment-name**|string|Configuration assignment name|configuration_assignment_name|configurationAssignmentName|
|
||||
|**--location**|string|Location of the resource|location|location|
|
||||
|**--maintenance-configuration-id**|string|The maintenance configuration Id|maintenance_configuration_id|maintenanceConfigurationId|
|
||||
|**--resource-id**|string|The unique resourceId|resource_id|resourceId|
|
||||
|
||||
#### <a name="ConfigurationAssignmentsCreateOrUpdate#Update">Command `az maintenance assignment update`</a>
|
||||
|
||||
|
||||
##### <a name="ParametersConfigurationAssignmentsCreateOrUpdate#Update">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource group name|resource_group_name|resourceGroupName|
|
||||
|**--provider-name**|string|Resource provider name|provider_name|providerName|
|
||||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|**--configuration-assignment-name**|string|Configuration assignment name|configuration_assignment_name|configurationAssignmentName|
|
||||
|**--location**|string|Location of the resource|location|location|
|
||||
|**--maintenance-configuration-id**|string|The maintenance configuration Id|maintenance_configuration_id|maintenanceConfigurationId|
|
||||
|**--resource-id**|string|The unique resourceId|resource_id|resourceId|
|
||||
|
||||
#### <a name="ConfigurationAssignmentsDelete">Command `az maintenance assignment delete`</a>
|
||||
|
||||
##### <a name="ExamplesConfigurationAssignmentsDelete">Example</a>
|
||||
```
|
||||
az maintenance assignment delete --name "workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group \
|
||||
"examplerg" --resource-name "smdtest1" --resource-type "virtualMachineScaleSets"
|
||||
```
|
||||
##### <a name="ParametersConfigurationAssignmentsDelete">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource group name|resource_group_name|resourceGroupName|
|
||||
|**--provider-name**|string|Resource provider name|provider_name|providerName|
|
||||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|**--configuration-assignment-name**|string|Unique configuration assignment name|configuration_assignment_name|configurationAssignmentName|
|
||||
|
||||
#### <a name="ConfigurationAssignmentsCreateOrUpdateParent">Command `az maintenance assignment create-or-update-parent`</a>
|
||||
|
||||
##### <a name="ExamplesConfigurationAssignmentsCreateOrUpdateParent">Example</a>
|
||||
```
|
||||
az maintenance assignment create --maintenance-configuration-id "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/re\
|
||||
sourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1" --name "workervmPolicy" \
|
||||
--provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdvm1" --resource-parent-name \
|
||||
"smdtest1" --resource-parent-type "virtualMachineScaleSets" --resource-type "virtualMachines"
|
||||
az maintenance assignment create-or-update-parent --maintenance-configuration-id "/subscriptions/5b4b650e-28b9-4790-b3a\
|
||||
b-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1" --name \
|
||||
"workervmPolicy" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdvm1" \
|
||||
--resource-parent-name "smdtest1" --resource-parent-type "virtualMachineScaleSets" --resource-type "virtualMachines"
|
||||
```
|
||||
##### <a name="ParametersConfigurationAssignmentsCreateOrUpdateParent">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|
@ -207,38 +279,12 @@ sourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations
|
|||
|**--maintenance-configuration-id**|string|The maintenance configuration Id|maintenance_configuration_id|maintenanceConfigurationId|
|
||||
|**--resource-id**|string|The unique resourceId|resource_id|resourceId|
|
||||
|
||||
#### <a name="ConfigurationAssignmentsCreateOrUpdate#Create">Command `az maintenance assignment create`</a>
|
||||
|
||||
##### <a name="ExamplesConfigurationAssignmentsCreateOrUpdate#Create">Example</a>
|
||||
```
|
||||
az maintenance assignment create --maintenance-configuration-id "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/re\
|
||||
sourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1" --name \
|
||||
"workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdtest1" \
|
||||
--resource-type "virtualMachineScaleSets"
|
||||
```
|
||||
##### <a name="ParametersConfigurationAssignmentsCreateOrUpdate#Create">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
#### <a name="ConfigurationAssignmentsCreateOrUpdate#Update">Command `az maintenance assignment update`</a>
|
||||
|
||||
##### <a name="ParametersConfigurationAssignmentsCreateOrUpdate#Update">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource group name|resource_group_name|resourceGroupName|
|
||||
|**--provider-name**|string|Resource provider name|provider_name|providerName|
|
||||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|**--configuration-assignment-name**|string|Configuration assignment name|configuration_assignment_name|configurationAssignmentName|
|
||||
|**--location**|string|Location of the resource|location|location|
|
||||
|**--maintenance-configuration-id**|string|The maintenance configuration Id|maintenance_configuration_id|maintenanceConfigurationId|
|
||||
|**--resource-id**|string|The unique resourceId|resource_id|resourceId|
|
||||
|
||||
#### <a name="ConfigurationAssignmentsDeleteParent">Command `az maintenance assignment delete`</a>
|
||||
#### <a name="ConfigurationAssignmentsDeleteParent">Command `az maintenance assignment delete-parent`</a>
|
||||
|
||||
##### <a name="ExamplesConfigurationAssignmentsDeleteParent">Example</a>
|
||||
```
|
||||
az maintenance assignment delete --name "workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group \
|
||||
"examplerg" --resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type \
|
||||
az maintenance assignment delete-parent --name "workervmConfiguration" --provider-name "Microsoft.Compute" \
|
||||
--resource-group "examplerg" --resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type \
|
||||
"virtualMachineScaleSets" --resource-type "virtualMachines"
|
||||
```
|
||||
##### <a name="ParametersConfigurationAssignmentsDeleteParent">Parameters</a>
|
||||
|
@ -252,16 +298,6 @@ az maintenance assignment delete --name "workervmConfiguration" --provider-name
|
|||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|**--configuration-assignment-name**|string|Unique configuration assignment name|configuration_assignment_name|configurationAssignmentName|
|
||||
|
||||
#### <a name="ConfigurationAssignmentsDelete">Command `az maintenance assignment delete`</a>
|
||||
|
||||
##### <a name="ExamplesConfigurationAssignmentsDelete">Example</a>
|
||||
```
|
||||
az maintenance assignment delete --name "workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group \
|
||||
"examplerg" --resource-name "smdtest1" --resource-type "virtualMachineScaleSets"
|
||||
```
|
||||
##### <a name="ParametersConfigurationAssignmentsDelete">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
#### <a name="ConfigurationAssignmentsListParent">Command `az maintenance assignment list-parent`</a>
|
||||
|
||||
##### <a name="ExamplesConfigurationAssignmentsListParent">Example</a>
|
||||
|
@ -280,6 +316,25 @@ az maintenance assignment list-parent --provider-name "Microsoft.Compute" --reso
|
|||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|
||||
#### <a name="ConfigurationAssignmentsGetParent">Command `az maintenance assignment show-parent`</a>
|
||||
|
||||
##### <a name="ExamplesConfigurationAssignmentsGetParent">Example</a>
|
||||
```
|
||||
az maintenance assignment show-parent --name "workervmPolicy" --provider-name "Microsoft.Compute" --resource-group \
|
||||
"examplerg" --resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type \
|
||||
"virtualMachineScaleSets" --resource-type "virtualMachines"
|
||||
```
|
||||
##### <a name="ParametersConfigurationAssignmentsGetParent">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource group name|resource_group_name|resourceGroupName|
|
||||
|**--provider-name**|string|Resource provider name|provider_name|providerName|
|
||||
|**--resource-parent-type**|string|Resource parent type|resource_parent_type|resourceParentType|
|
||||
|**--resource-parent-name**|string|Resource parent identifier|resource_parent_name|resourceParentName|
|
||||
|**--resource-type**|string|Resource type|resource_type|resourceType|
|
||||
|**--resource-name**|string|Resource identifier|resource_name|resourceName|
|
||||
|**--configuration-assignment-name**|string|Configuration assignment name|configuration_assignment_name|configurationAssignmentName|
|
||||
|
||||
### group `az maintenance configuration`
|
||||
#### <a name="MaintenanceConfigurationsList">Command `az maintenance configuration list`</a>
|
||||
|
||||
|
@ -290,11 +345,14 @@ az maintenance configuration list
|
|||
##### <a name="ParametersMaintenanceConfigurationsList">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|
||||
#### <a name="MaintenanceConfigurationsGet">Command `az maintenance configuration show`</a>
|
||||
|
||||
##### <a name="ExamplesMaintenanceConfigurationsGet">Example</a>
|
||||
```
|
||||
az maintenance configuration show --resource-group "examplerg" --resource-name "configuration1"
|
||||
az maintenance configuration show --resource-group "examplerg" --resource-name "configuration1"
|
||||
az maintenance configuration show --resource-group "examplerg" --resource-name "configuration1"
|
||||
```
|
||||
##### <a name="ParametersMaintenanceConfigurationsGet">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|
@ -306,9 +364,9 @@ az maintenance configuration show --resource-group "examplerg" --resource-name "
|
|||
|
||||
##### <a name="ExamplesMaintenanceConfigurationsCreateOrUpdate#Create">Example</a>
|
||||
```
|
||||
az maintenance configuration create --location "westus2" --maintenance-scope "Host" --maintenance-window-duration \
|
||||
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 "2025-04-30 08:00" --maintenance-window-time-zone "Pacific Standard Time" \
|
||||
--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"
|
||||
```
|
||||
|
@ -327,15 +385,20 @@ az maintenance configuration create --location "westus2" --maintenance-scope "Ho
|
|||
|**--expiration-date-time**|string|Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59.|expiration_date_time|expirationDateTime|
|
||||
|**--duration**|string|Duration of the maintenance window in HH:mm format. If not provided, default value will be used based on maintenance scope provided. Example: 05:00.|duration|duration|
|
||||
|**--time-zone**|string|Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time.|time_zone|timeZone|
|
||||
|**--recur-every**|string|Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday]. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday.|recur_every|recurEvery|
|
||||
|**--recur-every**|string|Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are 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.|recur_every|recurEvery|
|
||||
|**--reboot-setting**|choice|Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after the patch operation is completed.|reboot_setting|rebootSetting|
|
||||
|**--windows-parameters**|object|Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property.|windows_parameters|windowsParameters|
|
||||
|**--linux-parameters**|object|Input parameters specific to patching Linux machine. For Windows machines, do not pass this property.|linux_parameters|linuxParameters|
|
||||
|**--pre-tasks**|array|List of pre tasks. e.g. [{'source' :'runbook', 'taskScope': 'Global', 'parameters': { 'arg1': 'value1'}}]|pre_tasks|preTasks|
|
||||
|**--post-tasks**|array|List of post tasks. e.g. [{'source' :'runbook', 'taskScope': 'Resource', 'parameters': { 'arg1': 'value1'}}]|post_tasks|postTasks|
|
||||
|
||||
#### <a name="MaintenanceConfigurationsUpdate">Command `az maintenance configuration update`</a>
|
||||
|
||||
##### <a name="ExamplesMaintenanceConfigurationsUpdate">Example</a>
|
||||
```
|
||||
az maintenance configuration update --location "westus2" --maintenance-scope "Host" --maintenance-window-duration \
|
||||
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 "2025-04-30 08:00" --maintenance-window-time-zone "Pacific Standard Time" \
|
||||
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"
|
||||
```
|
||||
|
@ -354,7 +417,12 @@ Sunday" --maintenance-window-start-date-time "2025-04-30 08:00" --maintenance-wi
|
|||
|**--expiration-date-time**|string|Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59.|expiration_date_time|expirationDateTime|
|
||||
|**--duration**|string|Duration of the maintenance window in HH:mm format. If not provided, default value will be used based on maintenance scope provided. Example: 05:00.|duration|duration|
|
||||
|**--time-zone**|string|Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time.|time_zone|timeZone|
|
||||
|**--recur-every**|string|Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday]. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday.|recur_every|recurEvery|
|
||||
|**--recur-every**|string|Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are 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.|recur_every|recurEvery|
|
||||
|**--reboot-setting**|choice|Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after the patch operation is completed.|reboot_setting|rebootSetting|
|
||||
|**--windows-parameters**|object|Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property.|windows_parameters|windowsParameters|
|
||||
|**--linux-parameters**|object|Input parameters specific to patching Linux machine. For Windows machines, do not pass this property.|linux_parameters|linuxParameters|
|
||||
|**--pre-tasks**|array|List of pre tasks. e.g. [{'source' :'runbook', 'taskScope': 'Global', 'parameters': { 'arg1': 'value1'}}]|pre_tasks|preTasks|
|
||||
|**--post-tasks**|array|List of post tasks. e.g. [{'source' :'runbook', 'taskScope': 'Resource', 'parameters': { 'arg1': 'value1'}}]|post_tasks|postTasks|
|
||||
|
||||
#### <a name="MaintenanceConfigurationsDelete">Command `az maintenance configuration delete`</a>
|
||||
|
||||
|
@ -368,18 +436,6 @@ az maintenance configuration delete --resource-group "examplerg" --resource-name
|
|||
|**--resource-group-name**|string|Resource Group Name|resource_group_name|resourceGroupName|
|
||||
|**--resource-name**|string|Maintenance Configuration Name|resource_name|resourceName|
|
||||
|
||||
### group `az maintenance configuration-for-resource-group`
|
||||
#### <a name="MaintenanceConfigurationsForResourceGroupList">Command `az maintenance configuration-for-resource-group list`</a>
|
||||
|
||||
##### <a name="ExamplesMaintenanceConfigurationsForResourceGroupList">Example</a>
|
||||
```
|
||||
az maintenance configuration-for-resource-group list --resource-group "examplerg"
|
||||
```
|
||||
##### <a name="ParametersMaintenanceConfigurationsForResourceGroupList">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|**--resource-group-name**|string|Resource Group Name|resource_group_name|resourceGroupName|
|
||||
|
||||
### group `az maintenance public-configuration`
|
||||
#### <a name="PublicMaintenanceConfigurationsList">Command `az maintenance public-configuration list`</a>
|
||||
|
||||
|
@ -390,6 +446,7 @@ az maintenance public-configuration list
|
|||
##### <a name="ParametersPublicMaintenanceConfigurationsList">Parameters</a>
|
||||
|Option|Type|Description|Path (SDK)|Swagger name|
|
||||
|------|----|-----------|----------|------------|
|
||||
|
||||
#### <a name="PublicMaintenanceConfigurationsGet">Command `az maintenance public-configuration show`</a>
|
||||
|
||||
##### <a name="ExamplesPublicMaintenanceConfigurationsGet">Example</a>
|
||||
|
|
|
@ -10,7 +10,7 @@ from codecs import open
|
|||
from setuptools import setup, find_packages
|
||||
|
||||
# HISTORY.rst entry.
|
||||
VERSION = '1.2.1'
|
||||
VERSION = '1.3.0'
|
||||
try:
|
||||
from azext_maintenance.manual.version import VERSION
|
||||
except ImportError:
|
||||
|
@ -45,7 +45,7 @@ with open('HISTORY.rst', 'r', encoding='utf-8') as f:
|
|||
setup(
|
||||
name='maintenance',
|
||||
version=VERSION,
|
||||
description='Microsoft Azure Command-Line Tools MaintenanceClient Extension',
|
||||
description='Microsoft Azure Command-Line Tools MaintenanceManagementClient Extension',
|
||||
author='Microsoft Corporation',
|
||||
author_email='azpycli@microsoft.com',
|
||||
url='https://github.com/Azure/azure-cli-extensions/tree/master/src/maintenance',
|
||||
|
|
Загрузка…
Ссылка в новой задаче