diff --git a/azure-mgmt-frontdoor/HISTORY.rst b/azure-mgmt-frontdoor/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-mgmt-frontdoor/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-frontdoor/MANIFEST.in b/azure-mgmt-frontdoor/MANIFEST.in new file mode 100644 index 000000000000..6ceb27f7a96e --- /dev/null +++ b/azure-mgmt-frontdoor/MANIFEST.in @@ -0,0 +1,4 @@ +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-frontdoor/README.rst b/azure-mgmt-frontdoor/README.rst new file mode 100644 index 000000000000..45de4e6b43dd --- /dev/null +++ b/azure-mgmt-frontdoor/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-frontdoor/azure/__init__.py b/azure-mgmt-frontdoor/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-frontdoor/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-frontdoor/azure/mgmt/__init__.py b/azure-mgmt-frontdoor/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/__init__.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/__init__.py new file mode 100644 index 000000000000..f2cf644ce945 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/__init__.py @@ -0,0 +1,18 @@ +# 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 .front_door_management_client import FrontDoorManagementClient +from .version import VERSION + +__all__ = ['FrontDoorManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py new file mode 100644 index 000000000000..7382a8928955 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py @@ -0,0 +1,258 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling +import uuid +from .operations.front_doors_operations import FrontDoorsOperations +from .operations.routing_rules_operations import RoutingRulesOperations +from .operations.health_probe_settings_operations import HealthProbeSettingsOperations +from .operations.load_balancing_settings_operations import LoadBalancingSettingsOperations +from .operations.backend_pools_operations import BackendPoolsOperations +from .operations.frontend_endpoints_operations import FrontendEndpointsOperations +from .operations.endpoints_operations import EndpointsOperations +from .operations.policies_operations import PoliciesOperations +from . import models + + +class FrontDoorManagementClientConfiguration(AzureConfiguration): + """Configuration for FrontDoorManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(FrontDoorManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-frontdoor/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class FrontDoorManagementClient(SDKClient): + """FrontDoor Client + + :ivar config: Configuration for client. + :vartype config: FrontDoorManagementClientConfiguration + + :ivar front_doors: FrontDoors operations + :vartype front_doors: azure.mgmt.frontdoor.operations.FrontDoorsOperations + :ivar routing_rules: RoutingRules operations + :vartype routing_rules: azure.mgmt.frontdoor.operations.RoutingRulesOperations + :ivar health_probe_settings: HealthProbeSettings operations + :vartype health_probe_settings: azure.mgmt.frontdoor.operations.HealthProbeSettingsOperations + :ivar load_balancing_settings: LoadBalancingSettings operations + :vartype load_balancing_settings: azure.mgmt.frontdoor.operations.LoadBalancingSettingsOperations + :ivar backend_pools: BackendPools operations + :vartype backend_pools: azure.mgmt.frontdoor.operations.BackendPoolsOperations + :ivar frontend_endpoints: FrontendEndpoints operations + :vartype frontend_endpoints: azure.mgmt.frontdoor.operations.FrontendEndpointsOperations + :ivar endpoints: Endpoints operations + :vartype endpoints: azure.mgmt.frontdoor.operations.EndpointsOperations + :ivar policies: Policies operations + :vartype policies: azure.mgmt.frontdoor.operations.PoliciesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = FrontDoorManagementClientConfiguration(credentials, subscription_id, base_url) + super(FrontDoorManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.front_doors = FrontDoorsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.routing_rules = RoutingRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.health_probe_settings = HealthProbeSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.load_balancing_settings = LoadBalancingSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.backend_pools = BackendPoolsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.frontend_endpoints = FrontendEndpointsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.endpoints = EndpointsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.policies = PoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + + def check_front_door_name_availability( + self, name, type, custom_headers=None, raw=False, **operation_config): + """Check the availability of a Front Door resource name. + + :param name: The resource name to validate. + :type name: str + :param type: The type of the resource whose name is to be validated. + Possible values include: 'Microsoft.Network/frontDoors', + 'Microsoft.Network/frontDoors/frontendEndpoints' + :type type: str or ~azure.mgmt.frontdoor.models.ResourceType + :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: CheckNameAvailabilityOutput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.CheckNameAvailabilityOutput or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) + + api_version = "2018-08-01" + + # Construct URL + url = self.check_front_door_name_availability.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", 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(check_front_door_name_availability_input, 'CheckNameAvailabilityInput') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityOutput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_front_door_name_availability.metadata = {'url': '/providers/Microsoft.Network/checkFrontDoorNameAvailability'} + + def check_front_door_name_availability_with_subscription( + self, name, type, custom_headers=None, raw=False, **operation_config): + """Check the availability of a Front Door subdomain. + + :param name: The resource name to validate. + :type name: str + :param type: The type of the resource whose name is to be validated. + Possible values include: 'Microsoft.Network/frontDoors', + 'Microsoft.Network/frontDoors/frontendEndpoints' + :type type: str or ~azure.mgmt.frontdoor.models.ResourceType + :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: CheckNameAvailabilityOutput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.CheckNameAvailabilityOutput or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) + + api_version = "2018-08-01" + + # Construct URL + url = self.check_front_door_name_availability_with_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", 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(check_front_door_name_availability_input, 'CheckNameAvailabilityInput') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityOutput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_front_door_name_availability_with_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/checkFrontDoorNameAvailability'} diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py new file mode 100644 index 000000000000..8426d3c4cca0 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py @@ -0,0 +1,194 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .front_door_py3 import FrontDoor + from .routing_rule_py3 import RoutingRule + from .load_balancing_settings_model_py3 import LoadBalancingSettingsModel + from .health_probe_settings_model_py3 import HealthProbeSettingsModel + from .backend_pool_py3 import BackendPool + from .key_vault_certificate_source_parameters_vault_py3 import KeyVaultCertificateSourceParametersVault + from .custom_https_configuration_py3 import CustomHttpsConfiguration + from .frontend_endpoint_py3 import FrontendEndpoint + from .front_door_update_parameters_py3 import FrontDoorUpdateParameters + from .purge_parameters_py3 import PurgeParameters + from .sub_resource_py3 import SubResource + from .cache_configuration_py3 import CacheConfiguration + from .routing_rule_update_parameters_py3 import RoutingRuleUpdateParameters + from .backend_py3 import Backend + from .load_balancing_settings_update_parameters_py3 import LoadBalancingSettingsUpdateParameters + from .health_probe_settings_update_parameters_py3 import HealthProbeSettingsUpdateParameters + from .backend_pool_update_parameters_py3 import BackendPoolUpdateParameters + from .frontend_endpoint_update_parameters_web_application_firewall_policy_link_py3 import FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink + from .frontend_endpoint_update_parameters_py3 import FrontendEndpointUpdateParameters + from .validate_custom_domain_input_py3 import ValidateCustomDomainInput + from .validate_custom_domain_output_py3 import ValidateCustomDomainOutput + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .check_name_availability_input_py3 import CheckNameAvailabilityInput + from .check_name_availability_output_py3 import CheckNameAvailabilityOutput + from .resource_py3 import Resource + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .tags_object_py3 import TagsObject + from .policy_settings_py3 import PolicySettings + from .match_condition1_py3 import MatchCondition1 + from .custom_rule_py3 import CustomRule + from .custom_rules_py3 import CustomRules + from .managed_rule_set_py3 import ManagedRuleSet + from .managed_rule_sets_py3 import ManagedRuleSets + from .web_application_firewall_policy1_py3 import WebApplicationFirewallPolicy1 + from .azure_managed_override_rule_group_py3 import AzureManagedOverrideRuleGroup + from .azure_managed_rule_set_py3 import AzureManagedRuleSet +except (SyntaxError, ImportError): + from .front_door import FrontDoor + from .routing_rule import RoutingRule + from .load_balancing_settings_model import LoadBalancingSettingsModel + from .health_probe_settings_model import HealthProbeSettingsModel + from .backend_pool import BackendPool + from .key_vault_certificate_source_parameters_vault import KeyVaultCertificateSourceParametersVault + from .custom_https_configuration import CustomHttpsConfiguration + from .frontend_endpoint import FrontendEndpoint + from .front_door_update_parameters import FrontDoorUpdateParameters + from .purge_parameters import PurgeParameters + from .sub_resource import SubResource + from .cache_configuration import CacheConfiguration + from .routing_rule_update_parameters import RoutingRuleUpdateParameters + from .backend import Backend + from .load_balancing_settings_update_parameters import LoadBalancingSettingsUpdateParameters + from .health_probe_settings_update_parameters import HealthProbeSettingsUpdateParameters + from .backend_pool_update_parameters import BackendPoolUpdateParameters + from .frontend_endpoint_update_parameters_web_application_firewall_policy_link import FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink + from .frontend_endpoint_update_parameters import FrontendEndpointUpdateParameters + from .validate_custom_domain_input import ValidateCustomDomainInput + from .validate_custom_domain_output import ValidateCustomDomainOutput + from .error_response import ErrorResponse, ErrorResponseException + from .check_name_availability_input import CheckNameAvailabilityInput + from .check_name_availability_output import CheckNameAvailabilityOutput + from .resource import Resource + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .tags_object import TagsObject + from .policy_settings import PolicySettings + from .match_condition1 import MatchCondition1 + from .custom_rule import CustomRule + from .custom_rules import CustomRules + from .managed_rule_set import ManagedRuleSet + from .managed_rule_sets import ManagedRuleSets + from .web_application_firewall_policy1 import WebApplicationFirewallPolicy1 + from .azure_managed_override_rule_group import AzureManagedOverrideRuleGroup + from .azure_managed_rule_set import AzureManagedRuleSet +from .front_door_paged import FrontDoorPaged +from .routing_rule_paged import RoutingRulePaged +from .health_probe_settings_model_paged import HealthProbeSettingsModelPaged +from .load_balancing_settings_model_paged import LoadBalancingSettingsModelPaged +from .backend_pool_paged import BackendPoolPaged +from .frontend_endpoint_paged import FrontendEndpointPaged +from .web_application_firewall_policy1_paged import WebApplicationFirewallPolicy1Paged +from .front_door_management_client_enums import ( + FrontDoorResourceState, + CustomHttpsProvisioningState, + CustomHttpsProvisioningSubstate, + FrontDoorCertificateSource, + FrontDoorTlsProtocolType, + FrontDoorCertificateType, + FrontDoorEnabledState, + FrontDoorProtocol, + FrontDoorForwardingProtocol, + FrontDoorQuery, + DynamicCompressionEnabled, + SessionAffinityEnabledState, + ResourceType, + Availability, + NetworkOperationStatus, + EnabledState, + Mode, + RuleType, + MatchCondition, + Operator, + Action, + Transform, + WebApplicationFirewallPolicy, + RuleGroupOverride, +) + +__all__ = [ + 'FrontDoor', + 'RoutingRule', + 'LoadBalancingSettingsModel', + 'HealthProbeSettingsModel', + 'BackendPool', + 'KeyVaultCertificateSourceParametersVault', + 'CustomHttpsConfiguration', + 'FrontendEndpoint', + 'FrontDoorUpdateParameters', + 'PurgeParameters', + 'SubResource', + 'CacheConfiguration', + 'RoutingRuleUpdateParameters', + 'Backend', + 'LoadBalancingSettingsUpdateParameters', + 'HealthProbeSettingsUpdateParameters', + 'BackendPoolUpdateParameters', + 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink', + 'FrontendEndpointUpdateParameters', + 'ValidateCustomDomainInput', + 'ValidateCustomDomainOutput', + 'ErrorResponse', 'ErrorResponseException', + 'CheckNameAvailabilityInput', + 'CheckNameAvailabilityOutput', + 'Resource', + 'ErrorDetails', + 'Error', + 'AzureAsyncOperationResult', + 'TagsObject', + 'PolicySettings', + 'MatchCondition1', + 'CustomRule', + 'CustomRules', + 'ManagedRuleSet', + 'ManagedRuleSets', + 'WebApplicationFirewallPolicy1', + 'AzureManagedOverrideRuleGroup', + 'AzureManagedRuleSet', + 'FrontDoorPaged', + 'RoutingRulePaged', + 'HealthProbeSettingsModelPaged', + 'LoadBalancingSettingsModelPaged', + 'BackendPoolPaged', + 'FrontendEndpointPaged', + 'WebApplicationFirewallPolicy1Paged', + 'FrontDoorResourceState', + 'CustomHttpsProvisioningState', + 'CustomHttpsProvisioningSubstate', + 'FrontDoorCertificateSource', + 'FrontDoorTlsProtocolType', + 'FrontDoorCertificateType', + 'FrontDoorEnabledState', + 'FrontDoorProtocol', + 'FrontDoorForwardingProtocol', + 'FrontDoorQuery', + 'DynamicCompressionEnabled', + 'SessionAffinityEnabledState', + 'ResourceType', + 'Availability', + 'NetworkOperationStatus', + 'EnabledState', + 'Mode', + 'RuleType', + 'MatchCondition', + 'Operator', + 'Action', + 'Transform', + 'WebApplicationFirewallPolicy', + 'RuleGroupOverride', +] diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_async_operation_result.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_async_operation_result.py new file mode 100644 index 000000000000..7b934f41680c --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_async_operation_result.py @@ -0,0 +1,41 @@ +# 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 AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or ~azure.mgmt.frontdoor.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.frontdoor.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_async_operation_result_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..34fd76a89571 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_async_operation_result_py3.py @@ -0,0 +1,41 @@ +# 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 AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or ~azure.mgmt.frontdoor.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.frontdoor.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group.py new file mode 100644 index 000000000000..3602d32adfc3 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group.py @@ -0,0 +1,42 @@ +# 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 AzureManagedOverrideRuleGroup(Model): + """Defines contents of a web application rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_override: Required. Describes override rule group. + Possible values include: 'SqlInjection', 'XSS' + :type rule_group_override: str or + ~azure.mgmt.frontdoor.models.RuleGroupOverride + :param action: Required. Type of Actions. Possible values include: + 'Allow', 'Block', 'Log' + :type action: str or ~azure.mgmt.frontdoor.models.Action + """ + + _validation = { + 'rule_group_override': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'rule_group_override': {'key': 'ruleGroupOverride', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureManagedOverrideRuleGroup, self).__init__(**kwargs) + self.rule_group_override = kwargs.get('rule_group_override', None) + self.action = kwargs.get('action', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group_py3.py new file mode 100644 index 000000000000..3080e02399fa --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group_py3.py @@ -0,0 +1,42 @@ +# 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 AzureManagedOverrideRuleGroup(Model): + """Defines contents of a web application rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_override: Required. Describes override rule group. + Possible values include: 'SqlInjection', 'XSS' + :type rule_group_override: str or + ~azure.mgmt.frontdoor.models.RuleGroupOverride + :param action: Required. Type of Actions. Possible values include: + 'Allow', 'Block', 'Log' + :type action: str or ~azure.mgmt.frontdoor.models.Action + """ + + _validation = { + 'rule_group_override': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'rule_group_override': {'key': 'ruleGroupOverride', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__(self, *, rule_group_override, action, **kwargs) -> None: + super(AzureManagedOverrideRuleGroup, self).__init__(**kwargs) + self.rule_group_override = rule_group_override + self.action = action diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set.py new file mode 100644 index 000000000000..005935666d49 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set.py @@ -0,0 +1,46 @@ +# 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 .managed_rule_set import ManagedRuleSet + + +class AzureManagedRuleSet(ManagedRuleSet): + """Describes azure managed provider. + + All required parameters must be populated in order to send to Azure. + + :param priority: Describes priority of the rule + :type priority: int + :param version: defines version of the rule set + :type version: int + :param rule_set_type: Required. Constant filled by server. + :type rule_set_type: str + :param rule_group_overrides: List of azure managed provider override + configuration (optional) + :type rule_group_overrides: + list[~azure.mgmt.frontdoor.models.AzureManagedOverrideRuleGroup] + """ + + _validation = { + 'rule_set_type': {'required': True}, + } + + _attribute_map = { + 'priority': {'key': 'priority', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'int'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[AzureManagedOverrideRuleGroup]'}, + } + + def __init__(self, **kwargs): + super(AzureManagedRuleSet, self).__init__(**kwargs) + self.rule_group_overrides = kwargs.get('rule_group_overrides', None) + self.rule_set_type = 'AzureManagedRuleSet' diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set_py3.py new file mode 100644 index 000000000000..56d63d6f45db --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set_py3.py @@ -0,0 +1,46 @@ +# 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 .managed_rule_set_py3 import ManagedRuleSet + + +class AzureManagedRuleSet(ManagedRuleSet): + """Describes azure managed provider. + + All required parameters must be populated in order to send to Azure. + + :param priority: Describes priority of the rule + :type priority: int + :param version: defines version of the rule set + :type version: int + :param rule_set_type: Required. Constant filled by server. + :type rule_set_type: str + :param rule_group_overrides: List of azure managed provider override + configuration (optional) + :type rule_group_overrides: + list[~azure.mgmt.frontdoor.models.AzureManagedOverrideRuleGroup] + """ + + _validation = { + 'rule_set_type': {'required': True}, + } + + _attribute_map = { + 'priority': {'key': 'priority', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'int'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[AzureManagedOverrideRuleGroup]'}, + } + + def __init__(self, *, priority: int=None, version: int=None, rule_group_overrides=None, **kwargs) -> None: + super(AzureManagedRuleSet, self).__init__(priority=priority, version=version, **kwargs) + self.rule_group_overrides = rule_group_overrides + self.rule_set_type = 'AzureManagedRuleSet' diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend.py new file mode 100644 index 000000000000..d15a56194c1a --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend.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 Backend(Model): + """Backend address of a frontDoor load balancer. + + :param address: Location of the backend (IP address or FQDN) + :type address: str + :param http_port: The HTTP TCP port number. Must be between 1 and 65535. + :type http_port: int + :param https_port: The HTTPS TCP port number. Must be between 1 and 65535. + :type https_port: int + :param enabled_state: Whether to enable use of this backend. Permitted + values are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + :param priority: Priority to use for load balancing. Higher priorities + will not be used for load balancing if any lower priority backend is + healthy. + :type priority: int + :param weight: Weight of this endpoint for load balancing purposes. + :type weight: int + :param backend_host_header: The value to use as the host header sent to + the backend. If blank or unspecified, this defaults to the incoming host. + :type backend_host_header: str + """ + + _validation = { + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + } + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'http_port': {'key': 'httpPort', 'type': 'int'}, + 'https_port': {'key': 'httpsPort', 'type': 'int'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'backend_host_header': {'key': 'backendHostHeader', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Backend, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.http_port = kwargs.get('http_port', None) + self.https_port = kwargs.get('https_port', None) + self.enabled_state = kwargs.get('enabled_state', None) + self.priority = kwargs.get('priority', None) + self.weight = kwargs.get('weight', None) + self.backend_host_header = kwargs.get('backend_host_header', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool.py new file mode 100644 index 000000000000..88dc30eab32f --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool.py @@ -0,0 +1,60 @@ +# 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 .sub_resource import SubResource + + +class BackendPool(SubResource): + """A backend pool is a collection of backends that can be routed to. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param backends: The set of backends for this pool + :type backends: list[~azure.mgmt.frontdoor.models.Backend] + :param load_balancing_settings: Load balancing settings for a backend pool + :type load_balancing_settings: ~azure.mgmt.frontdoor.models.SubResource + :param health_probe_settings: L7 health probe settings for a backend pool + :type health_probe_settings: ~azure.mgmt.frontdoor.models.SubResource + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backends': {'key': 'properties.backends', 'type': '[Backend]'}, + 'load_balancing_settings': {'key': 'properties.loadBalancingSettings', 'type': 'SubResource'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'SubResource'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BackendPool, self).__init__(**kwargs) + self.backends = kwargs.get('backends', None) + self.load_balancing_settings = kwargs.get('load_balancing_settings', None) + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.resource_state = kwargs.get('resource_state', None) + self.name = kwargs.get('name', None) + self.type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_paged.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_paged.py new file mode 100644 index 000000000000..7f530dd9c345 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class BackendPoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`BackendPool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BackendPool]'} + } + + def __init__(self, *args, **kwargs): + + super(BackendPoolPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_py3.py new file mode 100644 index 000000000000..539d0ab52f3a --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_py3.py @@ -0,0 +1,60 @@ +# 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 .sub_resource_py3 import SubResource + + +class BackendPool(SubResource): + """A backend pool is a collection of backends that can be routed to. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param backends: The set of backends for this pool + :type backends: list[~azure.mgmt.frontdoor.models.Backend] + :param load_balancing_settings: Load balancing settings for a backend pool + :type load_balancing_settings: ~azure.mgmt.frontdoor.models.SubResource + :param health_probe_settings: L7 health probe settings for a backend pool + :type health_probe_settings: ~azure.mgmt.frontdoor.models.SubResource + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backends': {'key': 'properties.backends', 'type': '[Backend]'}, + 'load_balancing_settings': {'key': 'properties.loadBalancingSettings', 'type': 'SubResource'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'SubResource'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backends=None, load_balancing_settings=None, health_probe_settings=None, resource_state=None, name: str=None, **kwargs) -> None: + super(BackendPool, self).__init__(id=id, **kwargs) + self.backends = backends + self.load_balancing_settings = load_balancing_settings + self.health_probe_settings = health_probe_settings + self.resource_state = resource_state + self.name = name + self.type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_update_parameters.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_update_parameters.py new file mode 100644 index 000000000000..de81ce836970 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_update_parameters.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 BackendPoolUpdateParameters(Model): + """A collection of backends that can be routed to. + + :param backends: The set of backends for this pool + :type backends: list[~azure.mgmt.frontdoor.models.Backend] + :param load_balancing_settings: Load balancing settings for a backend pool + :type load_balancing_settings: ~azure.mgmt.frontdoor.models.SubResource + :param health_probe_settings: L7 health probe settings for a backend pool + :type health_probe_settings: ~azure.mgmt.frontdoor.models.SubResource + """ + + _attribute_map = { + 'backends': {'key': 'backends', 'type': '[Backend]'}, + 'load_balancing_settings': {'key': 'loadBalancingSettings', 'type': 'SubResource'}, + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'SubResource'}, + } + + def __init__(self, **kwargs): + super(BackendPoolUpdateParameters, self).__init__(**kwargs) + self.backends = kwargs.get('backends', None) + self.load_balancing_settings = kwargs.get('load_balancing_settings', None) + self.health_probe_settings = kwargs.get('health_probe_settings', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_update_parameters_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_update_parameters_py3.py new file mode 100644 index 000000000000..d740e7d5e4cc --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_update_parameters_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 BackendPoolUpdateParameters(Model): + """A collection of backends that can be routed to. + + :param backends: The set of backends for this pool + :type backends: list[~azure.mgmt.frontdoor.models.Backend] + :param load_balancing_settings: Load balancing settings for a backend pool + :type load_balancing_settings: ~azure.mgmt.frontdoor.models.SubResource + :param health_probe_settings: L7 health probe settings for a backend pool + :type health_probe_settings: ~azure.mgmt.frontdoor.models.SubResource + """ + + _attribute_map = { + 'backends': {'key': 'backends', 'type': '[Backend]'}, + 'load_balancing_settings': {'key': 'loadBalancingSettings', 'type': 'SubResource'}, + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'SubResource'}, + } + + def __init__(self, *, backends=None, load_balancing_settings=None, health_probe_settings=None, **kwargs) -> None: + super(BackendPoolUpdateParameters, self).__init__(**kwargs) + self.backends = backends + self.load_balancing_settings = load_balancing_settings + self.health_probe_settings = health_probe_settings diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_py3.py new file mode 100644 index 000000000000..eb7427630145 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_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 Backend(Model): + """Backend address of a frontDoor load balancer. + + :param address: Location of the backend (IP address or FQDN) + :type address: str + :param http_port: The HTTP TCP port number. Must be between 1 and 65535. + :type http_port: int + :param https_port: The HTTPS TCP port number. Must be between 1 and 65535. + :type https_port: int + :param enabled_state: Whether to enable use of this backend. Permitted + values are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + :param priority: Priority to use for load balancing. Higher priorities + will not be used for load balancing if any lower priority backend is + healthy. + :type priority: int + :param weight: Weight of this endpoint for load balancing purposes. + :type weight: int + :param backend_host_header: The value to use as the host header sent to + the backend. If blank or unspecified, this defaults to the incoming host. + :type backend_host_header: str + """ + + _validation = { + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + } + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'http_port': {'key': 'httpPort', 'type': 'int'}, + 'https_port': {'key': 'httpsPort', 'type': 'int'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'backend_host_header': {'key': 'backendHostHeader', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, http_port: int=None, https_port: int=None, enabled_state=None, priority: int=None, weight: int=None, backend_host_header: str=None, **kwargs) -> None: + super(Backend, self).__init__(**kwargs) + self.address = address + self.http_port = http_port + self.https_port = https_port + self.enabled_state = enabled_state + self.priority = priority + self.weight = weight + self.backend_host_header = backend_host_header diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/cache_configuration.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/cache_configuration.py new file mode 100644 index 000000000000..670e24d9632c --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/cache_configuration.py @@ -0,0 +1,37 @@ +# 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 CacheConfiguration(Model): + """Caching settings for a caching-type route. To disable caching, do not + provide a cacheConfiguration object. + + :param query_parameter_strip_directive: Treatment of URL query terms when + forming the cache key. Possible values include: 'StripNone', 'StripAll' + :type query_parameter_strip_directive: str or + ~azure.mgmt.frontdoor.models.FrontDoorQuery + :param dynamic_compression: Whether to use dynamic compression for cached + content. Possible values include: 'Enabled', 'Disabled' + :type dynamic_compression: str or + ~azure.mgmt.frontdoor.models.DynamicCompressionEnabled + """ + + _attribute_map = { + 'query_parameter_strip_directive': {'key': 'queryParameterStripDirective', 'type': 'str'}, + 'dynamic_compression': {'key': 'dynamicCompression', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CacheConfiguration, self).__init__(**kwargs) + self.query_parameter_strip_directive = kwargs.get('query_parameter_strip_directive', None) + self.dynamic_compression = kwargs.get('dynamic_compression', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/cache_configuration_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/cache_configuration_py3.py new file mode 100644 index 000000000000..6fd1bc544d84 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/cache_configuration_py3.py @@ -0,0 +1,37 @@ +# 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 CacheConfiguration(Model): + """Caching settings for a caching-type route. To disable caching, do not + provide a cacheConfiguration object. + + :param query_parameter_strip_directive: Treatment of URL query terms when + forming the cache key. Possible values include: 'StripNone', 'StripAll' + :type query_parameter_strip_directive: str or + ~azure.mgmt.frontdoor.models.FrontDoorQuery + :param dynamic_compression: Whether to use dynamic compression for cached + content. Possible values include: 'Enabled', 'Disabled' + :type dynamic_compression: str or + ~azure.mgmt.frontdoor.models.DynamicCompressionEnabled + """ + + _attribute_map = { + 'query_parameter_strip_directive': {'key': 'queryParameterStripDirective', 'type': 'str'}, + 'dynamic_compression': {'key': 'dynamicCompression', 'type': 'str'}, + } + + def __init__(self, *, query_parameter_strip_directive=None, dynamic_compression=None, **kwargs) -> None: + super(CacheConfiguration, self).__init__(**kwargs) + self.query_parameter_strip_directive = query_parameter_strip_directive + self.dynamic_compression = dynamic_compression diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_input.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_input.py new file mode 100644 index 000000000000..795f600390f8 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_input.py @@ -0,0 +1,41 @@ +# 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 CheckNameAvailabilityInput(Model): + """Input of CheckNameAvailability API. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The resource name to validate. + :type name: str + :param type: Required. The type of the resource whose name is to be + validated. Possible values include: 'Microsoft.Network/frontDoors', + 'Microsoft.Network/frontDoors/frontendEndpoints' + :type type: str or ~azure.mgmt.frontdoor.models.ResourceType + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceType'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityInput, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_input_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_input_py3.py new file mode 100644 index 000000000000..47a5def7517a --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_input_py3.py @@ -0,0 +1,41 @@ +# 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 CheckNameAvailabilityInput(Model): + """Input of CheckNameAvailability API. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The resource name to validate. + :type name: str + :param type: Required. The type of the resource whose name is to be + validated. Possible values include: 'Microsoft.Network/frontDoors', + 'Microsoft.Network/frontDoors/frontendEndpoints' + :type type: str or ~azure.mgmt.frontdoor.models.ResourceType + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceType'}, + } + + def __init__(self, *, name: str, type, **kwargs) -> None: + super(CheckNameAvailabilityInput, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_output.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_output.py new file mode 100644 index 000000000000..488ab34b8936 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_output.py @@ -0,0 +1,48 @@ +# 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 CheckNameAvailabilityOutput(Model): + """Output of check name availability API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_availability: Indicates whether the name is available. Possible + values include: 'Available', 'Unavailable' + :vartype name_availability: str or + ~azure.mgmt.frontdoor.models.Availability + :ivar reason: The reason why the name is not available. + :vartype reason: str + :ivar message: The detailed error message describing why the name is not + available. + :vartype message: str + """ + + _validation = { + 'name_availability': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_availability': {'key': 'nameAvailability', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityOutput, self).__init__(**kwargs) + self.name_availability = None + self.reason = None + self.message = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_output_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_output_py3.py new file mode 100644 index 000000000000..7d330107c694 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/check_name_availability_output_py3.py @@ -0,0 +1,48 @@ +# 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 CheckNameAvailabilityOutput(Model): + """Output of check name availability API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_availability: Indicates whether the name is available. Possible + values include: 'Available', 'Unavailable' + :vartype name_availability: str or + ~azure.mgmt.frontdoor.models.Availability + :ivar reason: The reason why the name is not available. + :vartype reason: str + :ivar message: The detailed error message describing why the name is not + available. + :vartype message: str + """ + + _validation = { + 'name_availability': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_availability': {'key': 'nameAvailability', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityOutput, self).__init__(**kwargs) + self.name_availability = None + self.reason = None + self.message = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration.py new file mode 100644 index 000000000000..ebf4b28794fd --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration.py @@ -0,0 +1,58 @@ +# 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 CustomHttpsConfiguration(Model): + """Https settings for a domain. + + :param certificate_source: Defines the source of the SSL certificate. + Possible values include: 'AzureKeyVault', 'FrontDoor' + :type certificate_source: str or + ~azure.mgmt.frontdoor.models.FrontDoorCertificateSource + :param protocol_type: Defines the TLS extension protocol that is used for + secure delivery. Possible values include: 'ServerNameIndication' + :type protocol_type: str or + ~azure.mgmt.frontdoor.models.FrontDoorTlsProtocolType + :param vault: The Key Vault containing the SSL certificate + :type vault: + ~azure.mgmt.frontdoor.models.KeyVaultCertificateSourceParametersVault + :param secret_name: The name of the Key Vault secret representing the full + certificate PFX + :type secret_name: str + :param secret_version: The version of the Key Vault secret representing + the full certificate PFX + :type secret_version: str + :param certificate_type: Defines the type of the certificate used for + secure connections to a frontendEndpoint. Possible values include: + 'Dedicated' + :type certificate_type: str or + ~azure.mgmt.frontdoor.models.FrontDoorCertificateType + """ + + _attribute_map = { + 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'vault': {'key': 'keyVaultCertificateSourceParameters.vault', 'type': 'KeyVaultCertificateSourceParametersVault'}, + 'secret_name': {'key': 'keyVaultCertificateSourceParameters.secretName', 'type': 'str'}, + 'secret_version': {'key': 'keyVaultCertificateSourceParameters.secretVersion', 'type': 'str'}, + 'certificate_type': {'key': 'frontDoorCertificateSourceParameters.certificateType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomHttpsConfiguration, self).__init__(**kwargs) + self.certificate_source = kwargs.get('certificate_source', None) + self.protocol_type = kwargs.get('protocol_type', None) + self.vault = kwargs.get('vault', None) + self.secret_name = kwargs.get('secret_name', None) + self.secret_version = kwargs.get('secret_version', None) + self.certificate_type = kwargs.get('certificate_type', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration_py3.py new file mode 100644 index 000000000000..2420582fecb1 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration_py3.py @@ -0,0 +1,58 @@ +# 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 CustomHttpsConfiguration(Model): + """Https settings for a domain. + + :param certificate_source: Defines the source of the SSL certificate. + Possible values include: 'AzureKeyVault', 'FrontDoor' + :type certificate_source: str or + ~azure.mgmt.frontdoor.models.FrontDoorCertificateSource + :param protocol_type: Defines the TLS extension protocol that is used for + secure delivery. Possible values include: 'ServerNameIndication' + :type protocol_type: str or + ~azure.mgmt.frontdoor.models.FrontDoorTlsProtocolType + :param vault: The Key Vault containing the SSL certificate + :type vault: + ~azure.mgmt.frontdoor.models.KeyVaultCertificateSourceParametersVault + :param secret_name: The name of the Key Vault secret representing the full + certificate PFX + :type secret_name: str + :param secret_version: The version of the Key Vault secret representing + the full certificate PFX + :type secret_version: str + :param certificate_type: Defines the type of the certificate used for + secure connections to a frontendEndpoint. Possible values include: + 'Dedicated' + :type certificate_type: str or + ~azure.mgmt.frontdoor.models.FrontDoorCertificateType + """ + + _attribute_map = { + 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'vault': {'key': 'keyVaultCertificateSourceParameters.vault', 'type': 'KeyVaultCertificateSourceParametersVault'}, + 'secret_name': {'key': 'keyVaultCertificateSourceParameters.secretName', 'type': 'str'}, + 'secret_version': {'key': 'keyVaultCertificateSourceParameters.secretVersion', 'type': 'str'}, + 'certificate_type': {'key': 'frontDoorCertificateSourceParameters.certificateType', 'type': 'str'}, + } + + def __init__(self, *, certificate_source=None, protocol_type=None, vault=None, secret_name: str=None, secret_version: str=None, certificate_type=None, **kwargs) -> None: + super(CustomHttpsConfiguration, self).__init__(**kwargs) + self.certificate_source = certificate_source + self.protocol_type = protocol_type + self.vault = vault + self.secret_name = secret_name + self.secret_version = secret_version + self.certificate_type = certificate_type diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule.py new file mode 100644 index 000000000000..6ee3544c69db --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule.py @@ -0,0 +1,80 @@ +# 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 CustomRule(Model): + """Defines contents of a web application rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Gets name of the resource that is unique within a policy. + This name can be used to access the resource. + :type name: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + :param priority: Required. Describes priority of the rule. Rules with a + lower value will be evaluated before rules with a higher value + :type priority: int + :param rule_type: Required. Describes type of rule. Possible values + include: 'MatchRule', 'RateLimitRule' + :type rule_type: str or ~azure.mgmt.frontdoor.models.RuleType + :param rate_limit_duration_in_minutes: Defines rate limit duration. + Default - 1 minute + :type rate_limit_duration_in_minutes: int + :param rate_limit_threshold: Defines rate limit threshold + :type rate_limit_threshold: int + :param match_conditions: Required. List of match conditions + :type match_conditions: list[~azure.mgmt.frontdoor.models.MatchCondition1] + :param action: Required. Type of Actions. Possible values include: + 'Allow', 'Block', 'Log' + :type action: str or ~azure.mgmt.frontdoor.models.Action + :param transforms: List of transforms + :type transforms: list[str or ~azure.mgmt.frontdoor.models.Transform] + """ + + _validation = { + 'name': {'max_length': 128}, + 'etag': {'readonly': True}, + 'priority': {'required': True}, + 'rule_type': {'required': True}, + 'match_conditions': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'rate_limit_duration_in_minutes': {'key': 'rateLimitDurationInMinutes', 'type': 'int'}, + 'rate_limit_threshold': {'key': 'rateLimitThreshold', 'type': 'int'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition1]'}, + 'action': {'key': 'action', 'type': 'str'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CustomRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.priority = kwargs.get('priority', None) + self.rule_type = kwargs.get('rule_type', None) + self.rate_limit_duration_in_minutes = kwargs.get('rate_limit_duration_in_minutes', None) + self.rate_limit_threshold = kwargs.get('rate_limit_threshold', None) + self.match_conditions = kwargs.get('match_conditions', None) + self.action = kwargs.get('action', None) + self.transforms = kwargs.get('transforms', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_py3.py new file mode 100644 index 000000000000..41d5aaf0a267 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_py3.py @@ -0,0 +1,80 @@ +# 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 CustomRule(Model): + """Defines contents of a web application rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Gets name of the resource that is unique within a policy. + This name can be used to access the resource. + :type name: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + :param priority: Required. Describes priority of the rule. Rules with a + lower value will be evaluated before rules with a higher value + :type priority: int + :param rule_type: Required. Describes type of rule. Possible values + include: 'MatchRule', 'RateLimitRule' + :type rule_type: str or ~azure.mgmt.frontdoor.models.RuleType + :param rate_limit_duration_in_minutes: Defines rate limit duration. + Default - 1 minute + :type rate_limit_duration_in_minutes: int + :param rate_limit_threshold: Defines rate limit threshold + :type rate_limit_threshold: int + :param match_conditions: Required. List of match conditions + :type match_conditions: list[~azure.mgmt.frontdoor.models.MatchCondition1] + :param action: Required. Type of Actions. Possible values include: + 'Allow', 'Block', 'Log' + :type action: str or ~azure.mgmt.frontdoor.models.Action + :param transforms: List of transforms + :type transforms: list[str or ~azure.mgmt.frontdoor.models.Transform] + """ + + _validation = { + 'name': {'max_length': 128}, + 'etag': {'readonly': True}, + 'priority': {'required': True}, + 'rule_type': {'required': True}, + 'match_conditions': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'rate_limit_duration_in_minutes': {'key': 'rateLimitDurationInMinutes', 'type': 'int'}, + 'rate_limit_threshold': {'key': 'rateLimitThreshold', 'type': 'int'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition1]'}, + 'action': {'key': 'action', 'type': 'str'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + def __init__(self, *, priority: int, rule_type, match_conditions, action, name: str=None, rate_limit_duration_in_minutes: int=None, rate_limit_threshold: int=None, transforms=None, **kwargs) -> None: + super(CustomRule, self).__init__(**kwargs) + self.name = name + self.etag = None + self.priority = priority + self.rule_type = rule_type + self.rate_limit_duration_in_minutes = rate_limit_duration_in_minutes + self.rate_limit_threshold = rate_limit_threshold + self.match_conditions = match_conditions + self.action = action + self.transforms = transforms diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules.py new file mode 100644 index 000000000000..07a8252d1e11 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules.py @@ -0,0 +1,28 @@ +# 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 CustomRules(Model): + """Defines contents of custom rules. + + :param rules: List of rules + :type rules: list[~azure.mgmt.frontdoor.models.CustomRule] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[CustomRule]'}, + } + + def __init__(self, **kwargs): + super(CustomRules, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules_py3.py new file mode 100644 index 000000000000..ced7af11f141 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules_py3.py @@ -0,0 +1,28 @@ +# 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 CustomRules(Model): + """Defines contents of custom rules. + + :param rules: List of rules + :type rules: list[~azure.mgmt.frontdoor.models.CustomRule] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[CustomRule]'}, + } + + def __init__(self, *, rules=None, **kwargs) -> None: + super(CustomRules, self).__init__(**kwargs) + self.rules = rules diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error.py new file mode 100644 index 000000000000..567bee542aee --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error.py @@ -0,0 +1,44 @@ +# 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 Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.frontdoor.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_details.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_details.py new file mode 100644 index 000000000000..a8c4da6ba955 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_details.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 ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_details_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_details_py3.py new file mode 100644 index 000000000000..d791f0895345 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_details_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 ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_py3.py new file mode 100644 index 000000000000..7b5bb62ce327 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_py3.py @@ -0,0 +1,44 @@ +# 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 Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.frontdoor.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_response.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_response.py new file mode 100644 index 000000000000..6a4694c831b1 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_response.py @@ -0,0 +1,54 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response indicates Front Door service is not able to process the + incoming request. The reason is provided in the error message. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_response_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_response_py3.py new file mode 100644 index 000000000000..f1b2dcd4012b --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/error_response_py3.py @@ -0,0 +1,54 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response indicates Front Door service is not able to process the + incoming request. The reason is provided in the error message. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door.py new file mode 100644 index 000000000000..2893d3972dd0 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door.py @@ -0,0 +1,102 @@ +# 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 .resource import Resource + + +class FrontDoor(Resource): + """Front Door represents a collection of backend endpoints to route traffic to + along with rules that specify how traffic is sent there. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param friendly_name: A friendly name for the frontDoor + :type friendly_name: str + :param routing_rules: Routing rules associated with this Front Door. + :type routing_rules: list[~azure.mgmt.frontdoor.models.RoutingRule] + :param load_balancing_settings: Load balancing settings associated with + this Front Door instance. + :type load_balancing_settings: + list[~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel] + :param health_probe_settings: Health probe settings associated with this + Front Door instance. + :type health_probe_settings: + list[~azure.mgmt.frontdoor.models.HealthProbeSettingsModel] + :param backend_pools: Backend pools available to routing rules. + :type backend_pools: list[~azure.mgmt.frontdoor.models.BackendPool] + :param frontend_endpoints: Frontend endpoints available to routing rules. + :type frontend_endpoints: + list[~azure.mgmt.frontdoor.models.FrontendEndpoint] + :param enabled_state: Operational status of the Front Door load balancer. + Permitted values are 'Enabled' or 'Disabled'. Possible values include: + 'Enabled', 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + :param resource_state: Resource status of the Front Door. Possible values + include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :ivar provisioning_state: Provisioning state of the Front Door. + :vartype provisioning_state: str + :ivar cname: The host that each frontendEndpoint must CNAME to. + :vartype cname: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'cname': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'routing_rules': {'key': 'properties.routingRules', 'type': '[RoutingRule]'}, + 'load_balancing_settings': {'key': 'properties.loadBalancingSettings', 'type': '[LoadBalancingSettingsModel]'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': '[HealthProbeSettingsModel]'}, + 'backend_pools': {'key': 'properties.backendPools', 'type': '[BackendPool]'}, + 'frontend_endpoints': {'key': 'properties.frontendEndpoints', 'type': '[FrontendEndpoint]'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'cname': {'key': 'properties.cname', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FrontDoor, self).__init__(**kwargs) + self.friendly_name = kwargs.get('friendly_name', None) + self.routing_rules = kwargs.get('routing_rules', None) + self.load_balancing_settings = kwargs.get('load_balancing_settings', None) + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.backend_pools = kwargs.get('backend_pools', None) + self.frontend_endpoints = kwargs.get('frontend_endpoints', None) + self.enabled_state = kwargs.get('enabled_state', None) + self.resource_state = kwargs.get('resource_state', None) + self.provisioning_state = None + self.cname = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py new file mode 100644 index 000000000000..069909cf497c --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py @@ -0,0 +1,195 @@ +# 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 enum import Enum + + +class FrontDoorResourceState(str, Enum): + + creating = "Creating" + enabling = "Enabling" + enabled = "Enabled" + disabling = "Disabling" + disabled = "Disabled" + deleting = "Deleting" + + +class CustomHttpsProvisioningState(str, Enum): + + enabling = "Enabling" + enabled = "Enabled" + disabling = "Disabling" + disabled = "Disabled" + failed = "Failed" + + +class CustomHttpsProvisioningSubstate(str, Enum): + + submitting_domain_control_validation_request = "SubmittingDomainControlValidationRequest" + pending_domain_control_validation_request_approval = "PendingDomainControlValidationREquestApproval" + domain_control_validation_request_approved = "DomainControlValidationRequestApproved" + domain_control_validation_request_rejected = "DomainControlValidationRequestRejected" + domain_control_validation_request_timed_out = "DomainControlValidationRequestTimedOut" + issuing_certificate = "IssuingCertificate" + deploying_certificate = "DeployingCertificate" + certificate_deployed = "CertificateDeployed" + deleting_certificate = "DeletingCertificate" + certificate_deleted = "CertificateDeleted" + + +class FrontDoorCertificateSource(str, Enum): + + azure_key_vault = "AzureKeyVault" + front_door = "FrontDoor" + + +class FrontDoorTlsProtocolType(str, Enum): + + server_name_indication = "ServerNameIndication" + + +class FrontDoorCertificateType(str, Enum): + + dedicated = "Dedicated" + + +class FrontDoorEnabledState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class FrontDoorProtocol(str, Enum): + + http = "Http" + https = "Https" + + +class FrontDoorForwardingProtocol(str, Enum): + + http_only = "HttpOnly" + https_only = "HttpsOnly" + match_request = "MatchRequest" + + +class FrontDoorQuery(str, Enum): + + strip_none = "StripNone" + strip_all = "StripAll" + + +class DynamicCompressionEnabled(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class SessionAffinityEnabledState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class ResourceType(str, Enum): + + microsoft_networkfront_doors = "Microsoft.Network/frontDoors" + microsoft_networkfront_doorsfrontend_endpoints = "Microsoft.Network/frontDoors/frontendEndpoints" + + +class Availability(str, Enum): + + available = "Available" + unavailable = "Unavailable" + + +class NetworkOperationStatus(str, Enum): + + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + + +class EnabledState(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + +class Mode(str, Enum): + + prevention = "Prevention" + detection = "Detection" + + +class RuleType(str, Enum): + + match_rule = "MatchRule" + rate_limit_rule = "RateLimitRule" + + +class MatchCondition(str, Enum): + + remote_addr = "RemoteAddr" + request_method = "RequestMethod" + query_string = "QueryString" + post_args = "PostArgs" + request_uri = "RequestUri" + request_header = "RequestHeader" + request_body = "RequestBody" + + +class Operator(str, Enum): + + any = "Any" + ip_match = "IPMatch" + geo_match = "GeoMatch" + equal = "Equal" + contains = "Contains" + less_than = "LessThan" + greater_than = "GreaterThan" + less_than_or_equal = "LessThanOrEqual" + greater_than_or_equal = "GreaterThanOrEqual" + begins_with = "BeginsWith" + ends_with = "EndsWith" + + +class Action(str, Enum): + + allow = "Allow" + block = "Block" + log = "Log" + + +class Transform(str, Enum): + + lowercase = "Lowercase" + uppercase = "Uppercase" + trim = "Trim" + url_decode = "UrlDecode" + url_encode = "UrlEncode" + remove_nulls = "RemoveNulls" + html_entity_decode = "HtmlEntityDecode" + + +class WebApplicationFirewallPolicy(str, Enum): + + creating = "Creating" + enabling = "Enabling" + enabled = "Enabled" + disabling = "Disabling" + disabled = "Disabled" + deleting = "Deleting" + + +class RuleGroupOverride(str, Enum): + + sql_injection = "SqlInjection" + xss = "XSS" diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_paged.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_paged.py new file mode 100644 index 000000000000..b7bf875fe8e9 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class FrontDoorPaged(Paged): + """ + A paging container for iterating over a list of :class:`FrontDoor ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[FrontDoor]'} + } + + def __init__(self, *args, **kwargs): + + super(FrontDoorPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_py3.py new file mode 100644 index 000000000000..1af837e68018 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_py3.py @@ -0,0 +1,102 @@ +# 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 .resource_py3 import Resource + + +class FrontDoor(Resource): + """Front Door represents a collection of backend endpoints to route traffic to + along with rules that specify how traffic is sent there. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param friendly_name: A friendly name for the frontDoor + :type friendly_name: str + :param routing_rules: Routing rules associated with this Front Door. + :type routing_rules: list[~azure.mgmt.frontdoor.models.RoutingRule] + :param load_balancing_settings: Load balancing settings associated with + this Front Door instance. + :type load_balancing_settings: + list[~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel] + :param health_probe_settings: Health probe settings associated with this + Front Door instance. + :type health_probe_settings: + list[~azure.mgmt.frontdoor.models.HealthProbeSettingsModel] + :param backend_pools: Backend pools available to routing rules. + :type backend_pools: list[~azure.mgmt.frontdoor.models.BackendPool] + :param frontend_endpoints: Frontend endpoints available to routing rules. + :type frontend_endpoints: + list[~azure.mgmt.frontdoor.models.FrontendEndpoint] + :param enabled_state: Operational status of the Front Door load balancer. + Permitted values are 'Enabled' or 'Disabled'. Possible values include: + 'Enabled', 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + :param resource_state: Resource status of the Front Door. Possible values + include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :ivar provisioning_state: Provisioning state of the Front Door. + :vartype provisioning_state: str + :ivar cname: The host that each frontendEndpoint must CNAME to. + :vartype cname: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'cname': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'routing_rules': {'key': 'properties.routingRules', 'type': '[RoutingRule]'}, + 'load_balancing_settings': {'key': 'properties.loadBalancingSettings', 'type': '[LoadBalancingSettingsModel]'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': '[HealthProbeSettingsModel]'}, + 'backend_pools': {'key': 'properties.backendPools', 'type': '[BackendPool]'}, + 'frontend_endpoints': {'key': 'properties.frontendEndpoints', 'type': '[FrontendEndpoint]'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'cname': {'key': 'properties.cname', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, friendly_name: str=None, routing_rules=None, load_balancing_settings=None, health_probe_settings=None, backend_pools=None, frontend_endpoints=None, enabled_state=None, resource_state=None, **kwargs) -> None: + super(FrontDoor, self).__init__(location=location, tags=tags, **kwargs) + self.friendly_name = friendly_name + self.routing_rules = routing_rules + self.load_balancing_settings = load_balancing_settings + self.health_probe_settings = health_probe_settings + self.backend_pools = backend_pools + self.frontend_endpoints = frontend_endpoints + self.enabled_state = enabled_state + self.resource_state = resource_state + self.provisioning_state = None + self.cname = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters.py new file mode 100644 index 000000000000..9411f5c42c12 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters.py @@ -0,0 +1,60 @@ +# 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 FrontDoorUpdateParameters(Model): + """The properties needed to update a Front Door. + + :param friendly_name: A friendly name for the frontDoor + :type friendly_name: str + :param routing_rules: Routing rules associated with this Front Door. + :type routing_rules: list[~azure.mgmt.frontdoor.models.RoutingRule] + :param load_balancing_settings: Load balancing settings associated with + this Front Door instance. + :type load_balancing_settings: + list[~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel] + :param health_probe_settings: Health probe settings associated with this + Front Door instance. + :type health_probe_settings: + list[~azure.mgmt.frontdoor.models.HealthProbeSettingsModel] + :param backend_pools: Backend pools available to routing rules. + :type backend_pools: list[~azure.mgmt.frontdoor.models.BackendPool] + :param frontend_endpoints: Frontend endpoints available to routing rules. + :type frontend_endpoints: + list[~azure.mgmt.frontdoor.models.FrontendEndpoint] + :param enabled_state: Operational status of the Front Door load balancer. + Permitted values are 'Enabled' or 'Disabled'. Possible values include: + 'Enabled', 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + """ + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'routing_rules': {'key': 'routingRules', 'type': '[RoutingRule]'}, + 'load_balancing_settings': {'key': 'loadBalancingSettings', 'type': '[LoadBalancingSettingsModel]'}, + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': '[HealthProbeSettingsModel]'}, + 'backend_pools': {'key': 'backendPools', 'type': '[BackendPool]'}, + 'frontend_endpoints': {'key': 'frontendEndpoints', 'type': '[FrontendEndpoint]'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FrontDoorUpdateParameters, self).__init__(**kwargs) + self.friendly_name = kwargs.get('friendly_name', None) + self.routing_rules = kwargs.get('routing_rules', None) + self.load_balancing_settings = kwargs.get('load_balancing_settings', None) + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.backend_pools = kwargs.get('backend_pools', None) + self.frontend_endpoints = kwargs.get('frontend_endpoints', None) + self.enabled_state = kwargs.get('enabled_state', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters_py3.py new file mode 100644 index 000000000000..127259641e8c --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters_py3.py @@ -0,0 +1,60 @@ +# 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 FrontDoorUpdateParameters(Model): + """The properties needed to update a Front Door. + + :param friendly_name: A friendly name for the frontDoor + :type friendly_name: str + :param routing_rules: Routing rules associated with this Front Door. + :type routing_rules: list[~azure.mgmt.frontdoor.models.RoutingRule] + :param load_balancing_settings: Load balancing settings associated with + this Front Door instance. + :type load_balancing_settings: + list[~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel] + :param health_probe_settings: Health probe settings associated with this + Front Door instance. + :type health_probe_settings: + list[~azure.mgmt.frontdoor.models.HealthProbeSettingsModel] + :param backend_pools: Backend pools available to routing rules. + :type backend_pools: list[~azure.mgmt.frontdoor.models.BackendPool] + :param frontend_endpoints: Frontend endpoints available to routing rules. + :type frontend_endpoints: + list[~azure.mgmt.frontdoor.models.FrontendEndpoint] + :param enabled_state: Operational status of the Front Door load balancer. + Permitted values are 'Enabled' or 'Disabled'. Possible values include: + 'Enabled', 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + """ + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'routing_rules': {'key': 'routingRules', 'type': '[RoutingRule]'}, + 'load_balancing_settings': {'key': 'loadBalancingSettings', 'type': '[LoadBalancingSettingsModel]'}, + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': '[HealthProbeSettingsModel]'}, + 'backend_pools': {'key': 'backendPools', 'type': '[BackendPool]'}, + 'frontend_endpoints': {'key': 'frontendEndpoints', 'type': '[FrontendEndpoint]'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + } + + def __init__(self, *, friendly_name: str=None, routing_rules=None, load_balancing_settings=None, health_probe_settings=None, backend_pools=None, frontend_endpoints=None, enabled_state=None, **kwargs) -> None: + super(FrontDoorUpdateParameters, self).__init__(**kwargs) + self.friendly_name = friendly_name + self.routing_rules = routing_rules + self.load_balancing_settings = load_balancing_settings + self.health_probe_settings = health_probe_settings + self.backend_pools = backend_pools + self.frontend_endpoints = frontend_endpoints + self.enabled_state = enabled_state diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint.py new file mode 100644 index 000000000000..09e5af405c3e --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint.py @@ -0,0 +1,100 @@ +# 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 .sub_resource import SubResource + + +class FrontendEndpoint(SubResource): + """A frontend endpoint used for routing. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param host_name: The host name of the frontendEndpoint. Must be a domain + name. + :type host_name: str + :param session_affinity_enabled_state: Whether to allow session affinity + on this host. Valid options are 'Enabled' or 'Disabled'. Possible values + include: 'Enabled', 'Disabled' + :type session_affinity_enabled_state: str or + ~azure.mgmt.frontdoor.models.SessionAffinityEnabledState + :param session_affinity_ttl_seconds: UNUSED. This field will be ignored. + The TTL to use in seconds for session affinity, if applicable. + :type session_affinity_ttl_seconds: int + :param web_application_firewall_policy_link: Defines the Web Application + Firewall policy for each host (if applicable) + :type web_application_firewall_policy_link: + ~azure.mgmt.frontdoor.models.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :ivar custom_https_provisioning_state: Provisioning status of Custom Https + of the frontendEndpoint. Possible values include: 'Enabling', 'Enabled', + 'Disabling', 'Disabled', 'Failed' + :vartype custom_https_provisioning_state: str or + ~azure.mgmt.frontdoor.models.CustomHttpsProvisioningState + :ivar custom_https_provisioning_substate: Provisioning substate shows the + progress of custom HTTPS enabling/disabling process step by step. Possible + values include: 'SubmittingDomainControlValidationRequest', + 'PendingDomainControlValidationREquestApproval', + 'DomainControlValidationRequestApproved', + 'DomainControlValidationRequestRejected', + 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', + 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', + 'CertificateDeleted' + :vartype custom_https_provisioning_substate: str or + ~azure.mgmt.frontdoor.models.CustomHttpsProvisioningSubstate + :ivar custom_https_configuration: The configuration specifying how to + enable HTTPS + :vartype custom_https_configuration: + ~azure.mgmt.frontdoor.models.CustomHttpsConfiguration + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'custom_https_provisioning_state': {'readonly': True}, + 'custom_https_provisioning_substate': {'readonly': True}, + 'custom_https_configuration': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'session_affinity_enabled_state': {'key': 'properties.sessionAffinityEnabledState', 'type': 'str'}, + 'session_affinity_ttl_seconds': {'key': 'properties.sessionAffinityTtlSeconds', 'type': 'int'}, + 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'custom_https_provisioning_state': {'key': 'properties.customHttpsProvisioningState', 'type': 'str'}, + 'custom_https_provisioning_substate': {'key': 'properties.customHttpsProvisioningSubstate', 'type': 'str'}, + 'custom_https_configuration': {'key': 'properties.customHttpsConfiguration', 'type': 'CustomHttpsConfiguration'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FrontendEndpoint, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) + self.session_affinity_enabled_state = kwargs.get('session_affinity_enabled_state', None) + self.session_affinity_ttl_seconds = kwargs.get('session_affinity_ttl_seconds', None) + self.web_application_firewall_policy_link = kwargs.get('web_application_firewall_policy_link', None) + self.resource_state = kwargs.get('resource_state', None) + self.custom_https_provisioning_state = None + self.custom_https_provisioning_substate = None + self.custom_https_configuration = None + self.name = kwargs.get('name', None) + self.type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_paged.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_paged.py new file mode 100644 index 000000000000..ed34b14ca85d --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class FrontendEndpointPaged(Paged): + """ + A paging container for iterating over a list of :class:`FrontendEndpoint ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[FrontendEndpoint]'} + } + + def __init__(self, *args, **kwargs): + + super(FrontendEndpointPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_py3.py new file mode 100644 index 000000000000..9bbb6d2a7fcd --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_py3.py @@ -0,0 +1,100 @@ +# 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 .sub_resource_py3 import SubResource + + +class FrontendEndpoint(SubResource): + """A frontend endpoint used for routing. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param host_name: The host name of the frontendEndpoint. Must be a domain + name. + :type host_name: str + :param session_affinity_enabled_state: Whether to allow session affinity + on this host. Valid options are 'Enabled' or 'Disabled'. Possible values + include: 'Enabled', 'Disabled' + :type session_affinity_enabled_state: str or + ~azure.mgmt.frontdoor.models.SessionAffinityEnabledState + :param session_affinity_ttl_seconds: UNUSED. This field will be ignored. + The TTL to use in seconds for session affinity, if applicable. + :type session_affinity_ttl_seconds: int + :param web_application_firewall_policy_link: Defines the Web Application + Firewall policy for each host (if applicable) + :type web_application_firewall_policy_link: + ~azure.mgmt.frontdoor.models.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :ivar custom_https_provisioning_state: Provisioning status of Custom Https + of the frontendEndpoint. Possible values include: 'Enabling', 'Enabled', + 'Disabling', 'Disabled', 'Failed' + :vartype custom_https_provisioning_state: str or + ~azure.mgmt.frontdoor.models.CustomHttpsProvisioningState + :ivar custom_https_provisioning_substate: Provisioning substate shows the + progress of custom HTTPS enabling/disabling process step by step. Possible + values include: 'SubmittingDomainControlValidationRequest', + 'PendingDomainControlValidationREquestApproval', + 'DomainControlValidationRequestApproved', + 'DomainControlValidationRequestRejected', + 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', + 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', + 'CertificateDeleted' + :vartype custom_https_provisioning_substate: str or + ~azure.mgmt.frontdoor.models.CustomHttpsProvisioningSubstate + :ivar custom_https_configuration: The configuration specifying how to + enable HTTPS + :vartype custom_https_configuration: + ~azure.mgmt.frontdoor.models.CustomHttpsConfiguration + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'custom_https_provisioning_state': {'readonly': True}, + 'custom_https_provisioning_substate': {'readonly': True}, + 'custom_https_configuration': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'session_affinity_enabled_state': {'key': 'properties.sessionAffinityEnabledState', 'type': 'str'}, + 'session_affinity_ttl_seconds': {'key': 'properties.sessionAffinityTtlSeconds', 'type': 'int'}, + 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'custom_https_provisioning_state': {'key': 'properties.customHttpsProvisioningState', 'type': 'str'}, + 'custom_https_provisioning_substate': {'key': 'properties.customHttpsProvisioningSubstate', 'type': 'str'}, + 'custom_https_configuration': {'key': 'properties.customHttpsConfiguration', 'type': 'CustomHttpsConfiguration'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, host_name: str=None, session_affinity_enabled_state=None, session_affinity_ttl_seconds: int=None, web_application_firewall_policy_link=None, resource_state=None, name: str=None, **kwargs) -> None: + super(FrontendEndpoint, self).__init__(id=id, **kwargs) + self.host_name = host_name + self.session_affinity_enabled_state = session_affinity_enabled_state + self.session_affinity_ttl_seconds = session_affinity_ttl_seconds + self.web_application_firewall_policy_link = web_application_firewall_policy_link + self.resource_state = resource_state + self.custom_https_provisioning_state = None + self.custom_https_provisioning_substate = None + self.custom_https_configuration = None + self.name = name + self.type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters.py new file mode 100644 index 000000000000..e1ac88018f11 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters.py @@ -0,0 +1,47 @@ +# 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 FrontendEndpointUpdateParameters(Model): + """Frontend endpoint used in routing rule. + + :param host_name: The host name of the frontendEndpoint. Must be a domain + name. + :type host_name: str + :param session_affinity_enabled_state: Whether to allow session affinity + on this host. Valid options are 'Enabled' or 'Disabled'. Possible values + include: 'Enabled', 'Disabled' + :type session_affinity_enabled_state: str or + ~azure.mgmt.frontdoor.models.SessionAffinityEnabledState + :param session_affinity_ttl_seconds: UNUSED. This field will be ignored. + The TTL to use in seconds for session affinity, if applicable. + :type session_affinity_ttl_seconds: int + :param web_application_firewall_policy_link: Defines the Web Application + Firewall policy for each host (if applicable) + :type web_application_firewall_policy_link: + ~azure.mgmt.frontdoor.models.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink + """ + + _attribute_map = { + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'session_affinity_enabled_state': {'key': 'sessionAffinityEnabledState', 'type': 'str'}, + 'session_affinity_ttl_seconds': {'key': 'sessionAffinityTtlSeconds', 'type': 'int'}, + 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink'}, + } + + def __init__(self, **kwargs): + super(FrontendEndpointUpdateParameters, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) + self.session_affinity_enabled_state = kwargs.get('session_affinity_enabled_state', None) + self.session_affinity_ttl_seconds = kwargs.get('session_affinity_ttl_seconds', None) + self.web_application_firewall_policy_link = kwargs.get('web_application_firewall_policy_link', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters_py3.py new file mode 100644 index 000000000000..48e1c1c132d8 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters_py3.py @@ -0,0 +1,47 @@ +# 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 FrontendEndpointUpdateParameters(Model): + """Frontend endpoint used in routing rule. + + :param host_name: The host name of the frontendEndpoint. Must be a domain + name. + :type host_name: str + :param session_affinity_enabled_state: Whether to allow session affinity + on this host. Valid options are 'Enabled' or 'Disabled'. Possible values + include: 'Enabled', 'Disabled' + :type session_affinity_enabled_state: str or + ~azure.mgmt.frontdoor.models.SessionAffinityEnabledState + :param session_affinity_ttl_seconds: UNUSED. This field will be ignored. + The TTL to use in seconds for session affinity, if applicable. + :type session_affinity_ttl_seconds: int + :param web_application_firewall_policy_link: Defines the Web Application + Firewall policy for each host (if applicable) + :type web_application_firewall_policy_link: + ~azure.mgmt.frontdoor.models.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink + """ + + _attribute_map = { + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'session_affinity_enabled_state': {'key': 'sessionAffinityEnabledState', 'type': 'str'}, + 'session_affinity_ttl_seconds': {'key': 'sessionAffinityTtlSeconds', 'type': 'int'}, + 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink'}, + } + + def __init__(self, *, host_name: str=None, session_affinity_enabled_state=None, session_affinity_ttl_seconds: int=None, web_application_firewall_policy_link=None, **kwargs) -> None: + super(FrontendEndpointUpdateParameters, self).__init__(**kwargs) + self.host_name = host_name + self.session_affinity_enabled_state = session_affinity_enabled_state + self.session_affinity_ttl_seconds = session_affinity_ttl_seconds + self.web_application_firewall_policy_link = web_application_firewall_policy_link diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters_web_application_firewall_policy_link.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters_web_application_firewall_policy_link.py new file mode 100644 index 000000000000..23847506919a --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters_web_application_firewall_policy_link.py @@ -0,0 +1,28 @@ +# 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 FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink(Model): + """Defines the Web Application Firewall policy for each host (if applicable). + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters_web_application_firewall_policy_link_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters_web_application_firewall_policy_link_py3.py new file mode 100644 index 000000000000..ae132742e144 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_update_parameters_web_application_firewall_policy_link_py3.py @@ -0,0 +1,28 @@ +# 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 FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink(Model): + """Defines the Web Application Firewall policy for each host (if applicable). + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model.py new file mode 100644 index 000000000000..693eb0cf1f40 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model.py @@ -0,0 +1,61 @@ +# 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 .sub_resource import SubResource + + +class HealthProbeSettingsModel(SubResource): + """Load balancing settings for a backend pool. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param path: The path to use for the health probe. Default is / + :type path: str + :param protocol: Protocol scheme to use for this probe. Possible values + include: 'Http', 'Https' + :type protocol: str or ~azure.mgmt.frontdoor.models.FrontDoorProtocol + :param interval_in_seconds: The number of seconds between health probes. + :type interval_in_seconds: int + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HealthProbeSettingsModel, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.protocol = kwargs.get('protocol', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.resource_state = kwargs.get('resource_state', None) + self.name = kwargs.get('name', None) + self.type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_paged.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_paged.py new file mode 100644 index 000000000000..8d368f07bcd9 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class HealthProbeSettingsModelPaged(Paged): + """ + A paging container for iterating over a list of :class:`HealthProbeSettingsModel ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[HealthProbeSettingsModel]'} + } + + def __init__(self, *args, **kwargs): + + super(HealthProbeSettingsModelPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_py3.py new file mode 100644 index 000000000000..ef1d1f5749b3 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_py3.py @@ -0,0 +1,61 @@ +# 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 .sub_resource_py3 import SubResource + + +class HealthProbeSettingsModel(SubResource): + """Load balancing settings for a backend pool. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param path: The path to use for the health probe. Default is / + :type path: str + :param protocol: Protocol scheme to use for this probe. Possible values + include: 'Http', 'Https' + :type protocol: str or ~azure.mgmt.frontdoor.models.FrontDoorProtocol + :param interval_in_seconds: The number of seconds between health probes. + :type interval_in_seconds: int + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, path: str=None, protocol=None, interval_in_seconds: int=None, resource_state=None, name: str=None, **kwargs) -> None: + super(HealthProbeSettingsModel, self).__init__(id=id, **kwargs) + self.path = path + self.protocol = protocol + self.interval_in_seconds = interval_in_seconds + self.resource_state = resource_state + self.name = name + self.type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters.py new file mode 100644 index 000000000000..a9bad070a4a2 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters.py @@ -0,0 +1,37 @@ +# 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 HealthProbeSettingsUpdateParameters(Model): + """L7 health probe settings for a backend pool. + + :param path: The path to use for the health probe. Default is / + :type path: str + :param protocol: Protocol scheme to use for this probe. Possible values + include: 'Http', 'Https' + :type protocol: str or ~azure.mgmt.frontdoor.models.FrontDoorProtocol + :param interval_in_seconds: The number of seconds between health probes. + :type interval_in_seconds: int + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'interval_in_seconds': {'key': 'intervalInSeconds', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(HealthProbeSettingsUpdateParameters, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.protocol = kwargs.get('protocol', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters_py3.py new file mode 100644 index 000000000000..21eeab0350aa --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters_py3.py @@ -0,0 +1,37 @@ +# 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 HealthProbeSettingsUpdateParameters(Model): + """L7 health probe settings for a backend pool. + + :param path: The path to use for the health probe. Default is / + :type path: str + :param protocol: Protocol scheme to use for this probe. Possible values + include: 'Http', 'Https' + :type protocol: str or ~azure.mgmt.frontdoor.models.FrontDoorProtocol + :param interval_in_seconds: The number of seconds between health probes. + :type interval_in_seconds: int + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'interval_in_seconds': {'key': 'intervalInSeconds', 'type': 'int'}, + } + + def __init__(self, *, path: str=None, protocol=None, interval_in_seconds: int=None, **kwargs) -> None: + super(HealthProbeSettingsUpdateParameters, self).__init__(**kwargs) + self.path = path + self.protocol = protocol + self.interval_in_seconds = interval_in_seconds diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/key_vault_certificate_source_parameters_vault.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/key_vault_certificate_source_parameters_vault.py new file mode 100644 index 000000000000..2b16e73e4ff7 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/key_vault_certificate_source_parameters_vault.py @@ -0,0 +1,28 @@ +# 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 KeyVaultCertificateSourceParametersVault(Model): + """The Key Vault containing the SSL certificate. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultCertificateSourceParametersVault, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/key_vault_certificate_source_parameters_vault_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/key_vault_certificate_source_parameters_vault_py3.py new file mode 100644 index 000000000000..d0fe4d0d8e83 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/key_vault_certificate_source_parameters_vault_py3.py @@ -0,0 +1,28 @@ +# 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 KeyVaultCertificateSourceParametersVault(Model): + """The Key Vault containing the SSL certificate. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(KeyVaultCertificateSourceParametersVault, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model.py new file mode 100644 index 000000000000..e0c8c97b65f8 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model.py @@ -0,0 +1,63 @@ +# 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 .sub_resource import SubResource + + +class LoadBalancingSettingsModel(SubResource): + """Load balancing settings for a backend pool. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param sample_size: The number of samples to consider for load balancing + decisions + :type sample_size: int + :param successful_samples_required: The number of samples within the + sample period that must succeed + :type successful_samples_required: int + :param additional_latency_milliseconds: The additional latency in + milliseconds for probes to fall into the lowest latency bucket + :type additional_latency_milliseconds: int + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'sample_size': {'key': 'properties.sampleSize', 'type': 'int'}, + 'successful_samples_required': {'key': 'properties.successfulSamplesRequired', 'type': 'int'}, + 'additional_latency_milliseconds': {'key': 'properties.additionalLatencyMilliseconds', 'type': 'int'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LoadBalancingSettingsModel, self).__init__(**kwargs) + self.sample_size = kwargs.get('sample_size', None) + self.successful_samples_required = kwargs.get('successful_samples_required', None) + self.additional_latency_milliseconds = kwargs.get('additional_latency_milliseconds', None) + self.resource_state = kwargs.get('resource_state', None) + self.name = kwargs.get('name', None) + self.type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model_paged.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model_paged.py new file mode 100644 index 000000000000..20d94f0be273 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class LoadBalancingSettingsModelPaged(Paged): + """ + A paging container for iterating over a list of :class:`LoadBalancingSettingsModel ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LoadBalancingSettingsModel]'} + } + + def __init__(self, *args, **kwargs): + + super(LoadBalancingSettingsModelPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model_py3.py new file mode 100644 index 000000000000..2649e0c4f5da --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model_py3.py @@ -0,0 +1,63 @@ +# 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 .sub_resource_py3 import SubResource + + +class LoadBalancingSettingsModel(SubResource): + """Load balancing settings for a backend pool. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param sample_size: The number of samples to consider for load balancing + decisions + :type sample_size: int + :param successful_samples_required: The number of samples within the + sample period that must succeed + :type successful_samples_required: int + :param additional_latency_milliseconds: The additional latency in + milliseconds for probes to fall into the lowest latency bucket + :type additional_latency_milliseconds: int + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'sample_size': {'key': 'properties.sampleSize', 'type': 'int'}, + 'successful_samples_required': {'key': 'properties.successfulSamplesRequired', 'type': 'int'}, + 'additional_latency_milliseconds': {'key': 'properties.additionalLatencyMilliseconds', 'type': 'int'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, sample_size: int=None, successful_samples_required: int=None, additional_latency_milliseconds: int=None, resource_state=None, name: str=None, **kwargs) -> None: + super(LoadBalancingSettingsModel, self).__init__(id=id, **kwargs) + self.sample_size = sample_size + self.successful_samples_required = successful_samples_required + self.additional_latency_milliseconds = additional_latency_milliseconds + self.resource_state = resource_state + self.name = name + self.type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_update_parameters.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_update_parameters.py new file mode 100644 index 000000000000..dd564be1172a --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_update_parameters.py @@ -0,0 +1,39 @@ +# 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 LoadBalancingSettingsUpdateParameters(Model): + """Round-Robin load balancing settings for a backend pool. + + :param sample_size: The number of samples to consider for load balancing + decisions + :type sample_size: int + :param successful_samples_required: The number of samples within the + sample period that must succeed + :type successful_samples_required: int + :param additional_latency_milliseconds: The additional latency in + milliseconds for probes to fall into the lowest latency bucket + :type additional_latency_milliseconds: int + """ + + _attribute_map = { + 'sample_size': {'key': 'sampleSize', 'type': 'int'}, + 'successful_samples_required': {'key': 'successfulSamplesRequired', 'type': 'int'}, + 'additional_latency_milliseconds': {'key': 'additionalLatencyMilliseconds', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(LoadBalancingSettingsUpdateParameters, self).__init__(**kwargs) + self.sample_size = kwargs.get('sample_size', None) + self.successful_samples_required = kwargs.get('successful_samples_required', None) + self.additional_latency_milliseconds = kwargs.get('additional_latency_milliseconds', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_update_parameters_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_update_parameters_py3.py new file mode 100644 index 000000000000..358090b0816c --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_update_parameters_py3.py @@ -0,0 +1,39 @@ +# 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 LoadBalancingSettingsUpdateParameters(Model): + """Round-Robin load balancing settings for a backend pool. + + :param sample_size: The number of samples to consider for load balancing + decisions + :type sample_size: int + :param successful_samples_required: The number of samples within the + sample period that must succeed + :type successful_samples_required: int + :param additional_latency_milliseconds: The additional latency in + milliseconds for probes to fall into the lowest latency bucket + :type additional_latency_milliseconds: int + """ + + _attribute_map = { + 'sample_size': {'key': 'sampleSize', 'type': 'int'}, + 'successful_samples_required': {'key': 'successfulSamplesRequired', 'type': 'int'}, + 'additional_latency_milliseconds': {'key': 'additionalLatencyMilliseconds', 'type': 'int'}, + } + + def __init__(self, *, sample_size: int=None, successful_samples_required: int=None, additional_latency_milliseconds: int=None, **kwargs) -> None: + super(LoadBalancingSettingsUpdateParameters, self).__init__(**kwargs) + self.sample_size = sample_size + self.successful_samples_required = successful_samples_required + self.additional_latency_milliseconds = additional_latency_milliseconds diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set.py new file mode 100644 index 000000000000..58c23333357c --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set.py @@ -0,0 +1,49 @@ +# 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 ManagedRuleSet(Model): + """Base class for all types of ManagedRuleSet. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureManagedRuleSet + + All required parameters must be populated in order to send to Azure. + + :param priority: Describes priority of the rule + :type priority: int + :param version: defines version of the rule set + :type version: int + :param rule_set_type: Required. Constant filled by server. + :type rule_set_type: str + """ + + _validation = { + 'rule_set_type': {'required': True}, + } + + _attribute_map = { + 'priority': {'key': 'priority', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'int'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + } + + _subtype_map = { + 'rule_set_type': {'AzureManagedRuleSet': 'AzureManagedRuleSet'} + } + + def __init__(self, **kwargs): + super(ManagedRuleSet, self).__init__(**kwargs) + self.priority = kwargs.get('priority', None) + self.version = kwargs.get('version', None) + self.rule_set_type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_py3.py new file mode 100644 index 000000000000..423d1317f6ca --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_py3.py @@ -0,0 +1,49 @@ +# 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 ManagedRuleSet(Model): + """Base class for all types of ManagedRuleSet. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureManagedRuleSet + + All required parameters must be populated in order to send to Azure. + + :param priority: Describes priority of the rule + :type priority: int + :param version: defines version of the rule set + :type version: int + :param rule_set_type: Required. Constant filled by server. + :type rule_set_type: str + """ + + _validation = { + 'rule_set_type': {'required': True}, + } + + _attribute_map = { + 'priority': {'key': 'priority', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'int'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + } + + _subtype_map = { + 'rule_set_type': {'AzureManagedRuleSet': 'AzureManagedRuleSet'} + } + + def __init__(self, *, priority: int=None, version: int=None, **kwargs) -> None: + super(ManagedRuleSet, self).__init__(**kwargs) + self.priority = priority + self.version = version + self.rule_set_type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets.py new file mode 100644 index 000000000000..37e70e26f118 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets.py @@ -0,0 +1,28 @@ +# 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 ManagedRuleSets(Model): + """Defines ManagedRuleSets - array of managedRuleSet. + + :param rule_sets: List of rules + :type rule_sets: list[~azure.mgmt.frontdoor.models.ManagedRuleSet] + """ + + _attribute_map = { + 'rule_sets': {'key': 'ruleSets', 'type': '[ManagedRuleSet]'}, + } + + def __init__(self, **kwargs): + super(ManagedRuleSets, self).__init__(**kwargs) + self.rule_sets = kwargs.get('rule_sets', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets_py3.py new file mode 100644 index 000000000000..48f15606ed69 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets_py3.py @@ -0,0 +1,28 @@ +# 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 ManagedRuleSets(Model): + """Defines ManagedRuleSets - array of managedRuleSet. + + :param rule_sets: List of rules + :type rule_sets: list[~azure.mgmt.frontdoor.models.ManagedRuleSet] + """ + + _attribute_map = { + 'rule_sets': {'key': 'ruleSets', 'type': '[ManagedRuleSet]'}, + } + + def __init__(self, *, rule_sets=None, **kwargs) -> None: + super(ManagedRuleSets, self).__init__(**kwargs) + self.rule_sets = rule_sets diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1.py new file mode 100644 index 000000000000..6667f15c68c9 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1.py @@ -0,0 +1,58 @@ +# 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 MatchCondition1(Model): + """Define match conditions. + + All required parameters must be populated in order to send to Azure. + + :param match_variable: Required. Match Variable. Possible values include: + 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', + 'RequestHeader', 'RequestBody' + :type match_variable: str or ~azure.mgmt.frontdoor.models.MatchCondition + :param selector: Name of selector in RequestHeader or RequestBody to be + matched + :type selector: str + :param operator: Required. Describes operator to be matched. Possible + values include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains', + 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', + 'BeginsWith', 'EndsWith' + :type operator: str or ~azure.mgmt.frontdoor.models.Operator + :param negate_condition: Describes if this is negate condition or not + :type negate_condition: bool + :param match_value: Required. Match value + :type match_value: list[str] + """ + + _validation = { + 'match_variable': {'required': True}, + 'operator': {'required': True}, + 'match_value': {'required': True}, + } + + _attribute_map = { + 'match_variable': {'key': 'matchVariable', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_value': {'key': 'matchValue', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(MatchCondition1, self).__init__(**kwargs) + self.match_variable = kwargs.get('match_variable', None) + self.selector = kwargs.get('selector', None) + self.operator = kwargs.get('operator', None) + self.negate_condition = kwargs.get('negate_condition', None) + self.match_value = kwargs.get('match_value', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1_py3.py new file mode 100644 index 000000000000..827eae5fc708 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1_py3.py @@ -0,0 +1,58 @@ +# 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 MatchCondition1(Model): + """Define match conditions. + + All required parameters must be populated in order to send to Azure. + + :param match_variable: Required. Match Variable. Possible values include: + 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', + 'RequestHeader', 'RequestBody' + :type match_variable: str or ~azure.mgmt.frontdoor.models.MatchCondition + :param selector: Name of selector in RequestHeader or RequestBody to be + matched + :type selector: str + :param operator: Required. Describes operator to be matched. Possible + values include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains', + 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', + 'BeginsWith', 'EndsWith' + :type operator: str or ~azure.mgmt.frontdoor.models.Operator + :param negate_condition: Describes if this is negate condition or not + :type negate_condition: bool + :param match_value: Required. Match value + :type match_value: list[str] + """ + + _validation = { + 'match_variable': {'required': True}, + 'operator': {'required': True}, + 'match_value': {'required': True}, + } + + _attribute_map = { + 'match_variable': {'key': 'matchVariable', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_value': {'key': 'matchValue', 'type': '[str]'}, + } + + def __init__(self, *, match_variable, operator, match_value, selector: str=None, negate_condition: bool=None, **kwargs) -> None: + super(MatchCondition1, self).__init__(**kwargs) + self.match_variable = match_variable + self.selector = selector + self.operator = operator + self.negate_condition = negate_condition + self.match_value = match_value diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings.py new file mode 100644 index 000000000000..3046acd2c7ac --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings.py @@ -0,0 +1,34 @@ +# 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 PolicySettings(Model): + """Defines contents of a web application firewall global configuration. + + :param enabled_state: describes if the policy is in enabled state or + disabled state. Possible values include: 'Disabled', 'Enabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.EnabledState + :param mode: Describes if it is in detection mode or prevention mode at + policy level. Possible values include: 'Prevention', 'Detection' + :type mode: str or ~azure.mgmt.frontdoor.models.Mode + """ + + _attribute_map = { + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PolicySettings, self).__init__(**kwargs) + self.enabled_state = kwargs.get('enabled_state', None) + self.mode = kwargs.get('mode', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings_py3.py new file mode 100644 index 000000000000..95244a4a4274 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings_py3.py @@ -0,0 +1,34 @@ +# 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 PolicySettings(Model): + """Defines contents of a web application firewall global configuration. + + :param enabled_state: describes if the policy is in enabled state or + disabled state. Possible values include: 'Disabled', 'Enabled' + :type enabled_state: str or ~azure.mgmt.frontdoor.models.EnabledState + :param mode: Describes if it is in detection mode or prevention mode at + policy level. Possible values include: 'Prevention', 'Detection' + :type mode: str or ~azure.mgmt.frontdoor.models.Mode + """ + + _attribute_map = { + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, *, enabled_state=None, mode=None, **kwargs) -> None: + super(PolicySettings, self).__init__(**kwargs) + self.enabled_state = enabled_state + self.mode = mode diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/purge_parameters.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/purge_parameters.py new file mode 100644 index 000000000000..4731664fed6a --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/purge_parameters.py @@ -0,0 +1,35 @@ +# 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 PurgeParameters(Model): + """Parameters required for content purge. + + All required parameters must be populated in order to send to Azure. + + :param content_paths: Required. The path to the content to be purged. Can + describe a file path or a wild card directory. + :type content_paths: list[str] + """ + + _validation = { + 'content_paths': {'required': True}, + } + + _attribute_map = { + 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PurgeParameters, self).__init__(**kwargs) + self.content_paths = kwargs.get('content_paths', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/purge_parameters_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/purge_parameters_py3.py new file mode 100644 index 000000000000..31cdefb06e5b --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/purge_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 PurgeParameters(Model): + """Parameters required for content purge. + + All required parameters must be populated in order to send to Azure. + + :param content_paths: Required. The path to the content to be purged. Can + describe a file path or a wild card directory. + :type content_paths: list[str] + """ + + _validation = { + 'content_paths': {'required': True}, + } + + _attribute_map = { + 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + } + + def __init__(self, *, content_paths, **kwargs) -> None: + super(PurgeParameters, self).__init__(**kwargs) + self.content_paths = content_paths diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/resource.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/resource.py new file mode 100644 index 000000000000..17bd2e2618cd --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/resource.py @@ -0,0 +1,53 @@ +# 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 Resource(Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/resource_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/resource_py3.py new file mode 100644 index 000000000000..aa539104c2f4 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/resource_py3.py @@ -0,0 +1,53 @@ +# 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 Resource(Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule.py new file mode 100644 index 000000000000..90e6d8aa71fd --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule.py @@ -0,0 +1,91 @@ +# 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 .sub_resource import SubResource + + +class RoutingRule(SubResource): + """A routing rule represents a specification for traffic to treat and where to + send it, along with health probe information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_endpoints: Frontend endpoints associated with this rule + :type frontend_endpoints: list[~azure.mgmt.frontdoor.models.SubResource] + :param accepted_protocols: Protocol schemes to match for this rule + :type accepted_protocols: list[str or + ~azure.mgmt.frontdoor.models.FrontDoorProtocol] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param custom_forwarding_path: A custom path used to rewrite resource + paths matched by this rule. Leave empty to use incoming path. + :type custom_forwarding_path: str + :param forwarding_protocol: Protocol this rule will use when forwarding + traffic to backends. Possible values include: 'HttpOnly', 'HttpsOnly', + 'MatchRequest' + :type forwarding_protocol: str or + ~azure.mgmt.frontdoor.models.FrontDoorForwardingProtocol + :param cache_configuration: The caching configuration associated with this + rule. + :type cache_configuration: ~azure.mgmt.frontdoor.models.CacheConfiguration + :param backend_pool: A reference to the BackendPool which this rule routes + to. + :type backend_pool: ~azure.mgmt.frontdoor.models.SubResource + :param enabled_state: Whether to enable use of this rule. Permitted values + are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_endpoints': {'key': 'properties.frontendEndpoints', 'type': '[SubResource]'}, + 'accepted_protocols': {'key': 'properties.acceptedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'properties.patternsToMatch', 'type': '[str]'}, + 'custom_forwarding_path': {'key': 'properties.customForwardingPath', 'type': 'str'}, + 'forwarding_protocol': {'key': 'properties.forwardingProtocol', 'type': 'str'}, + 'cache_configuration': {'key': 'properties.cacheConfiguration', 'type': 'CacheConfiguration'}, + 'backend_pool': {'key': 'properties.backendPool', 'type': 'SubResource'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoutingRule, self).__init__(**kwargs) + self.frontend_endpoints = kwargs.get('frontend_endpoints', None) + self.accepted_protocols = kwargs.get('accepted_protocols', None) + self.patterns_to_match = kwargs.get('patterns_to_match', None) + self.custom_forwarding_path = kwargs.get('custom_forwarding_path', None) + self.forwarding_protocol = kwargs.get('forwarding_protocol', None) + self.cache_configuration = kwargs.get('cache_configuration', None) + self.backend_pool = kwargs.get('backend_pool', None) + self.enabled_state = kwargs.get('enabled_state', None) + self.resource_state = kwargs.get('resource_state', None) + self.name = kwargs.get('name', None) + self.type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_paged.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_paged.py new file mode 100644 index 000000000000..f45f2a926a5d --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class RoutingRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`RoutingRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RoutingRule]'} + } + + def __init__(self, *args, **kwargs): + + super(RoutingRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_py3.py new file mode 100644 index 000000000000..75ab2b98b1ce --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_py3.py @@ -0,0 +1,91 @@ +# 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 .sub_resource_py3 import SubResource + + +class RoutingRule(SubResource): + """A routing rule represents a specification for traffic to treat and where to + send it, along with health probe information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_endpoints: Frontend endpoints associated with this rule + :type frontend_endpoints: list[~azure.mgmt.frontdoor.models.SubResource] + :param accepted_protocols: Protocol schemes to match for this rule + :type accepted_protocols: list[str or + ~azure.mgmt.frontdoor.models.FrontDoorProtocol] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param custom_forwarding_path: A custom path used to rewrite resource + paths matched by this rule. Leave empty to use incoming path. + :type custom_forwarding_path: str + :param forwarding_protocol: Protocol this rule will use when forwarding + traffic to backends. Possible values include: 'HttpOnly', 'HttpsOnly', + 'MatchRequest' + :type forwarding_protocol: str or + ~azure.mgmt.frontdoor.models.FrontDoorForwardingProtocol + :param cache_configuration: The caching configuration associated with this + rule. + :type cache_configuration: ~azure.mgmt.frontdoor.models.CacheConfiguration + :param backend_pool: A reference to the BackendPool which this rule routes + to. + :type backend_pool: ~azure.mgmt.frontdoor.models.SubResource + :param enabled_state: Whether to enable use of this rule. Permitted values + are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_endpoints': {'key': 'properties.frontendEndpoints', 'type': '[SubResource]'}, + 'accepted_protocols': {'key': 'properties.acceptedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'properties.patternsToMatch', 'type': '[str]'}, + 'custom_forwarding_path': {'key': 'properties.customForwardingPath', 'type': 'str'}, + 'forwarding_protocol': {'key': 'properties.forwardingProtocol', 'type': 'str'}, + 'cache_configuration': {'key': 'properties.cacheConfiguration', 'type': 'CacheConfiguration'}, + 'backend_pool': {'key': 'properties.backendPool', 'type': 'SubResource'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_endpoints=None, accepted_protocols=None, patterns_to_match=None, custom_forwarding_path: str=None, forwarding_protocol=None, cache_configuration=None, backend_pool=None, enabled_state=None, resource_state=None, name: str=None, **kwargs) -> None: + super(RoutingRule, self).__init__(id=id, **kwargs) + self.frontend_endpoints = frontend_endpoints + self.accepted_protocols = accepted_protocols + self.patterns_to_match = patterns_to_match + self.custom_forwarding_path = custom_forwarding_path + self.forwarding_protocol = forwarding_protocol + self.cache_configuration = cache_configuration + self.backend_pool = backend_pool + self.enabled_state = enabled_state + self.resource_state = resource_state + self.name = name + self.type = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters.py new file mode 100644 index 000000000000..53a05bba5023 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters.py @@ -0,0 +1,66 @@ +# 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 RoutingRuleUpdateParameters(Model): + """Routing rules to apply to an endpoint. + + :param frontend_endpoints: Frontend endpoints associated with this rule + :type frontend_endpoints: list[~azure.mgmt.frontdoor.models.SubResource] + :param accepted_protocols: Protocol schemes to match for this rule + :type accepted_protocols: list[str or + ~azure.mgmt.frontdoor.models.FrontDoorProtocol] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param custom_forwarding_path: A custom path used to rewrite resource + paths matched by this rule. Leave empty to use incoming path. + :type custom_forwarding_path: str + :param forwarding_protocol: Protocol this rule will use when forwarding + traffic to backends. Possible values include: 'HttpOnly', 'HttpsOnly', + 'MatchRequest' + :type forwarding_protocol: str or + ~azure.mgmt.frontdoor.models.FrontDoorForwardingProtocol + :param cache_configuration: The caching configuration associated with this + rule. + :type cache_configuration: ~azure.mgmt.frontdoor.models.CacheConfiguration + :param backend_pool: A reference to the BackendPool which this rule routes + to. + :type backend_pool: ~azure.mgmt.frontdoor.models.SubResource + :param enabled_state: Whether to enable use of this rule. Permitted values + are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + """ + + _attribute_map = { + 'frontend_endpoints': {'key': 'frontendEndpoints', 'type': '[SubResource]'}, + 'accepted_protocols': {'key': 'acceptedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'patternsToMatch', 'type': '[str]'}, + 'custom_forwarding_path': {'key': 'customForwardingPath', 'type': 'str'}, + 'forwarding_protocol': {'key': 'forwardingProtocol', 'type': 'str'}, + 'cache_configuration': {'key': 'cacheConfiguration', 'type': 'CacheConfiguration'}, + 'backend_pool': {'key': 'backendPool', 'type': 'SubResource'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoutingRuleUpdateParameters, self).__init__(**kwargs) + self.frontend_endpoints = kwargs.get('frontend_endpoints', None) + self.accepted_protocols = kwargs.get('accepted_protocols', None) + self.patterns_to_match = kwargs.get('patterns_to_match', None) + self.custom_forwarding_path = kwargs.get('custom_forwarding_path', None) + self.forwarding_protocol = kwargs.get('forwarding_protocol', None) + self.cache_configuration = kwargs.get('cache_configuration', None) + self.backend_pool = kwargs.get('backend_pool', None) + self.enabled_state = kwargs.get('enabled_state', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters_py3.py new file mode 100644 index 000000000000..473dfd8888c9 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters_py3.py @@ -0,0 +1,66 @@ +# 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 RoutingRuleUpdateParameters(Model): + """Routing rules to apply to an endpoint. + + :param frontend_endpoints: Frontend endpoints associated with this rule + :type frontend_endpoints: list[~azure.mgmt.frontdoor.models.SubResource] + :param accepted_protocols: Protocol schemes to match for this rule + :type accepted_protocols: list[str or + ~azure.mgmt.frontdoor.models.FrontDoorProtocol] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param custom_forwarding_path: A custom path used to rewrite resource + paths matched by this rule. Leave empty to use incoming path. + :type custom_forwarding_path: str + :param forwarding_protocol: Protocol this rule will use when forwarding + traffic to backends. Possible values include: 'HttpOnly', 'HttpsOnly', + 'MatchRequest' + :type forwarding_protocol: str or + ~azure.mgmt.frontdoor.models.FrontDoorForwardingProtocol + :param cache_configuration: The caching configuration associated with this + rule. + :type cache_configuration: ~azure.mgmt.frontdoor.models.CacheConfiguration + :param backend_pool: A reference to the BackendPool which this rule routes + to. + :type backend_pool: ~azure.mgmt.frontdoor.models.SubResource + :param enabled_state: Whether to enable use of this rule. Permitted values + are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + """ + + _attribute_map = { + 'frontend_endpoints': {'key': 'frontendEndpoints', 'type': '[SubResource]'}, + 'accepted_protocols': {'key': 'acceptedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'patternsToMatch', 'type': '[str]'}, + 'custom_forwarding_path': {'key': 'customForwardingPath', 'type': 'str'}, + 'forwarding_protocol': {'key': 'forwardingProtocol', 'type': 'str'}, + 'cache_configuration': {'key': 'cacheConfiguration', 'type': 'CacheConfiguration'}, + 'backend_pool': {'key': 'backendPool', 'type': 'SubResource'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + } + + def __init__(self, *, frontend_endpoints=None, accepted_protocols=None, patterns_to_match=None, custom_forwarding_path: str=None, forwarding_protocol=None, cache_configuration=None, backend_pool=None, enabled_state=None, **kwargs) -> None: + super(RoutingRuleUpdateParameters, self).__init__(**kwargs) + self.frontend_endpoints = frontend_endpoints + self.accepted_protocols = accepted_protocols + self.patterns_to_match = patterns_to_match + self.custom_forwarding_path = custom_forwarding_path + self.forwarding_protocol = forwarding_protocol + self.cache_configuration = cache_configuration + self.backend_pool = backend_pool + self.enabled_state = enabled_state diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/sub_resource.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/sub_resource.py new file mode 100644 index 000000000000..6ab81f55f21b --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/sub_resource.py @@ -0,0 +1,28 @@ +# 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 SubResource(Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/sub_resource_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/sub_resource_py3.py new file mode 100644 index 000000000000..8f4c4c816061 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# 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 SubResource(Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/tags_object.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/tags_object.py new file mode 100644 index 000000000000..2966ec220f94 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/tags_object.py @@ -0,0 +1,28 @@ +# 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 TagsObject(Model): + """Tags object for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TagsObject, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/tags_object_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/tags_object_py3.py new file mode 100644 index 000000000000..8be0bb4a15d7 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/tags_object_py3.py @@ -0,0 +1,28 @@ +# 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 TagsObject(Model): + """Tags object for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsObject, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_input.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_input.py new file mode 100644 index 000000000000..5ccf7293966d --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_input.py @@ -0,0 +1,35 @@ +# 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 ValidateCustomDomainInput(Model): + """Input of the custom domain to be validated for DNS mapping. + + All required parameters must be populated in order to send to Azure. + + :param host_name: Required. The host name of the custom domain. Must be a + domain name. + :type host_name: str + """ + + _validation = { + 'host_name': {'required': True}, + } + + _attribute_map = { + 'host_name': {'key': 'hostName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidateCustomDomainInput, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_input_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_input_py3.py new file mode 100644 index 000000000000..ad915548dba8 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_input_py3.py @@ -0,0 +1,35 @@ +# 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 ValidateCustomDomainInput(Model): + """Input of the custom domain to be validated for DNS mapping. + + All required parameters must be populated in order to send to Azure. + + :param host_name: Required. The host name of the custom domain. Must be a + domain name. + :type host_name: str + """ + + _validation = { + 'host_name': {'required': True}, + } + + _attribute_map = { + 'host_name': {'key': 'hostName', 'type': 'str'}, + } + + def __init__(self, *, host_name: str, **kwargs) -> None: + super(ValidateCustomDomainInput, self).__init__(**kwargs) + self.host_name = host_name diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_output.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_output.py new file mode 100644 index 000000000000..d330e0f93521 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_output.py @@ -0,0 +1,47 @@ +# 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 ValidateCustomDomainOutput(Model): + """Output of custom domain validation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar custom_domain_validated: Indicates whether the custom domain is + valid or not. + :vartype custom_domain_validated: bool + :ivar reason: The reason why the custom domain is not valid. + :vartype reason: str + :ivar message: Error message describing why the custom domain is not + valid. + :vartype message: str + """ + + _validation = { + 'custom_domain_validated': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'custom_domain_validated': {'key': 'customDomainValidated', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidateCustomDomainOutput, self).__init__(**kwargs) + self.custom_domain_validated = None + self.reason = None + self.message = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_output_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_output_py3.py new file mode 100644 index 000000000000..a3d2b9339b9b --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/validate_custom_domain_output_py3.py @@ -0,0 +1,47 @@ +# 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 ValidateCustomDomainOutput(Model): + """Output of custom domain validation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar custom_domain_validated: Indicates whether the custom domain is + valid or not. + :vartype custom_domain_validated: bool + :ivar reason: The reason why the custom domain is not valid. + :vartype reason: str + :ivar message: Error message describing why the custom domain is not + valid. + :vartype message: str + """ + + _validation = { + 'custom_domain_validated': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'custom_domain_validated': {'key': 'customDomainValidated', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ValidateCustomDomainOutput, self).__init__(**kwargs) + self.custom_domain_validated = None + self.reason = None + self.message = None diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1.py new file mode 100644 index 000000000000..6ed0220ac712 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1.py @@ -0,0 +1,79 @@ +# 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 .resource import Resource + + +class WebApplicationFirewallPolicy1(Resource): + """Defines web application firewall policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param policy_settings: Describes policySettings for policy + :type policy_settings: ~azure.mgmt.frontdoor.models.PolicySettings + :param custom_rules: Describes custom rules inside the policy + :type custom_rules: ~azure.mgmt.frontdoor.models.CustomRules + :param managed_rules: Describes managed rules inside the policy + :type managed_rules: ~azure.mgmt.frontdoor.models.ManagedRuleSets + :ivar provisioning_state: Provisioning state of the + WebApplicationFirewallPolicy. + :vartype provisioning_state: str + :ivar resource_state: Resource status of the policy. Possible values + include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + 'Deleting' + :vartype resource_state: str or + ~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'policy_settings': {'key': 'properties.policySettings', 'type': 'PolicySettings'}, + 'custom_rules': {'key': 'properties.customRules', 'type': 'CustomRules'}, + 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRuleSets'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WebApplicationFirewallPolicy1, self).__init__(**kwargs) + self.policy_settings = kwargs.get('policy_settings', None) + self.custom_rules = kwargs.get('custom_rules', None) + self.managed_rules = kwargs.get('managed_rules', None) + self.provisioning_state = None + self.resource_state = None + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_paged.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_paged.py new file mode 100644 index 000000000000..b3fc5baabd07 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class WebApplicationFirewallPolicy1Paged(Paged): + """ + A paging container for iterating over a list of :class:`WebApplicationFirewallPolicy1 ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WebApplicationFirewallPolicy1]'} + } + + def __init__(self, *args, **kwargs): + + super(WebApplicationFirewallPolicy1Paged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_py3.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_py3.py new file mode 100644 index 000000000000..5920b8383ec2 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_py3.py @@ -0,0 +1,79 @@ +# 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 .resource_py3 import Resource + + +class WebApplicationFirewallPolicy1(Resource): + """Defines web application firewall policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param policy_settings: Describes policySettings for policy + :type policy_settings: ~azure.mgmt.frontdoor.models.PolicySettings + :param custom_rules: Describes custom rules inside the policy + :type custom_rules: ~azure.mgmt.frontdoor.models.CustomRules + :param managed_rules: Describes managed rules inside the policy + :type managed_rules: ~azure.mgmt.frontdoor.models.ManagedRuleSets + :ivar provisioning_state: Provisioning state of the + WebApplicationFirewallPolicy. + :vartype provisioning_state: str + :ivar resource_state: Resource status of the policy. Possible values + include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + 'Deleting' + :vartype resource_state: str or + ~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'policy_settings': {'key': 'properties.policySettings', 'type': 'PolicySettings'}, + 'custom_rules': {'key': 'properties.customRules', 'type': 'CustomRules'}, + 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRuleSets'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, policy_settings=None, custom_rules=None, managed_rules=None, etag: str=None, **kwargs) -> None: + super(WebApplicationFirewallPolicy1, self).__init__(location=location, tags=tags, **kwargs) + self.policy_settings = policy_settings + self.custom_rules = custom_rules + self.managed_rules = managed_rules + self.provisioning_state = None + self.resource_state = None + self.etag = etag diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py new file mode 100644 index 000000000000..8f1ba5d477fb --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py @@ -0,0 +1,30 @@ +# 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 .front_doors_operations import FrontDoorsOperations +from .routing_rules_operations import RoutingRulesOperations +from .health_probe_settings_operations import HealthProbeSettingsOperations +from .load_balancing_settings_operations import LoadBalancingSettingsOperations +from .backend_pools_operations import BackendPoolsOperations +from .frontend_endpoints_operations import FrontendEndpointsOperations +from .endpoints_operations import EndpointsOperations +from .policies_operations import PoliciesOperations + +__all__ = [ + 'FrontDoorsOperations', + 'RoutingRulesOperations', + 'HealthProbeSettingsOperations', + 'LoadBalancingSettingsOperations', + 'BackendPoolsOperations', + 'FrontendEndpointsOperations', + 'EndpointsOperations', + 'PoliciesOperations', +] diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/backend_pools_operations.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/backend_pools_operations.py new file mode 100644 index 000000000000..e7ddae7b45fe --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/backend_pools_operations.py @@ -0,0 +1,376 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BackendPoolsOperations(object): + """BackendPoolsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-01" + + self.config = config + + def list_by_front_door( + self, resource_group_name, front_door_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the Backend Pools within a Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BackendPool + :rtype: + ~azure.mgmt.frontdoor.models.BackendPoolPaged[~azure.mgmt.frontdoor.models.BackendPool] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_front_door.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.BackendPoolPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BackendPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_front_door.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools'} + + def get( + self, resource_group_name, front_door_name, backend_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets a Backend Pool with the specified Pool name within the specified + Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param backend_pool_name: Name of the Backend Pool which is unique + within the Front Door. + :type backend_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackendPool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.BackendPool or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'backendPoolName': self._serialize.url("backend_pool_name", backend_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackendPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}'} + + + def _create_or_update_initial( + self, resource_group_name, front_door_name, backend_pool_name, backend_pool_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'backendPoolName': self._serialize.url("backend_pool_name", backend_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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(backend_pool_parameters, 'BackendPool') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackendPool', response) + if response.status_code == 201: + deserialized = self._deserialize('BackendPool', response) + if response.status_code == 202: + deserialized = self._deserialize('BackendPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, front_door_name, backend_pool_name, backend_pool_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new Backend Pool with the specified Pool name within the + specified Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param backend_pool_name: Name of the Backend Pool which is unique + within the Front Door. + :type backend_pool_name: str + :param backend_pool_parameters: Backend Pool properties needed to + create a new Pool. + :type backend_pool_parameters: + ~azure.mgmt.frontdoor.models.BackendPool + :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 BackendPool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.BackendPool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.BackendPool]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + backend_pool_name=backend_pool_name, + backend_pool_parameters=backend_pool_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BackendPool', 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) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}'} + + + def _delete_initial( + self, resource_group_name, front_door_name, backend_pool_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'backendPoolName': self._serialize.url("backend_pool_name", backend_pool_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, front_door_name, backend_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Backend Pool with the specified parameters. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param backend_pool_name: Name of the Backend Pool which is unique + within the Front Door. + :type backend_pool_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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + backend_pool_name=backend_pool_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}'} diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/endpoints_operations.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/endpoints_operations.py new file mode 100644 index 000000000000..16b6fe5722b8 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/endpoints_operations.py @@ -0,0 +1,129 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class EndpointsOperations(object): + """EndpointsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-01" + + self.config = config + + + def _purge_content_initial( + self, resource_group_name, front_door_name, content_paths, custom_headers=None, raw=False, **operation_config): + content_file_paths = models.PurgeParameters(content_paths=content_paths) + + # Construct URL + url = self.purge_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$') + } + 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(content_file_paths, 'PurgeParameters') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def purge_content( + self, resource_group_name, front_door_name, content_paths, custom_headers=None, raw=False, polling=True, **operation_config): + """Removes a content from Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param content_paths: The path to the content to be purged. Can + describe a file path or a wild card directory. + :type content_paths: list[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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._purge_content_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + content_paths=content_paths, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + purge_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/purge'} diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/front_doors_operations.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/front_doors_operations.py new file mode 100644 index 000000000000..0e7070406164 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/front_doors_operations.py @@ -0,0 +1,494 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class FrontDoorsOperations(object): + """FrontDoorsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the Front Doors within an Azure subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of FrontDoor + :rtype: + ~azure.mgmt.frontdoor.models.FrontDoorPaged[~azure.mgmt.frontdoor.models.FrontDoor] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.FrontDoorPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.FrontDoorPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/frontDoors'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the Front Doors within a resource group under a + subscription. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of FrontDoor + :rtype: + ~azure.mgmt.frontdoor.models.FrontDoorPaged[~azure.mgmt.frontdoor.models.FrontDoor] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.FrontDoorPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.FrontDoorPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors'} + + def get( + self, resource_group_name, front_door_name, custom_headers=None, raw=False, **operation_config): + """Gets a Front Door with the specified Front Door name under the + specified subscription and resource group. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FrontDoor or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.FrontDoor or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FrontDoor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}'} + + + def _create_or_update_initial( + self, resource_group_name, front_door_name, front_door_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$') + } + 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(front_door_parameters, 'FrontDoor') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FrontDoor', response) + if response.status_code == 201: + deserialized = self._deserialize('FrontDoor', response) + if response.status_code == 202: + deserialized = self._deserialize('FrontDoor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, front_door_name, front_door_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new Front Door with a Front Door name under the specified + subscription and resource group. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param front_door_parameters: Front Door properties needed to create a + new Front Door. + :type front_door_parameters: ~azure.mgmt.frontdoor.models.FrontDoor + :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 FrontDoor or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.FrontDoor] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.FrontDoor]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + front_door_parameters=front_door_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('FrontDoor', 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) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}'} + + + def _delete_initial( + self, resource_group_name, front_door_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, front_door_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Front Door with the specified parameters. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}'} + + def validate_custom_domain( + self, resource_group_name, front_door_name, host_name, custom_headers=None, raw=False, **operation_config): + """Validates the custom domain mapping to ensure it maps to the correct + Front Door endpoint in DNS. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param host_name: The host name of the custom domain. Must be a domain + name. + :type host_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ValidateCustomDomainOutput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.ValidateCustomDomainOutput or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + custom_domain_properties = models.ValidateCustomDomainInput(host_name=host_name) + + # Construct URL + url = self.validate_custom_domain.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$') + } + 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(custom_domain_properties, 'ValidateCustomDomainInput') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ValidateCustomDomainOutput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/validateCustomDomain'} diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/frontend_endpoints_operations.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/frontend_endpoints_operations.py new file mode 100644 index 000000000000..0e82bdf28f54 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/frontend_endpoints_operations.py @@ -0,0 +1,555 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class FrontendEndpointsOperations(object): + """FrontendEndpointsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-01" + + self.config = config + + def list_by_front_door( + self, resource_group_name, front_door_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the frontend endpoints within a Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of FrontendEndpoint + :rtype: + ~azure.mgmt.frontdoor.models.FrontendEndpointPaged[~azure.mgmt.frontdoor.models.FrontendEndpoint] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_front_door.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.FrontendEndpointPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.FrontendEndpointPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_front_door.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints'} + + def get( + self, resource_group_name, front_door_name, frontend_endpoint_name, custom_headers=None, raw=False, **operation_config): + """Gets a Frontend endpoint with the specified name within the specified + Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param frontend_endpoint_name: Name of the Frontend endpoint which is + unique within the Front Door. + :type frontend_endpoint_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FrontendEndpoint or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.FrontendEndpoint or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'frontendEndpointName': self._serialize.url("frontend_endpoint_name", frontend_endpoint_name, 'str', max_length=255, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FrontendEndpoint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'} + + + def _create_or_update_initial( + self, resource_group_name, front_door_name, frontend_endpoint_name, frontend_endpoint_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'frontendEndpointName': self._serialize.url("frontend_endpoint_name", frontend_endpoint_name, 'str', max_length=255, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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(frontend_endpoint_parameters, 'FrontendEndpoint') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FrontendEndpoint', response) + if response.status_code == 201: + deserialized = self._deserialize('FrontendEndpoint', response) + if response.status_code == 202: + deserialized = self._deserialize('FrontendEndpoint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, front_door_name, frontend_endpoint_name, frontend_endpoint_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new frontend endpoint with the specified host name within the + specified Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param frontend_endpoint_name: Name of the Frontend endpoint which is + unique within the Front Door. + :type frontend_endpoint_name: str + :param frontend_endpoint_parameters: Frontend endpoint properties + needed to create a new endpoint. + :type frontend_endpoint_parameters: + ~azure.mgmt.frontdoor.models.FrontendEndpoint + :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 FrontendEndpoint or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.FrontendEndpoint] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.FrontendEndpoint]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + frontend_endpoint_name=frontend_endpoint_name, + frontend_endpoint_parameters=frontend_endpoint_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('FrontendEndpoint', 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) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'} + + + def _delete_initial( + self, resource_group_name, front_door_name, frontend_endpoint_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'frontendEndpointName': self._serialize.url("frontend_endpoint_name", frontend_endpoint_name, 'str', max_length=255, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, front_door_name, frontend_endpoint_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing frontend endpoint with the specified parameters. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param frontend_endpoint_name: Name of the Frontend endpoint which is + unique within the Front Door. + :type frontend_endpoint_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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + frontend_endpoint_name=frontend_endpoint_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'} + + + def _enable_https_initial( + self, resource_group_name, front_door_name, frontend_endpoint_name, custom_https_configuration, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.enable_https.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'frontendEndpointName': self._serialize.url("frontend_endpoint_name", frontend_endpoint_name, 'str', max_length=255, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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(custom_https_configuration, 'CustomHttpsConfiguration') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def enable_https( + self, resource_group_name, front_door_name, frontend_endpoint_name, custom_https_configuration, custom_headers=None, raw=False, polling=True, **operation_config): + """Enables a frontendEndpoint for HTTPS traffic. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param frontend_endpoint_name: Name of the Frontend endpoint which is + unique within the Front Door. + :type frontend_endpoint_name: str + :param custom_https_configuration: The configuration specifying how to + enable HTTPS + :type custom_https_configuration: + ~azure.mgmt.frontdoor.models.CustomHttpsConfiguration + :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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._enable_https_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + frontend_endpoint_name=frontend_endpoint_name, + custom_https_configuration=custom_https_configuration, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + enable_https.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/enableHttps'} + + + def _disable_https_initial( + self, resource_group_name, front_door_name, frontend_endpoint_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.disable_https.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'frontendEndpointName': self._serialize.url("frontend_endpoint_name", frontend_endpoint_name, 'str', max_length=255, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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 = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def disable_https( + self, resource_group_name, front_door_name, frontend_endpoint_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Disables a frontendEndpoint for HTTPS traffic. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param frontend_endpoint_name: Name of the Frontend endpoint which is + unique within the Front Door. + :type frontend_endpoint_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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._disable_https_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + frontend_endpoint_name=frontend_endpoint_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + disable_https.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/disableHttps'} diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/health_probe_settings_operations.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/health_probe_settings_operations.py new file mode 100644 index 000000000000..a8e0356a75cc --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/health_probe_settings_operations.py @@ -0,0 +1,377 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class HealthProbeSettingsOperations(object): + """HealthProbeSettingsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-01" + + self.config = config + + def list_by_front_door( + self, resource_group_name, front_door_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the HealthProbeSettings within a Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of HealthProbeSettingsModel + :rtype: + ~azure.mgmt.frontdoor.models.HealthProbeSettingsModelPaged[~azure.mgmt.frontdoor.models.HealthProbeSettingsModel] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_front_door.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.HealthProbeSettingsModelPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.HealthProbeSettingsModelPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_front_door.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings'} + + def get( + self, resource_group_name, front_door_name, health_probe_settings_name, custom_headers=None, raw=False, **operation_config): + """Gets a HealthProbeSettings with the specified Rule name within the + specified Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param health_probe_settings_name: Name of the health probe settings + which is unique within the Front Door. + :type health_probe_settings_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HealthProbeSettingsModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.HealthProbeSettingsModel or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'healthProbeSettingsName': self._serialize.url("health_probe_settings_name", health_probe_settings_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('HealthProbeSettingsModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}'} + + + def _create_or_update_initial( + self, resource_group_name, front_door_name, health_probe_settings_name, health_probe_settings_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'healthProbeSettingsName': self._serialize.url("health_probe_settings_name", health_probe_settings_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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(health_probe_settings_parameters, 'HealthProbeSettingsModel') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('HealthProbeSettingsModel', response) + if response.status_code == 201: + deserialized = self._deserialize('HealthProbeSettingsModel', response) + if response.status_code == 202: + deserialized = self._deserialize('HealthProbeSettingsModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, front_door_name, health_probe_settings_name, health_probe_settings_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new HealthProbeSettings with the specified Rule name within + the specified Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param health_probe_settings_name: Name of the health probe settings + which is unique within the Front Door. + :type health_probe_settings_name: str + :param health_probe_settings_parameters: HealthProbeSettings + properties needed to create a new Front Door. + :type health_probe_settings_parameters: + ~azure.mgmt.frontdoor.models.HealthProbeSettingsModel + :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 + HealthProbeSettingsModel or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.HealthProbeSettingsModel] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.HealthProbeSettingsModel]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + health_probe_settings_name=health_probe_settings_name, + health_probe_settings_parameters=health_probe_settings_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('HealthProbeSettingsModel', 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) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}'} + + + def _delete_initial( + self, resource_group_name, front_door_name, health_probe_settings_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'healthProbeSettingsName': self._serialize.url("health_probe_settings_name", health_probe_settings_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, front_door_name, health_probe_settings_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing HealthProbeSettings with the specified parameters. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param health_probe_settings_name: Name of the health probe settings + which is unique within the Front Door. + :type health_probe_settings_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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + health_probe_settings_name=health_probe_settings_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}'} diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/load_balancing_settings_operations.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/load_balancing_settings_operations.py new file mode 100644 index 000000000000..6813d14f1ec9 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/load_balancing_settings_operations.py @@ -0,0 +1,378 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class LoadBalancingSettingsOperations(object): + """LoadBalancingSettingsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-01" + + self.config = config + + def list_by_front_door( + self, resource_group_name, front_door_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the LoadBalancingSettings within a Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LoadBalancingSettingsModel + :rtype: + ~azure.mgmt.frontdoor.models.LoadBalancingSettingsModelPaged[~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_front_door.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.LoadBalancingSettingsModelPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LoadBalancingSettingsModelPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_front_door.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings'} + + def get( + self, resource_group_name, front_door_name, load_balancing_settings_name, custom_headers=None, raw=False, **operation_config): + """Gets a LoadBalancingSettings with the specified Rule name within the + specified Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param load_balancing_settings_name: Name of the load balancing + settings which is unique within the Front Door. + :type load_balancing_settings_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LoadBalancingSettingsModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'loadBalancingSettingsName': self._serialize.url("load_balancing_settings_name", load_balancing_settings_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LoadBalancingSettingsModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}'} + + + def _create_or_update_initial( + self, resource_group_name, front_door_name, load_balancing_settings_name, load_balancing_settings_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'loadBalancingSettingsName': self._serialize.url("load_balancing_settings_name", load_balancing_settings_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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(load_balancing_settings_parameters, 'LoadBalancingSettingsModel') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LoadBalancingSettingsModel', response) + if response.status_code == 201: + deserialized = self._deserialize('LoadBalancingSettingsModel', response) + if response.status_code == 202: + deserialized = self._deserialize('LoadBalancingSettingsModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, front_door_name, load_balancing_settings_name, load_balancing_settings_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new LoadBalancingSettings with the specified Rule name within + the specified Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param load_balancing_settings_name: Name of the load balancing + settings which is unique within the Front Door. + :type load_balancing_settings_name: str + :param load_balancing_settings_parameters: LoadBalancingSettings + properties needed to create a new Front Door. + :type load_balancing_settings_parameters: + ~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel + :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 + LoadBalancingSettingsModel or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + load_balancing_settings_name=load_balancing_settings_name, + load_balancing_settings_parameters=load_balancing_settings_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LoadBalancingSettingsModel', 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) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}'} + + + def _delete_initial( + self, resource_group_name, front_door_name, load_balancing_settings_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'loadBalancingSettingsName': self._serialize.url("load_balancing_settings_name", load_balancing_settings_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, front_door_name, load_balancing_settings_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing LoadBalancingSettings with the specified + parameters. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param load_balancing_settings_name: Name of the load balancing + settings which is unique within the Front Door. + :type load_balancing_settings_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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + load_balancing_settings_name=load_balancing_settings_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}'} diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/policies_operations.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/policies_operations.py new file mode 100644 index 000000000000..228a22b5c995 --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/policies_operations.py @@ -0,0 +1,319 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PoliciesOperations(object): + """PoliciesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-01" + + self.config = config + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the protection policies within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WebApplicationFirewallPolicy1 + :rtype: + ~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy1Paged[~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy1] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.WebApplicationFirewallPolicy1Paged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WebApplicationFirewallPolicy1Paged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies'} + + def get( + self, resource_group_name, policy_name, custom_headers=None, raw=False, **operation_config): + """Retrieve protection policy with specified name within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param policy_name: The name of the resource group. + :type policy_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WebApplicationFirewallPolicy1 or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy1 or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128), + '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' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WebApplicationFirewallPolicy1', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}'} + + def create_or_update( + self, resource_group_name, policy_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or update policy with specified rule set name within a resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param policy_name: The name of the resource group. + :type policy_name: str + :param parameters: Policy to be created. + :type parameters: + ~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy1 + :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: WebApplicationFirewallPolicy1 or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy1 or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128), + '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, 'WebApplicationFirewallPolicy1') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WebApplicationFirewallPolicy1', response) + if response.status_code == 201: + deserialized = self._deserialize('WebApplicationFirewallPolicy1', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}'} + + + def _delete_initial( + self, resource_group_name, policy_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128), + '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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, policy_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes Policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param policy_name: The name of the resource group. + :type policy_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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + policy_name=policy_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}'} diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/routing_rules_operations.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/routing_rules_operations.py new file mode 100644 index 000000000000..568968537d1a --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/routing_rules_operations.py @@ -0,0 +1,376 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RoutingRulesOperations(object): + """RoutingRulesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-01" + + self.config = config + + def list_by_front_door( + self, resource_group_name, front_door_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the Routing Rules within a Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RoutingRule + :rtype: + ~azure.mgmt.frontdoor.models.RoutingRulePaged[~azure.mgmt.frontdoor.models.RoutingRule] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_front_door.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.RoutingRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RoutingRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_front_door.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules'} + + def get( + self, resource_group_name, front_door_name, routing_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets a Routing Rule with the specified Rule name within the specified + Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param routing_rule_name: Name of the Routing Rule which is unique + within the Front Door. + :type routing_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RoutingRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.RoutingRule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'routingRuleName': self._serialize.url("routing_rule_name", routing_rule_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RoutingRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}'} + + + def _create_or_update_initial( + self, resource_group_name, front_door_name, routing_rule_name, routing_rule_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'routingRuleName': self._serialize.url("routing_rule_name", routing_rule_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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(routing_rule_parameters, 'RoutingRule') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RoutingRule', response) + if response.status_code == 201: + deserialized = self._deserialize('RoutingRule', response) + if response.status_code == 202: + deserialized = self._deserialize('RoutingRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, front_door_name, routing_rule_name, routing_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new Routing Rule with the specified Rule name within the + specified Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param routing_rule_name: Name of the Routing Rule which is unique + within the Front Door. + :type routing_rule_name: str + :param routing_rule_parameters: Routing Rule properties needed to + create a new Front Door. + :type routing_rule_parameters: + ~azure.mgmt.frontdoor.models.RoutingRule + :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 RoutingRule or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.RoutingRule] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.RoutingRule]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + routing_rule_name=routing_rule_name, + routing_rule_parameters=routing_rule_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RoutingRule', 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) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}'} + + + def _delete_initial( + self, resource_group_name, front_door_name, routing_rule_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'frontDoorName': self._serialize.url("front_door_name", front_door_name, 'str', max_length=64, min_length=5, pattern=r'^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$'), + 'routingRuleName': self._serialize.url("routing_rule_name", routing_rule_name, 'str', max_length=90, min_length=1, pattern=r'^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, front_door_name, routing_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Routing Rule with the specified parameters. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param routing_rule_name: Name of the Routing Rule which is unique + within the Front Door. + :type routing_rule_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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + routing_rule_name=routing_rule_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_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) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}'} diff --git a/azure-mgmt-frontdoor/azure/mgmt/frontdoor/version.py b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-frontdoor/azure/mgmt/frontdoor/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/azure-mgmt-frontdoor/sdk_packaging.toml b/azure-mgmt-frontdoor/sdk_packaging.toml new file mode 100644 index 000000000000..8b9a17f6cf27 --- /dev/null +++ b/azure-mgmt-frontdoor/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-frontdoor" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-mgmt-frontdoor/setup.cfg b/azure-mgmt-frontdoor/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-frontdoor/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-frontdoor/setup.py b/azure-mgmt-frontdoor/setup.py new file mode 100644 index 000000000000..251053db3004 --- /dev/null +++ b/azure-mgmt-frontdoor/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-frontdoor" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)