From 145302ebb10866c8d1ec762b8d24e4a3a83a5046 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 30 May 2018 23:11:08 +0000 Subject: [PATCH] Generated from a5af2bc46e91b4b6f6aa25408c1814532fcfc041 Reverted methods in vpn gateways. --- .../virtual_network_gateways_operations.py | 203 ++++++++++++++++++ 1 file changed, 203 insertions(+) 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 1c655555172b..9dc98a4b03e9 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 @@ -1288,6 +1288,209 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} + + def _set_vpnclient_ipsec_parameters_initial( + self, resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.set_vpnclient_ipsec_parameters.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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['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(vpnclient_ipsec_params, 'VpnClientIPsecParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('VpnClientIPsecParameters', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def set_vpnclient_ipsec_parameters( + self, resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers=None, raw=False, polling=True, **operation_config): + """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec + policy for P2S client of virtual network gateway in the specified + resource group through Network resource provider. + + :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 vpnclient_ipsec_params: Parameters supplied to the Begin Set + vpnclient ipsec parameters of Virtual Network Gateway P2S client + operation through Network resource provider. + :type vpnclient_ipsec_params: + ~azure.mgmt.network.v2018_04_01.models.VpnClientIPsecParameters + :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 + VpnClientIPsecParameters or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_04_01.models.VpnClientIPsecParameters] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_04_01.models.VpnClientIPsecParameters]] + :raises: :class:`CloudError` + """ + raw_result = self._set_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + vpnclient_ipsec_params=vpnclient_ipsec_params, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VpnClientIPsecParameters', 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) + set_vpnclient_ipsec_parameters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters'} + + + def _get_vpnclient_ipsec_parameters_initial( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get_vpnclient_ipsec_parameters.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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['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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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('VpnClientIPsecParameters', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_vpnclient_ipsec_parameters( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """The Get VpnclientIpsecParameters operation retrieves information about + the vpnclient ipsec policy for P2S client of virtual network gateway in + the specified resource group through Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The virtual network gateway name. + :type virtual_network_gateway_name: 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 + VpnClientIPsecParameters or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_04_01.models.VpnClientIPsecParameters] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_04_01.models.VpnClientIPsecParameters]] + :raises: :class:`CloudError` + """ + raw_result = self._get_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VpnClientIPsecParameters', 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) + get_vpnclient_ipsec_parameters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters'} + def vpn_device_configuration_script( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): """Gets a xml format representation for vpn device configuration script.