From 59d94d121cb698dd726a8d13fd7f81ec34c158cb Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 15 Apr 2019 10:15:23 -0700 Subject: [PATCH] Generated from e30338eb768cedebd77c024fe290d5c91af7397b (#4852) fix api version --- .../network/v2019_02_01/models/__init__.py | 16 ++- ...cation_gateway_backend_health_on_demand.py | 36 ++++++ ...on_gateway_backend_health_on_demand_py3.py | 36 ++++++ .../application_gateway_on_demand_probe.py | 65 +++++++++++ ...application_gateway_on_demand_probe_py3.py | 65 +++++++++++ .../models/network_management_client_enums.py | 12 +- .../application_gateways_operations.py | 110 ++++++++++++++++++ 7 files changed, 329 insertions(+), 11 deletions(-) create mode 100644 azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_backend_health_on_demand.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_backend_health_on_demand_py3.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_on_demand_probe.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_on_demand_probe_py3.py diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/__init__.py index 5e02d5873d65..0241400094fe 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/__init__.py @@ -10,6 +10,8 @@ # -------------------------------------------------------------------------- try: + from .application_gateway_probe_health_response_match_py3 import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_on_demand_probe_py3 import ApplicationGatewayOnDemandProbe from .network_interface_tap_configuration_py3 import NetworkInterfaceTapConfiguration from .sub_resource_py3 import SubResource from .application_security_group_py3 import ApplicationSecurityGroup @@ -46,6 +48,7 @@ from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings from .application_gateway_backend_health_server_py3 import ApplicationGatewayBackendHealthServer from .application_gateway_backend_health_http_settings_py3 import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_on_demand_py3 import ApplicationGatewayBackendHealthOnDemand from .application_gateway_backend_health_pool_py3 import ApplicationGatewayBackendHealthPool from .application_gateway_backend_health_py3 import ApplicationGatewayBackendHealth from .application_gateway_sku_py3 import ApplicationGatewaySku @@ -59,7 +62,6 @@ from .application_gateway_custom_error_py3 import ApplicationGatewayCustomError from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule - from .application_gateway_probe_health_response_match_py3 import ApplicationGatewayProbeHealthResponseMatch from .application_gateway_probe_py3 import ApplicationGatewayProbe from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule from .application_gateway_rewrite_rule_condition_py3 import ApplicationGatewayRewriteRuleCondition @@ -305,6 +307,8 @@ from .web_application_firewall_custom_rule_py3 import WebApplicationFirewallCustomRule from .web_application_firewall_policy_py3 import WebApplicationFirewallPolicy except (SyntaxError, ImportError): + from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_on_demand_probe import ApplicationGatewayOnDemandProbe from .network_interface_tap_configuration import NetworkInterfaceTapConfiguration from .sub_resource import SubResource from .application_security_group import ApplicationSecurityGroup @@ -341,6 +345,7 @@ from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_on_demand import ApplicationGatewayBackendHealthOnDemand from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool from .application_gateway_backend_health import ApplicationGatewayBackendHealth from .application_gateway_sku import ApplicationGatewaySku @@ -354,7 +359,6 @@ from .application_gateway_custom_error import ApplicationGatewayCustomError from .application_gateway_http_listener import ApplicationGatewayHttpListener from .application_gateway_path_rule import ApplicationGatewayPathRule - from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch from .application_gateway_probe import ApplicationGatewayProbe from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule from .application_gateway_rewrite_rule_condition import ApplicationGatewayRewriteRuleCondition @@ -666,6 +670,7 @@ from .p2_svpn_gateway_paged import P2SVpnGatewayPaged from .web_application_firewall_policy_paged import WebApplicationFirewallPolicyPaged from .network_management_client_enums import ( + ApplicationGatewayProtocol, IPAllocationMethod, SecurityRuleProtocol, SecurityRuleAccess, @@ -675,7 +680,6 @@ IPVersion, DdosSettingsProtectionCoverage, TransportProtocol, - ApplicationGatewayProtocol, ApplicationGatewayCookieBasedAffinity, ApplicationGatewayBackendHealthServerHealth, ApplicationGatewaySkuName, @@ -774,6 +778,8 @@ ) __all__ = [ + 'ApplicationGatewayProbeHealthResponseMatch', + 'ApplicationGatewayOnDemandProbe', 'NetworkInterfaceTapConfiguration', 'SubResource', 'ApplicationSecurityGroup', @@ -810,6 +816,7 @@ 'ApplicationGatewayBackendHttpSettings', 'ApplicationGatewayBackendHealthServer', 'ApplicationGatewayBackendHealthHttpSettings', + 'ApplicationGatewayBackendHealthOnDemand', 'ApplicationGatewayBackendHealthPool', 'ApplicationGatewayBackendHealth', 'ApplicationGatewaySku', @@ -823,7 +830,6 @@ 'ApplicationGatewayCustomError', 'ApplicationGatewayHttpListener', 'ApplicationGatewayPathRule', - 'ApplicationGatewayProbeHealthResponseMatch', 'ApplicationGatewayProbe', 'ApplicationGatewayRequestRoutingRule', 'ApplicationGatewayRewriteRuleCondition', @@ -1134,6 +1140,7 @@ 'P2SVpnServerConfigurationPaged', 'P2SVpnGatewayPaged', 'WebApplicationFirewallPolicyPaged', + 'ApplicationGatewayProtocol', 'IPAllocationMethod', 'SecurityRuleProtocol', 'SecurityRuleAccess', @@ -1143,7 +1150,6 @@ 'IPVersion', 'DdosSettingsProtectionCoverage', 'TransportProtocol', - 'ApplicationGatewayProtocol', 'ApplicationGatewayCookieBasedAffinity', 'ApplicationGatewayBackendHealthServerHealth', 'ApplicationGatewaySkuName', diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_backend_health_on_demand.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_backend_health_on_demand.py new file mode 100644 index 000000000000..3192a6cf6a11 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_backend_health_on_demand.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthOnDemand(Model): + """Result of on demand test probe. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayBackendAddressPool + :param backend_health_http_settings: Application gateway BackendHealthHttp + settings. + :type backend_health_http_settings: + ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayBackendHealthHttpSettings + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_health_http_settings': {'key': 'backendHealthHttpSettings', 'type': 'ApplicationGatewayBackendHealthHttpSettings'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthOnDemand, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_health_http_settings = kwargs.get('backend_health_http_settings', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_backend_health_on_demand_py3.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_backend_health_on_demand_py3.py new file mode 100644 index 000000000000..e5c4810b342e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_backend_health_on_demand_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthOnDemand(Model): + """Result of on demand test probe. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayBackendAddressPool + :param backend_health_http_settings: Application gateway BackendHealthHttp + settings. + :type backend_health_http_settings: + ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayBackendHealthHttpSettings + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_health_http_settings': {'key': 'backendHealthHttpSettings', 'type': 'ApplicationGatewayBackendHealthHttpSettings'}, + } + + def __init__(self, *, backend_address_pool=None, backend_health_http_settings=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthOnDemand, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_health_http_settings = backend_health_http_settings diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_on_demand_probe.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_on_demand_probe.py new file mode 100644 index 000000000000..d71363055bdd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_on_demand_probe.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayOnDemandProbe(Model): + """Details of on demand test probe request. + + :param protocol: The protocol used for the probe. Possible values are + 'Http' and 'Https'. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param timeout: The probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param pick_host_name_from_backend_http_settings: Whether the host header + should be picked from the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param match: Criterion for classifying a healthy probe response. + :type match: + ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayProbeHealthResponseMatch + :param backend_pool_name: Name of backend pool of application gateway to + which probe request will be sent. + :type backend_pool_name: str + :param backend_http_setting_name: Name of backend http setting of + application gateway to be used for test probe + :type backend_http_setting_name: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'match': {'key': 'match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'backend_pool_name': {'key': 'backendPoolName', 'type': 'str'}, + 'backend_http_setting_name': {'key': 'backendHttpSettingName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayOnDemandProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.timeout = kwargs.get('timeout', None) + self.pick_host_name_from_backend_http_settings = kwargs.get('pick_host_name_from_backend_http_settings', None) + self.match = kwargs.get('match', None) + self.backend_pool_name = kwargs.get('backend_pool_name', None) + self.backend_http_setting_name = kwargs.get('backend_http_setting_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_on_demand_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_on_demand_probe_py3.py new file mode 100644 index 000000000000..424baaa1bc1d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_on_demand_probe_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayOnDemandProbe(Model): + """Details of on demand test probe request. + + :param protocol: The protocol used for the probe. Possible values are + 'Http' and 'Https'. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param timeout: The probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param pick_host_name_from_backend_http_settings: Whether the host header + should be picked from the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param match: Criterion for classifying a healthy probe response. + :type match: + ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayProbeHealthResponseMatch + :param backend_pool_name: Name of backend pool of application gateway to + which probe request will be sent. + :type backend_pool_name: str + :param backend_http_setting_name: Name of backend http setting of + application gateway to be used for test probe + :type backend_http_setting_name: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'match': {'key': 'match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'backend_pool_name': {'key': 'backendPoolName', 'type': 'str'}, + 'backend_http_setting_name': {'key': 'backendHttpSettingName', 'type': 'str'}, + } + + def __init__(self, *, protocol=None, host: str=None, path: str=None, timeout: int=None, pick_host_name_from_backend_http_settings: bool=None, match=None, backend_pool_name: str=None, backend_http_setting_name: str=None, **kwargs) -> None: + super(ApplicationGatewayOnDemandProbe, self).__init__(**kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.timeout = timeout + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.match = match + self.backend_pool_name = backend_pool_name + self.backend_http_setting_name = backend_http_setting_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/network_management_client_enums.py index 8748d85ad98f..cbb04ec64c9e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/network_management_client_enums.py @@ -12,6 +12,12 @@ from enum import Enum +class ApplicationGatewayProtocol(str, Enum): + + http = "Http" + https = "Https" + + class IPAllocationMethod(str, Enum): static = "Static" @@ -73,12 +79,6 @@ class TransportProtocol(str, Enum): all = "All" -class ApplicationGatewayProtocol(str, Enum): - - http = "Http" - https = "Https" - - class ApplicationGatewayCookieBasedAffinity(str, Enum): enabled = "Enabled" diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/application_gateways_operations.py index 84bbc7ef6841..3a802c9f1f47 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/application_gateways_operations.py @@ -776,6 +776,116 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} + + def _backend_health_on_demand_initial( + self, resource_group_name, application_gateway_name, probe_request, expand=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.backend_health_on_demand.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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(probe_request, 'ApplicationGatewayOnDemandProbe') + + # Construct and send request + 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, 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('ApplicationGatewayBackendHealthOnDemand', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def backend_health_on_demand( + self, resource_group_name, application_gateway_name, probe_request, expand=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets the backend health for given combination of backend pool and http + setting of the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param probe_request: Request body for on-demand test probe operation. + :type probe_request: + ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayOnDemandProbe + :param expand: Expands BackendAddressPool and BackendHttpSettings + referenced in backend health. + :type expand: 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 + ApplicationGatewayBackendHealthOnDemand or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayBackendHealthOnDemand] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayBackendHealthOnDemand]] + :raises: :class:`CloudError` + """ + raw_result = self._backend_health_on_demand_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + probe_request=probe_request, + expand=expand, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApplicationGatewayBackendHealthOnDemand', 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, 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) + backend_health_on_demand.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand'} + def list_available_server_variables( self, custom_headers=None, raw=False, **operation_config): """Lists all available server variables.