diff --git a/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request.py b/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request.py index 0fe0f903f66d..42d5ae80a25e 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request.py @@ -36,6 +36,9 @@ class DeletedAppRestoreRequest(ProxyOnlyResource): formatted as a DateTime string. If unspecified, default value is the time that the app was deleted. :type snapshot_time: str + :param use_dr_secondary: If true, the snapshot is retrieved from + DRSecondary endpoint. + :type use_dr_secondary: bool """ _validation = { @@ -52,6 +55,7 @@ class DeletedAppRestoreRequest(ProxyOnlyResource): 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'str'}, 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -59,3 +63,4 @@ def __init__(self, **kwargs): self.deleted_site_id = kwargs.get('deleted_site_id', None) self.recover_configuration = kwargs.get('recover_configuration', None) self.snapshot_time = kwargs.get('snapshot_time', None) + self.use_dr_secondary = kwargs.get('use_dr_secondary', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request_py3.py index 69ca457e864b..3216b8c3056f 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deleted_app_restore_request_py3.py @@ -36,6 +36,9 @@ class DeletedAppRestoreRequest(ProxyOnlyResource): formatted as a DateTime string. If unspecified, default value is the time that the app was deleted. :type snapshot_time: str + :param use_dr_secondary: If true, the snapshot is retrieved from + DRSecondary endpoint. + :type use_dr_secondary: bool """ _validation = { @@ -52,10 +55,12 @@ class DeletedAppRestoreRequest(ProxyOnlyResource): 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'str'}, 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, } - def __init__(self, *, kind: str=None, deleted_site_id: str=None, recover_configuration: bool=None, snapshot_time: str=None, **kwargs) -> None: + def __init__(self, *, kind: str=None, deleted_site_id: str=None, recover_configuration: bool=None, snapshot_time: str=None, use_dr_secondary: bool=None, **kwargs) -> None: super(DeletedAppRestoreRequest, self).__init__(kind=kind, **kwargs) self.deleted_site_id = deleted_site_id self.recover_configuration = recover_configuration self.snapshot_time = snapshot_time + self.use_dr_secondary = use_dr_secondary diff --git a/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py b/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py index cab4d170ab91..988f07e40f40 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deleted_site.py @@ -40,6 +40,8 @@ class DeletedSite(ProxyOnlyResource): :vartype slot: str :ivar deleted_site_kind: Kind of site that was deleted :vartype deleted_site_kind: str + :ivar geo_region_name: Geo Region of the deleted site + :vartype geo_region_name: str """ _validation = { @@ -53,6 +55,7 @@ class DeletedSite(ProxyOnlyResource): 'deleted_site_name': {'readonly': True}, 'slot': {'readonly': True}, 'deleted_site_kind': {'readonly': True}, + 'geo_region_name': {'readonly': True}, } _attribute_map = { @@ -67,6 +70,7 @@ class DeletedSite(ProxyOnlyResource): 'deleted_site_name': {'key': 'properties.deletedSiteName', 'type': 'str'}, 'slot': {'key': 'properties.slot', 'type': 'str'}, 'deleted_site_kind': {'key': 'properties.kind', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.geoRegionName', 'type': 'str'}, } def __init__(self, **kwargs): @@ -78,3 +82,4 @@ def __init__(self, **kwargs): self.deleted_site_name = None self.slot = None self.deleted_site_kind = None + self.geo_region_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py b/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py index 85152fdd18f8..91ceedb6c2cd 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/deleted_site_py3.py @@ -40,6 +40,8 @@ class DeletedSite(ProxyOnlyResource): :vartype slot: str :ivar deleted_site_kind: Kind of site that was deleted :vartype deleted_site_kind: str + :ivar geo_region_name: Geo Region of the deleted site + :vartype geo_region_name: str """ _validation = { @@ -53,6 +55,7 @@ class DeletedSite(ProxyOnlyResource): 'deleted_site_name': {'readonly': True}, 'slot': {'readonly': True}, 'deleted_site_kind': {'readonly': True}, + 'geo_region_name': {'readonly': True}, } _attribute_map = { @@ -67,6 +70,7 @@ class DeletedSite(ProxyOnlyResource): 'deleted_site_name': {'key': 'properties.deletedSiteName', 'type': 'str'}, 'slot': {'key': 'properties.slot', 'type': 'str'}, 'deleted_site_kind': {'key': 'properties.kind', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.geoRegionName', 'type': 'str'}, } def __init__(self, *, kind: str=None, **kwargs) -> None: @@ -78,3 +82,4 @@ def __init__(self, *, kind: str=None, **kwargs) -> None: self.deleted_site_name = None self.slot = None self.deleted_site_kind = None + self.geo_region_name = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request.py b/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request.py index ef65405d81ab..7924152d75a8 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request.py +++ b/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request.py @@ -45,6 +45,9 @@ class SnapshotRestoreRequest(ProxyOnlyResource): will be ignored when recovering to a target web app. This setting is only necessary when RecoverConfiguration is enabled. :type ignore_conflicting_host_names: bool + :param use_dr_secondary: If true, the snapshot is retrieved from + DRSecondary endpoint. + :type use_dr_secondary: bool """ _validation = { @@ -64,6 +67,7 @@ class SnapshotRestoreRequest(ProxyOnlyResource): 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -73,3 +77,4 @@ def __init__(self, **kwargs): self.overwrite = kwargs.get('overwrite', None) self.recover_configuration = kwargs.get('recover_configuration', None) self.ignore_conflicting_host_names = kwargs.get('ignore_conflicting_host_names', None) + self.use_dr_secondary = kwargs.get('use_dr_secondary', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request_py3.py b/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request_py3.py index e32f278bc028..2d6c5ca1dcd5 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/snapshot_restore_request_py3.py @@ -45,6 +45,9 @@ class SnapshotRestoreRequest(ProxyOnlyResource): will be ignored when recovering to a target web app. This setting is only necessary when RecoverConfiguration is enabled. :type ignore_conflicting_host_names: bool + :param use_dr_secondary: If true, the snapshot is retrieved from + DRSecondary endpoint. + :type use_dr_secondary: bool """ _validation = { @@ -64,12 +67,14 @@ class SnapshotRestoreRequest(ProxyOnlyResource): 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, } - def __init__(self, *, overwrite: bool, kind: str=None, snapshot_time: str=None, recovery_source=None, recover_configuration: bool=None, ignore_conflicting_host_names: bool=None, **kwargs) -> None: + def __init__(self, *, overwrite: bool, kind: str=None, snapshot_time: str=None, recovery_source=None, recover_configuration: bool=None, ignore_conflicting_host_names: bool=None, use_dr_secondary: bool=None, **kwargs) -> None: super(SnapshotRestoreRequest, self).__init__(kind=kind, **kwargs) self.snapshot_time = snapshot_time self.recovery_source = recovery_source self.overwrite = overwrite self.recover_configuration = recover_configuration self.ignore_conflicting_host_names = ignore_conflicting_host_names + self.use_dr_secondary = use_dr_secondary diff --git a/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py index 3db347f680c8..cb0f9881730f 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py @@ -21508,6 +21508,81 @@ def internal_paging(next_link=None, raw=False): return deserialized list_snapshots_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'} + def list_snapshots_from_dr_secondary_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Returns all Snapshots to the user from DRSecondary endpoint. + + Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: 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: An iterator like instance of Snapshot + :rtype: + ~azure.mgmt.web.models.SnapshotPaged[~azure.mgmt.web.models.Snapshot] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary_slot.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + '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) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SnapshotPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SnapshotPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_snapshots_from_dr_secondary_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr'} + def get_source_control_slot( self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): """Gets the source control configuration of an app. @@ -23776,6 +23851,78 @@ def internal_paging(next_link=None, raw=False): return deserialized list_snapshots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'} + def list_snapshots_from_dr_secondary( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Returns all Snapshots to the user from DRSecondary endpoint. + + Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type 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: An iterator like instance of Snapshot + :rtype: + ~azure.mgmt.web.models.SnapshotPaged[~azure.mgmt.web.models.Snapshot] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + '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) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SnapshotPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SnapshotPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_snapshots_from_dr_secondary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr'} + def get_source_control( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Gets the source control configuration of an app.