diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_maintenance_management_client.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_maintenance_management_client.py index feb0c58cf1af..a460dd7cccae 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_maintenance_management_client.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/_maintenance_management_client.py @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from ._configuration import MaintenanceManagementClientConfiguration +from .operations import PublicMaintenanceConfigurationsOperations from .operations import ApplyUpdatesOperations from .operations import ConfigurationAssignmentsOperations from .operations import MaintenanceConfigurationsOperations @@ -27,6 +28,8 @@ class MaintenanceManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: MaintenanceManagementClientConfiguration + :ivar public_maintenance_configurations: PublicMaintenanceConfigurations operations + :vartype public_maintenance_configurations: azure.mgmt.maintenance.operations.PublicMaintenanceConfigurationsOperations :ivar apply_updates: ApplyUpdates operations :vartype apply_updates: azure.mgmt.maintenance.operations.ApplyUpdatesOperations :ivar configuration_assignments: ConfigurationAssignments operations @@ -55,10 +58,12 @@ def __init__( super(MaintenanceManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-06-01-preview' + self.api_version = '2020-07-01-preview' 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( diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/__init__.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/__init__.py index ff81da3b1a0c..2f030072046c 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/__init__.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/__init__.py @@ -36,6 +36,7 @@ from ._maintenance_management_client_enums import ( UpdateStatus, MaintenanceScope, + Visibility, ImpactType, ) @@ -49,11 +50,12 @@ 'OperationInfo', 'Resource', 'Update', - 'ConfigurationAssignmentPaged', 'MaintenanceConfigurationPaged', + 'ConfigurationAssignmentPaged', 'OperationPaged', 'UpdatePaged', 'UpdateStatus', 'MaintenanceScope', + 'Visibility', 'ImpactType', ] diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_maintenance_management_client_enums.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_maintenance_management_client_enums.py index 83ce8e7ded5f..3321758a507e 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_maintenance_management_client_enums.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_maintenance_management_client_enums.py @@ -27,6 +27,17 @@ class MaintenanceScope(str, Enum): host = "Host" resource = "Resource" in_resource = "InResource" + os_image = "OSImage" + extension = "Extension" + in_guest_patch = "InGuestPatch" + sqldb = "SQLDB" + sql_managed_instance = "SQLManagedInstance" + + +class Visibility(str, Enum): + + custom = "Custom" + public = "Public" class ImpactType(str, Enum): diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models.py index 0dba7759bcf7..c9592dc57d7a 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models.py @@ -183,9 +183,48 @@ class MaintenanceConfiguration(Resource): :type extension_properties: dict[str, str] :param maintenance_scope: Gets or sets maintenanceScope of the configuration. Possible values include: 'All', 'Host', 'Resource', - 'InResource' + 'InResource', 'OSImage', 'Extension', 'InGuestPatch', 'SQLDB', + 'SQLManagedInstance' :type maintenance_scope: str or ~azure.mgmt.maintenance.models.MaintenanceScope + :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. + :type start_date_time: str + :param expiration_date_time: 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. + :type expiration_date_time: str + :param duration: 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. + :type duration: str + :param time_zone: 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. + :type time_zone: str + :param recur_every: 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. + :type recur_every: str + :param visibility: Gets or sets the visibility of the configuration. + Possible values include: 'Custom', 'Public' + :type visibility: str or ~azure.mgmt.maintenance.models.Visibility """ _validation = { @@ -203,6 +242,12 @@ class MaintenanceConfiguration(Resource): 'namespace': {'key': 'properties.namespace', 'type': 'str'}, 'extension_properties': {'key': 'properties.extensionProperties', 'type': '{str}'}, 'maintenance_scope': {'key': 'properties.maintenanceScope', 'type': 'str'}, + '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'}, + 'time_zone': {'key': 'properties.maintenanceWindow.timeZone', 'type': 'str'}, + 'recur_every': {'key': 'properties.maintenanceWindow.recurEvery', 'type': 'str'}, + 'visibility': {'key': 'properties.visibility', 'type': 'str'}, } def __init__(self, **kwargs): @@ -212,6 +257,12 @@ def __init__(self, **kwargs): self.namespace = kwargs.get('namespace', None) self.extension_properties = kwargs.get('extension_properties', None) self.maintenance_scope = kwargs.get('maintenance_scope', 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) + self.time_zone = kwargs.get('time_zone', None) + self.recur_every = kwargs.get('recur_every', None) + self.visibility = kwargs.get('visibility', None) class MaintenanceError(Model): @@ -302,7 +353,8 @@ class Update(Model): """Maintenance update on a resource. :param maintenance_scope: The impact area. Possible values include: 'All', - 'Host', 'Resource', 'InResource' + 'Host', 'Resource', 'InResource', 'OSImage', 'Extension', 'InGuestPatch', + 'SQLDB', 'SQLManagedInstance' :type maintenance_scope: str or ~azure.mgmt.maintenance.models.MaintenanceScope :param impact_type: The impact type. Possible values include: 'None', diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models_py3.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models_py3.py index a87624b67e6f..d8833a39e5ab 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models_py3.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_models_py3.py @@ -183,9 +183,48 @@ class MaintenanceConfiguration(Resource): :type extension_properties: dict[str, str] :param maintenance_scope: Gets or sets maintenanceScope of the configuration. Possible values include: 'All', 'Host', 'Resource', - 'InResource' + 'InResource', 'OSImage', 'Extension', 'InGuestPatch', 'SQLDB', + 'SQLManagedInstance' :type maintenance_scope: str or ~azure.mgmt.maintenance.models.MaintenanceScope + :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. + :type start_date_time: str + :param expiration_date_time: 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. + :type expiration_date_time: str + :param duration: 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. + :type duration: str + :param time_zone: 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. + :type time_zone: str + :param recur_every: 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. + :type recur_every: str + :param visibility: Gets or sets the visibility of the configuration. + Possible values include: 'Custom', 'Public' + :type visibility: str or ~azure.mgmt.maintenance.models.Visibility """ _validation = { @@ -203,15 +242,27 @@ class MaintenanceConfiguration(Resource): 'namespace': {'key': 'properties.namespace', 'type': 'str'}, 'extension_properties': {'key': 'properties.extensionProperties', 'type': '{str}'}, 'maintenance_scope': {'key': 'properties.maintenanceScope', 'type': 'str'}, + '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'}, + 'time_zone': {'key': 'properties.maintenanceWindow.timeZone', 'type': 'str'}, + 'recur_every': {'key': 'properties.maintenanceWindow.recurEvery', 'type': 'str'}, + 'visibility': {'key': 'properties.visibility', 'type': 'str'}, } - def __init__(self, *, location: str=None, tags=None, namespace: str=None, extension_properties=None, maintenance_scope=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, namespace: str=None, extension_properties=None, maintenance_scope=None, start_date_time: str=None, expiration_date_time: str=None, duration: str=None, time_zone: str=None, recur_every: str=None, visibility=None, **kwargs) -> None: super(MaintenanceConfiguration, self).__init__(**kwargs) self.location = location self.tags = tags self.namespace = namespace self.extension_properties = extension_properties self.maintenance_scope = maintenance_scope + self.start_date_time = start_date_time + self.expiration_date_time = expiration_date_time + self.duration = duration + self.time_zone = time_zone + self.recur_every = recur_every + self.visibility = visibility class MaintenanceError(Model): @@ -302,7 +353,8 @@ class Update(Model): """Maintenance update on a resource. :param maintenance_scope: The impact area. Possible values include: 'All', - 'Host', 'Resource', 'InResource' + 'Host', 'Resource', 'InResource', 'OSImage', 'Extension', 'InGuestPatch', + 'SQLDB', 'SQLManagedInstance' :type maintenance_scope: str or ~azure.mgmt.maintenance.models.MaintenanceScope :param impact_type: The impact type. Possible values include: 'None', diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_paged_models.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_paged_models.py index 45d6a08e3c6d..c35ef77ccfdc 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_paged_models.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/models/_paged_models.py @@ -12,32 +12,32 @@ from msrest.paging import Paged -class ConfigurationAssignmentPaged(Paged): +class MaintenanceConfigurationPaged(Paged): """ - A paging container for iterating over a list of :class:`ConfigurationAssignment ` object + A paging container for iterating over a list of :class:`MaintenanceConfiguration ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ConfigurationAssignment]'} + 'current_page': {'key': 'value', 'type': '[MaintenanceConfiguration]'} } def __init__(self, *args, **kwargs): - super(ConfigurationAssignmentPaged, self).__init__(*args, **kwargs) -class MaintenanceConfigurationPaged(Paged): + super(MaintenanceConfigurationPaged, self).__init__(*args, **kwargs) +class ConfigurationAssignmentPaged(Paged): """ - A paging container for iterating over a list of :class:`MaintenanceConfiguration ` object + A paging container for iterating over a list of :class:`ConfigurationAssignment ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[MaintenanceConfiguration]'} + 'current_page': {'key': 'value', 'type': '[ConfigurationAssignment]'} } def __init__(self, *args, **kwargs): - super(MaintenanceConfigurationPaged, self).__init__(*args, **kwargs) + super(ConfigurationAssignmentPaged, self).__init__(*args, **kwargs) class OperationPaged(Paged): """ A paging container for iterating over a list of :class:`Operation ` object diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/__init__.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/__init__.py index 85b97ca76a15..34904c3d3228 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/__init__.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/__init__.py @@ -9,6 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- +from ._public_maintenance_configurations_operations import PublicMaintenanceConfigurationsOperations from ._apply_updates_operations import ApplyUpdatesOperations from ._configuration_assignments_operations import ConfigurationAssignmentsOperations from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations @@ -16,6 +17,7 @@ from ._updates_operations import UpdatesOperations __all__ = [ + 'PublicMaintenanceConfigurationsOperations', 'ApplyUpdatesOperations', 'ConfigurationAssignmentsOperations', 'MaintenanceConfigurationsOperations', diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_apply_updates_operations.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_apply_updates_operations.py index 272cc2b447f8..4a27b95cb207 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_apply_updates_operations.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_apply_updates_operations.py @@ -25,7 +25,7 @@ class ApplyUpdatesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-06-01-preview". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-07-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2020-07-01-preview" self.config = config diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_configuration_assignments_operations.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_configuration_assignments_operations.py index 489a8991644a..cd82c1c50194 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_configuration_assignments_operations.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_configuration_assignments_operations.py @@ -25,7 +25,7 @@ class ConfigurationAssignmentsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-06-01-preview". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-07-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2020-07-01-preview" self.config = config diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_maintenance_configurations_operations.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_maintenance_configurations_operations.py index 29b3618e634a..7bf8ea1e8454 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_maintenance_configurations_operations.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_maintenance_configurations_operations.py @@ -24,7 +24,7 @@ class MaintenanceConfigurationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-06-01-preview". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-07-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2020-07-01-preview" self.config = config diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_operations.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_operations.py index 84c26550f29a..d59274d92039 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_operations.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_operations.py @@ -24,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-06-01-preview". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-07-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2020-07-01-preview" self.config = config diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_public_maintenance_configurations_operations.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_public_maintenance_configurations_operations.py new file mode 100644 index 000000000000..2a8e81f14087 --- /dev/null +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_public_maintenance_configurations_operations.py @@ -0,0 +1,161 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PublicMaintenanceConfigurationsOperations(object): + """PublicMaintenanceConfigurationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get Public Maintenance Configuration records. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of MaintenanceConfiguration + :rtype: + ~azure.mgmt.maintenance.models.MaintenanceConfigurationPaged[~azure.mgmt.maintenance.models.MaintenanceConfiguration] + :raises: + :class:`MaintenanceErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.MaintenanceErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.MaintenanceConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations'} + + def get( + self, resource_name, custom_headers=None, raw=False, **operation_config): + """Get Public Maintenance Configuration record. + + :param resource_name: Resource Identifier + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: MaintenanceConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.maintenance.models.MaintenanceConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`MaintenanceErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.MaintenanceErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MaintenanceConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/{resourceName}'} diff --git a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_updates_operations.py b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_updates_operations.py index e9a8eecb77c2..116cdbf2ca35 100644 --- a/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_updates_operations.py +++ b/sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_updates_operations.py @@ -25,7 +25,7 @@ class UpdatesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-06-01-preview". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2020-07-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2020-07-01-preview" self.config = config