From 25ac9ceca29da4b62d2956599ad68652dfcf45cd Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 8 Apr 2019 17:34:53 +0000 Subject: [PATCH 1/2] Generated from fe49a589c51461bbd7f776c50812fde616d395b9 Update PR comments --- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../virtual_network_gateways_operations.py | 81 +++++--------- .../ddos_protection_plans_operations.py | 103 ++++++++++++++++++ .../virtual_network_gateways_operations.py | 81 +++++--------- .../ddos_protection_plans_operations.py | 103 ++++++++++++++++++ .../virtual_network_gateways_operations.py | 81 +++++--------- 16 files changed, 556 insertions(+), 784 deletions(-) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateways_operations.py index d2ba6681bec0..9187bf7ee88b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateways_operations.py @@ -562,7 +562,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -624,15 +624,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2017_06_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -679,58 +700,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2017_06_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateways_operations.py index d893458882aa..f5cc8a148604 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateways_operations.py @@ -562,7 +562,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -624,15 +624,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2017_08_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -679,58 +700,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2017_08_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateways_operations.py index 0c87dde489b8..03963e58daf3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateways_operations.py @@ -665,7 +665,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -727,15 +727,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2017_09_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -782,58 +803,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2017_09_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateways_operations.py index 50d9eb3ed4e4..254a7baadbec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateways_operations.py @@ -665,7 +665,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -727,15 +727,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2017_10_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -782,58 +803,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2017_10_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateways_operations.py index e601b7ba2db4..3285f0825688 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateways_operations.py @@ -665,7 +665,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -727,15 +727,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2017_11_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -782,58 +803,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2017_11_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_gateways_operations.py index 60123a18f6e9..f08d09a26661 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_gateways_operations.py @@ -665,7 +665,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -727,15 +727,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -782,58 +803,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2018_01_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/virtual_network_gateways_operations.py index 4a3bc1ae84af..417f32c29c50 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/virtual_network_gateways_operations.py @@ -665,7 +665,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -727,15 +727,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_02_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -782,58 +803,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2018_02_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/virtual_network_gateways_operations.py index aefda60ef8b4..a19e46710fa5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/virtual_network_gateways_operations.py @@ -665,7 +665,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -727,15 +727,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_04_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -782,58 +803,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2018_04_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/virtual_network_gateways_operations.py index db3c1e536e57..ded1a87e6723 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/virtual_network_gateways_operations.py @@ -746,7 +746,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -808,15 +808,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_06_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -863,58 +884,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2018_06_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/virtual_network_gateways_operations.py index 89b88f4f187f..07e9ab7f7dee 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/virtual_network_gateways_operations.py @@ -665,7 +665,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -727,15 +727,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_07_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -782,58 +803,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2018_07_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/virtual_network_gateways_operations.py index 4bf1f004652f..553538e79587 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/virtual_network_gateways_operations.py @@ -746,7 +746,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -808,15 +808,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_08_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -863,58 +884,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2018_08_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/virtual_network_gateways_operations.py index ae5b10d09692..22958e048368 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/virtual_network_gateways_operations.py @@ -746,7 +746,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -808,15 +808,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_10_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -863,58 +884,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2018_10_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/ddos_protection_plans_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/ddos_protection_plans_operations.py index 3c4c59d58bf9..023011935283 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/ddos_protection_plans_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/ddos_protection_plans_operations.py @@ -290,6 +290,109 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} + + def _update_tags_initial( + self, resource_group_name, ddos_protection_plan_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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 body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DdosProtectionPlan', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, ddos_protection_plan_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection + plan. + :type ddos_protection_plan_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DdosProtectionPlan or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlan] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlan]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DdosProtectionPlan', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} + def list( self, custom_headers=None, raw=False, **operation_config): """Gets all DDoS protection plans in a subscription. diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/virtual_network_gateways_operations.py index 0ea37bead897..db0d8b39d902 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/virtual_network_gateways_operations.py @@ -746,7 +746,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -808,15 +808,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_11_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -863,58 +884,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2018_11_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/ddos_protection_plans_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/ddos_protection_plans_operations.py index 92fabce69adf..589f0e1ab5a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/ddos_protection_plans_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/ddos_protection_plans_operations.py @@ -290,6 +290,109 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} + + def _update_tags_initial( + self, resource_group_name, ddos_protection_plan_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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 body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DdosProtectionPlan', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, ddos_protection_plan_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection + plan. + :type ddos_protection_plan_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DdosProtectionPlan or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlan] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlan]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DdosProtectionPlan', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} + def list( self, custom_headers=None, raw=False, **operation_config): """Gets all DDoS protection plans in a subscription. diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/virtual_network_gateways_operations.py index e3513fc00e68..0410850b49ac 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/virtual_network_gateways_operations.py @@ -746,7 +746,7 @@ def _generatevpnclientpackage_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -808,15 +808,36 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} - - def _generate_vpn_profile_initial( + def generate_vpn_profile( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_12_01.models.VpnClientParameters + :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: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { @@ -863,58 +884,6 @@ def _generate_vpn_profile_initial( return client_raw_response return deserialized - - def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generates VPN profile for P2S client of the virtual network gateway in - the specified resource group. Used for IKEV2 and radius based - authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network - gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network - gateway VPN client package operation. - :type parameters: - ~azure.mgmt.network.v2018_12_01.models.VpnClientParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns str or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} From b7e6af1cd970e0d42ef58859d5a831ef65e5ceee Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Mon, 8 Apr 2019 17:38:24 +0000 Subject: [PATCH 2/2] Packaging update of azure-mgmt-network --- azure-mgmt-network/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-mgmt-network/setup.py b/azure-mgmt-network/setup.py index 90b9416272f1..7e60b0cc00cb 100644 --- a/azure-mgmt-network/setup.py +++ b/azure-mgmt-network/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com',