diff --git a/sdk/network/azure-mgmt-frontdoor/README.rst b/sdk/network/azure-mgmt-frontdoor/README.rst index 5091bd19f934..57850737cf83 100644 --- a/sdk/network/azure-mgmt-frontdoor/README.rst +++ b/sdk/network/azure-mgmt-frontdoor/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Front Door Service 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. +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py index 7382a8928955..5134686e57f2 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/front_door_management_client.py @@ -19,13 +19,10 @@ 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 .operations.managed_rule_sets_operations import ManagedRuleSetsOperations from . import models @@ -71,20 +68,14 @@ class FrontDoorManagementClient(SDKClient): :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 + :ivar managed_rule_sets: ManagedRuleSets operations + :vartype managed_rule_sets: azure.mgmt.frontdoor.operations.ManagedRuleSetsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -108,20 +99,14 @@ def __init__( 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) + self.managed_rule_sets = ManagedRuleSetsOperations( + self._client, self.config, self._serialize, self._deserialize) def check_front_door_name_availability( self, name, type, custom_headers=None, raw=False, **operation_config): @@ -146,7 +131,7 @@ def check_front_door_name_availability( """ check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) - api_version = "2018-08-01" + api_version = "2019-05-01" # Construct URL url = self.check_front_door_name_availability.metadata['url'] @@ -211,7 +196,7 @@ def check_front_door_name_availability_with_subscription( """ check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) - api_version = "2018-08-01" + api_version = "2019-05-01" # Construct URL url = self.check_front_door_name_availability_with_subscription.metadata['url'] diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py index 8426d3c4cca0..d58a46f88073 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/__init__.py @@ -18,15 +18,23 @@ from .key_vault_certificate_source_parameters_vault_py3 import KeyVaultCertificateSourceParametersVault from .custom_https_configuration_py3 import CustomHttpsConfiguration from .frontend_endpoint_py3 import FrontendEndpoint + from .backend_pools_settings_py3 import BackendPoolsSettings from .front_door_update_parameters_py3 import FrontDoorUpdateParameters from .purge_parameters_py3 import PurgeParameters + from .routing_rule_list_result_py3 import RoutingRuleListResult from .sub_resource_py3 import SubResource - from .cache_configuration_py3 import CacheConfiguration + from .route_configuration_py3 import RouteConfiguration from .routing_rule_update_parameters_py3 import RoutingRuleUpdateParameters + from .cache_configuration_py3 import CacheConfiguration + from .forwarding_configuration_py3 import ForwardingConfiguration + from .redirect_configuration_py3 import RedirectConfiguration from .backend_py3 import Backend + from .load_balancing_settings_list_result_py3 import LoadBalancingSettingsListResult from .load_balancing_settings_update_parameters_py3 import LoadBalancingSettingsUpdateParameters + from .health_probe_settings_list_result_py3 import HealthProbeSettingsListResult from .health_probe_settings_update_parameters_py3 import HealthProbeSettingsUpdateParameters from .backend_pool_update_parameters_py3 import BackendPoolUpdateParameters + from .backend_pool_list_result_py3 import BackendPoolListResult 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 @@ -40,14 +48,19 @@ 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 .match_condition_py3 import MatchCondition from .custom_rule_py3 import CustomRule - from .custom_rules_py3 import CustomRules + from .custom_rule_list_py3 import CustomRuleList + from .managed_rule_exclusion_py3 import ManagedRuleExclusion + from .managed_rule_override_py3 import ManagedRuleOverride + from .managed_rule_group_override_py3 import ManagedRuleGroupOverride 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 + from .managed_rule_set_list_py3 import ManagedRuleSetList + from .frontend_endpoint_link_py3 import FrontendEndpointLink + from .web_application_firewall_policy_py3 import WebApplicationFirewallPolicy + from .managed_rule_definition_py3 import ManagedRuleDefinition + from .managed_rule_group_definition_py3 import ManagedRuleGroupDefinition + from .managed_rule_set_definition_py3 import ManagedRuleSetDefinition except (SyntaxError, ImportError): from .front_door import FrontDoor from .routing_rule import RoutingRule @@ -57,15 +70,23 @@ from .key_vault_certificate_source_parameters_vault import KeyVaultCertificateSourceParametersVault from .custom_https_configuration import CustomHttpsConfiguration from .frontend_endpoint import FrontendEndpoint + from .backend_pools_settings import BackendPoolsSettings from .front_door_update_parameters import FrontDoorUpdateParameters from .purge_parameters import PurgeParameters + from .routing_rule_list_result import RoutingRuleListResult from .sub_resource import SubResource - from .cache_configuration import CacheConfiguration + from .route_configuration import RouteConfiguration from .routing_rule_update_parameters import RoutingRuleUpdateParameters + from .cache_configuration import CacheConfiguration + from .forwarding_configuration import ForwardingConfiguration + from .redirect_configuration import RedirectConfiguration from .backend import Backend + from .load_balancing_settings_list_result import LoadBalancingSettingsListResult from .load_balancing_settings_update_parameters import LoadBalancingSettingsUpdateParameters + from .health_probe_settings_list_result import HealthProbeSettingsListResult from .health_probe_settings_update_parameters import HealthProbeSettingsUpdateParameters from .backend_pool_update_parameters import BackendPoolUpdateParameters + from .backend_pool_list_result import BackendPoolListResult 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 @@ -79,46 +100,58 @@ from .azure_async_operation_result import AzureAsyncOperationResult from .tags_object import TagsObject from .policy_settings import PolicySettings - from .match_condition1 import MatchCondition1 + from .match_condition import MatchCondition from .custom_rule import CustomRule - from .custom_rules import CustomRules + from .custom_rule_list import CustomRuleList + from .managed_rule_exclusion import ManagedRuleExclusion + from .managed_rule_override import ManagedRuleOverride + from .managed_rule_group_override import ManagedRuleGroupOverride 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 .managed_rule_set_list import ManagedRuleSetList + from .frontend_endpoint_link import FrontendEndpointLink + from .web_application_firewall_policy import WebApplicationFirewallPolicy + from .managed_rule_definition import ManagedRuleDefinition + from .managed_rule_group_definition import ManagedRuleGroupDefinition + from .managed_rule_set_definition import ManagedRuleSetDefinition 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 .web_application_firewall_policy_paged import WebApplicationFirewallPolicyPaged +from .managed_rule_set_definition_paged import ManagedRuleSetDefinitionPaged from .front_door_management_client_enums import ( FrontDoorResourceState, CustomHttpsProvisioningState, CustomHttpsProvisioningSubstate, FrontDoorCertificateSource, - FrontDoorTlsProtocolType, + MinimumTLSVersion, FrontDoorCertificateType, + EnforceCertificateNameCheckEnabledState, FrontDoorEnabledState, FrontDoorProtocol, + RoutingRuleEnabledState, FrontDoorForwardingProtocol, FrontDoorQuery, DynamicCompressionEnabled, + FrontDoorRedirectType, + FrontDoorRedirectProtocol, + BackendEnabledState, + FrontDoorHealthProbeMethod, + HealthProbeEnabled, SessionAffinityEnabledState, ResourceType, Availability, NetworkOperationStatus, - EnabledState, - Mode, + PolicyEnabledState, + PolicyMode, + CustomRuleEnabledState, RuleType, - MatchCondition, + MatchVariable, Operator, - Action, - Transform, - WebApplicationFirewallPolicy, - RuleGroupOverride, + TransformType, + ActionType, + ManagedRuleExclusionMatchVariable, + ManagedRuleExclusionSelectorMatchOperator, + ManagedRuleEnabledState, + PolicyResourceState, ) __all__ = [ @@ -130,15 +163,23 @@ 'KeyVaultCertificateSourceParametersVault', 'CustomHttpsConfiguration', 'FrontendEndpoint', + 'BackendPoolsSettings', 'FrontDoorUpdateParameters', 'PurgeParameters', + 'RoutingRuleListResult', 'SubResource', - 'CacheConfiguration', + 'RouteConfiguration', 'RoutingRuleUpdateParameters', + 'CacheConfiguration', + 'ForwardingConfiguration', + 'RedirectConfiguration', 'Backend', + 'LoadBalancingSettingsListResult', 'LoadBalancingSettingsUpdateParameters', + 'HealthProbeSettingsListResult', 'HealthProbeSettingsUpdateParameters', 'BackendPoolUpdateParameters', + 'BackendPoolListResult', 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink', 'FrontendEndpointUpdateParameters', 'ValidateCustomDomainInput', @@ -152,43 +193,55 @@ 'AzureAsyncOperationResult', 'TagsObject', 'PolicySettings', - 'MatchCondition1', + 'MatchCondition', 'CustomRule', - 'CustomRules', + 'CustomRuleList', + 'ManagedRuleExclusion', + 'ManagedRuleOverride', + 'ManagedRuleGroupOverride', 'ManagedRuleSet', - 'ManagedRuleSets', - 'WebApplicationFirewallPolicy1', - 'AzureManagedOverrideRuleGroup', - 'AzureManagedRuleSet', + 'ManagedRuleSetList', + 'FrontendEndpointLink', + 'WebApplicationFirewallPolicy', + 'ManagedRuleDefinition', + 'ManagedRuleGroupDefinition', + 'ManagedRuleSetDefinition', 'FrontDoorPaged', - 'RoutingRulePaged', - 'HealthProbeSettingsModelPaged', - 'LoadBalancingSettingsModelPaged', - 'BackendPoolPaged', 'FrontendEndpointPaged', - 'WebApplicationFirewallPolicy1Paged', + 'WebApplicationFirewallPolicyPaged', + 'ManagedRuleSetDefinitionPaged', 'FrontDoorResourceState', 'CustomHttpsProvisioningState', 'CustomHttpsProvisioningSubstate', 'FrontDoorCertificateSource', - 'FrontDoorTlsProtocolType', + 'MinimumTLSVersion', 'FrontDoorCertificateType', + 'EnforceCertificateNameCheckEnabledState', 'FrontDoorEnabledState', 'FrontDoorProtocol', + 'RoutingRuleEnabledState', 'FrontDoorForwardingProtocol', 'FrontDoorQuery', 'DynamicCompressionEnabled', + 'FrontDoorRedirectType', + 'FrontDoorRedirectProtocol', + 'BackendEnabledState', + 'FrontDoorHealthProbeMethod', + 'HealthProbeEnabled', 'SessionAffinityEnabledState', 'ResourceType', 'Availability', 'NetworkOperationStatus', - 'EnabledState', - 'Mode', + 'PolicyEnabledState', + 'PolicyMode', + 'CustomRuleEnabledState', 'RuleType', - 'MatchCondition', + 'MatchVariable', 'Operator', - 'Action', - 'Transform', - 'WebApplicationFirewallPolicy', - 'RuleGroupOverride', + 'TransformType', + 'ActionType', + 'ManagedRuleExclusionMatchVariable', + 'ManagedRuleExclusionSelectorMatchOperator', + 'ManagedRuleEnabledState', + 'PolicyResourceState', ] diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group.py deleted file mode 100644 index 3602d32adfc3..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group_py3.py deleted file mode 100644 index 3080e02399fa..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_override_rule_group_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set.py deleted file mode 100644 index 005935666d49..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set_py3.py deleted file mode 100644 index 56d63d6f45db..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/azure_managed_rule_set_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend.py index d15a56194c1a..e2c358de7522 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend.py @@ -25,7 +25,7 @@ class Backend(Model): values are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type enabled_state: str or - ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + ~azure.mgmt.frontdoor.models.BackendEnabledState :param priority: Priority to use for load balancing. Higher priorities will not be used for load balancing if any lower priority backend is healthy. diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_list_result.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_list_result.py new file mode 100644 index 000000000000..2077aa464986 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_list_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 BackendPoolListResult(Model): + """Result of the request to list Backend Pools. It contains a list of Backend + Pools objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of Backend Pools within a Front Door. + :vartype value: list[~azure.mgmt.frontdoor.models.BackendPool] + :param next_link: URL to get the next set of BackendPool objects if there + are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackendPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BackendPoolListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_list_result_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_list_result_py3.py new file mode 100644 index 000000000000..d6e42a6a2183 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_list_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 BackendPoolListResult(Model): + """Result of the request to list Backend Pools. It contains a list of Backend + Pools objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of Backend Pools within a Front Door. + :vartype value: list[~azure.mgmt.frontdoor.models.BackendPool] + :param next_link: URL to get the next set of BackendPool objects if there + are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackendPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, next_link: str=None, **kwargs) -> None: + super(BackendPoolListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_paged.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_paged.py deleted file mode 100644 index 7f530dd9c345..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pool_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pools_settings.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pools_settings.py new file mode 100644 index 000000000000..6062d2c11f30 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pools_settings.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 BackendPoolsSettings(Model): + """Settings that apply to all backend pools. + + :param enforce_certificate_name_check: Whether to enforce certificate name + check on HTTPS requests to all backend pools. No effect on non-HTTPS + requests. Possible values include: 'Enabled', 'Disabled'. Default value: + "Enabled" . + :type enforce_certificate_name_check: str or + ~azure.mgmt.frontdoor.models.EnforceCertificateNameCheckEnabledState + :param send_recv_timeout_seconds: Send and receive timeout on forwarding + request to the backend. When timeout is reached, the request fails and + returns. + :type send_recv_timeout_seconds: int + """ + + _validation = { + 'send_recv_timeout_seconds': {'minimum': 16}, + } + + _attribute_map = { + 'enforce_certificate_name_check': {'key': 'enforceCertificateNameCheck', 'type': 'str'}, + 'send_recv_timeout_seconds': {'key': 'sendRecvTimeoutSeconds', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(BackendPoolsSettings, self).__init__(**kwargs) + self.enforce_certificate_name_check = kwargs.get('enforce_certificate_name_check', "Enabled") + self.send_recv_timeout_seconds = kwargs.get('send_recv_timeout_seconds', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pools_settings_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pools_settings_py3.py new file mode 100644 index 000000000000..e38797382615 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_pools_settings_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 BackendPoolsSettings(Model): + """Settings that apply to all backend pools. + + :param enforce_certificate_name_check: Whether to enforce certificate name + check on HTTPS requests to all backend pools. No effect on non-HTTPS + requests. Possible values include: 'Enabled', 'Disabled'. Default value: + "Enabled" . + :type enforce_certificate_name_check: str or + ~azure.mgmt.frontdoor.models.EnforceCertificateNameCheckEnabledState + :param send_recv_timeout_seconds: Send and receive timeout on forwarding + request to the backend. When timeout is reached, the request fails and + returns. + :type send_recv_timeout_seconds: int + """ + + _validation = { + 'send_recv_timeout_seconds': {'minimum': 16}, + } + + _attribute_map = { + 'enforce_certificate_name_check': {'key': 'enforceCertificateNameCheck', 'type': 'str'}, + 'send_recv_timeout_seconds': {'key': 'sendRecvTimeoutSeconds', 'type': 'int'}, + } + + def __init__(self, *, enforce_certificate_name_check="Enabled", send_recv_timeout_seconds: int=None, **kwargs) -> None: + super(BackendPoolsSettings, self).__init__(**kwargs) + self.enforce_certificate_name_check = enforce_certificate_name_check + self.send_recv_timeout_seconds = send_recv_timeout_seconds diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_py3.py index eb7427630145..d80e1897d310 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/backend_py3.py @@ -25,7 +25,7 @@ class Backend(Model): values are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type enabled_state: str or - ~azure.mgmt.frontdoor.models.FrontDoorEnabledState + ~azure.mgmt.frontdoor.models.BackendEnabledState :param priority: Priority to use for load balancing. Higher priorities will not be used for load balancing if any lower priority backend is healthy. diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration.py index ebf4b28794fd..4956b04fb4f2 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration.py @@ -15,14 +15,23 @@ class CustomHttpsConfiguration(Model): """Https settings for a domain. - :param certificate_source: Defines the source of the SSL certificate. - Possible values include: 'AzureKeyVault', 'FrontDoor' + 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 certificate_source: Required. 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 + :ivar protocol_type: Required. Defines the TLS extension protocol that is + used for secure delivery. Default value: "ServerNameIndication" . + :vartype protocol_type: str + :param minimum_tls_version: Required. The minimum TLS version required + from the clients to establish an SSL handshake with Front Door. Possible + values include: '1.0', '1.2' + :type minimum_tls_version: str or + ~azure.mgmt.frontdoor.models.MinimumTLSVersion :param vault: The Key Vault containing the SSL certificate :type vault: ~azure.mgmt.frontdoor.models.KeyVaultCertificateSourceParametersVault @@ -39,19 +48,28 @@ class CustomHttpsConfiguration(Model): ~azure.mgmt.frontdoor.models.FrontDoorCertificateType """ + _validation = { + 'certificate_source': {'required': True}, + 'protocol_type': {'required': True, 'constant': True}, + 'minimum_tls_version': {'required': True}, + } + _attribute_map = { 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', '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'}, } + protocol_type = "ServerNameIndication" + 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.minimum_tls_version = kwargs.get('minimum_tls_version', None) self.vault = kwargs.get('vault', None) self.secret_name = kwargs.get('secret_name', None) self.secret_version = kwargs.get('secret_version', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration_py3.py index 2420582fecb1..67ba20aa46af 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_https_configuration_py3.py @@ -15,14 +15,23 @@ class CustomHttpsConfiguration(Model): """Https settings for a domain. - :param certificate_source: Defines the source of the SSL certificate. - Possible values include: 'AzureKeyVault', 'FrontDoor' + 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 certificate_source: Required. 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 + :ivar protocol_type: Required. Defines the TLS extension protocol that is + used for secure delivery. Default value: "ServerNameIndication" . + :vartype protocol_type: str + :param minimum_tls_version: Required. The minimum TLS version required + from the clients to establish an SSL handshake with Front Door. Possible + values include: '1.0', '1.2' + :type minimum_tls_version: str or + ~azure.mgmt.frontdoor.models.MinimumTLSVersion :param vault: The Key Vault containing the SSL certificate :type vault: ~azure.mgmt.frontdoor.models.KeyVaultCertificateSourceParametersVault @@ -39,19 +48,28 @@ class CustomHttpsConfiguration(Model): ~azure.mgmt.frontdoor.models.FrontDoorCertificateType """ + _validation = { + 'certificate_source': {'required': True}, + 'protocol_type': {'required': True, 'constant': True}, + 'minimum_tls_version': {'required': True}, + } + _attribute_map = { 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', '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: + protocol_type = "ServerNameIndication" + + def __init__(self, *, certificate_source, minimum_tls_version, 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.minimum_tls_version = minimum_tls_version self.vault = vault self.secret_name = secret_name self.secret_version = secret_version diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule.py index 6ee3544c69db..6634e70502b5 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule.py @@ -15,66 +15,62 @@ 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. + :param name: Describes the name of the rule. :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 + lower value will be evaluated before rules with a higher value. :type priority: int + :param enabled_state: Describes if the custom rule is in enabled or + disabled state. Defaults to Enabled if not specified. Possible values + include: 'Disabled', 'Enabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.CustomRuleEnabledState :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 + :param rate_limit_duration_in_minutes: Time window for resetting the rate + limit count. Default is 1 minute. :type rate_limit_duration_in_minutes: int - :param rate_limit_threshold: Defines rate limit threshold + :param rate_limit_threshold: Number of allowed requests per client within + the time window. :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] + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.frontdoor.models.MatchCondition] + :param action: Required. Describes what action to be applied when rule + matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + :type action: str or ~azure.mgmt.frontdoor.models.ActionType """ _validation = { 'name': {'max_length': 128}, - 'etag': {'readonly': True}, 'priority': {'required': True}, 'rule_type': {'required': True}, + 'rate_limit_duration_in_minutes': {'maximum': 5, 'minimum': 0}, + 'rate_limit_threshold': {'minimum': 0}, 'match_conditions': {'required': True}, 'action': {'required': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, 'priority': {'key': 'priority', 'type': 'int'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, '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]'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, '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.enabled_state = kwargs.get('enabled_state', 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_list.py similarity index 90% rename from sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules.py rename to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_list.py index 07a8252d1e11..3294bb3766a2 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_list.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class CustomRules(Model): +class CustomRuleList(Model): """Defines contents of custom rules. :param rules: List of rules @@ -24,5 +24,5 @@ class CustomRules(Model): } def __init__(self, **kwargs): - super(CustomRules, self).__init__(**kwargs) + super(CustomRuleList, self).__init__(**kwargs) self.rules = kwargs.get('rules', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_list_py3.py similarity index 90% rename from sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules_py3.py rename to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_list_py3.py index ced7af11f141..504646dc06e0 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rules_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_list_py3.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class CustomRules(Model): +class CustomRuleList(Model): """Defines contents of custom rules. :param rules: List of rules @@ -24,5 +24,5 @@ class CustomRules(Model): } def __init__(self, *, rules=None, **kwargs) -> None: - super(CustomRules, self).__init__(**kwargs) + super(CustomRuleList, self).__init__(**kwargs) self.rules = rules diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_py3.py index 41d5aaf0a267..b029cc87cd55 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/custom_rule_py3.py @@ -15,66 +15,62 @@ 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. + :param name: Describes the name of the rule. :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 + lower value will be evaluated before rules with a higher value. :type priority: int + :param enabled_state: Describes if the custom rule is in enabled or + disabled state. Defaults to Enabled if not specified. Possible values + include: 'Disabled', 'Enabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.CustomRuleEnabledState :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 + :param rate_limit_duration_in_minutes: Time window for resetting the rate + limit count. Default is 1 minute. :type rate_limit_duration_in_minutes: int - :param rate_limit_threshold: Defines rate limit threshold + :param rate_limit_threshold: Number of allowed requests per client within + the time window. :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] + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.frontdoor.models.MatchCondition] + :param action: Required. Describes what action to be applied when rule + matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + :type action: str or ~azure.mgmt.frontdoor.models.ActionType """ _validation = { 'name': {'max_length': 128}, - 'etag': {'readonly': True}, 'priority': {'required': True}, 'rule_type': {'required': True}, + 'rate_limit_duration_in_minutes': {'maximum': 5, 'minimum': 0}, + 'rate_limit_threshold': {'minimum': 0}, 'match_conditions': {'required': True}, 'action': {'required': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, 'priority': {'key': 'priority', 'type': 'int'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, '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]'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, '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: + def __init__(self, *, priority: int, rule_type, match_conditions, action, name: str=None, enabled_state=None, rate_limit_duration_in_minutes: int=None, rate_limit_threshold: int=None, **kwargs) -> None: super(CustomRule, self).__init__(**kwargs) self.name = name - self.etag = None self.priority = priority + self.enabled_state = enabled_state 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/forwarding_configuration.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/forwarding_configuration.py new file mode 100644 index 000000000000..435f7087385f --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/forwarding_configuration.py @@ -0,0 +1,56 @@ +# 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 .route_configuration import RouteConfiguration + + +class ForwardingConfiguration(RouteConfiguration): + """Describes Forwarding Route. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: 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 + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', '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'}, + } + + def __init__(self, **kwargs): + super(ForwardingConfiguration, self).__init__(**kwargs) + 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.odatatype = '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration' diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/forwarding_configuration_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/forwarding_configuration_py3.py new file mode 100644 index 000000000000..cd8562336477 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/forwarding_configuration_py3.py @@ -0,0 +1,56 @@ +# 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 .route_configuration_py3 import RouteConfiguration + + +class ForwardingConfiguration(RouteConfiguration): + """Describes Forwarding Route. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: 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 + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', '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'}, + } + + def __init__(self, *, custom_forwarding_path: str=None, forwarding_protocol=None, cache_configuration=None, backend_pool=None, **kwargs) -> None: + super(ForwardingConfiguration, self).__init__(**kwargs) + self.custom_forwarding_path = custom_forwarding_path + self.forwarding_protocol = forwarding_protocol + self.cache_configuration = cache_configuration + self.backend_pool = backend_pool + self.odatatype = '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration' diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door.py index 2893d3972dd0..513f01aea833 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door.py @@ -46,6 +46,9 @@ class FrontDoor(Resource): :param frontend_endpoints: Frontend endpoints available to routing rules. :type frontend_endpoints: list[~azure.mgmt.frontdoor.models.FrontendEndpoint] + :param backend_pools_settings: Settings for all backendPools + :type backend_pools_settings: + ~azure.mgmt.frontdoor.models.BackendPoolsSettings :param enabled_state: Operational status of the Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' @@ -82,6 +85,7 @@ class FrontDoor(Resource): 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': '[HealthProbeSettingsModel]'}, 'backend_pools': {'key': 'properties.backendPools', 'type': '[BackendPool]'}, 'frontend_endpoints': {'key': 'properties.frontendEndpoints', 'type': '[FrontendEndpoint]'}, + 'backend_pools_settings': {'key': 'properties.backendPoolsSettings', 'type': 'BackendPoolsSettings'}, 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -96,6 +100,7 @@ def __init__(self, **kwargs): 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.backend_pools_settings = kwargs.get('backend_pools_settings', None) self.enabled_state = kwargs.get('enabled_state', None) self.resource_state = kwargs.get('resource_state', None) self.provisioning_state = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py index 069909cf497c..f896f57c562b 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_management_client_enums.py @@ -51,9 +51,10 @@ class FrontDoorCertificateSource(str, Enum): front_door = "FrontDoor" -class FrontDoorTlsProtocolType(str, Enum): +class MinimumTLSVersion(str, Enum): - server_name_indication = "ServerNameIndication" + one_full_stop_zero = "1.0" + one_full_stop_two = "1.2" class FrontDoorCertificateType(str, Enum): @@ -61,6 +62,12 @@ class FrontDoorCertificateType(str, Enum): dedicated = "Dedicated" +class EnforceCertificateNameCheckEnabledState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class FrontDoorEnabledState(str, Enum): enabled = "Enabled" @@ -73,6 +80,12 @@ class FrontDoorProtocol(str, Enum): https = "Https" +class RoutingRuleEnabledState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class FrontDoorForwardingProtocol(str, Enum): http_only = "HttpOnly" @@ -92,6 +105,39 @@ class DynamicCompressionEnabled(str, Enum): disabled = "Disabled" +class FrontDoorRedirectType(str, Enum): + + moved = "Moved" + found = "Found" + temporary_redirect = "TemporaryRedirect" + permanent_redirect = "PermanentRedirect" + + +class FrontDoorRedirectProtocol(str, Enum): + + http_only = "HttpOnly" + https_only = "HttpsOnly" + match_request = "MatchRequest" + + +class BackendEnabledState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class FrontDoorHealthProbeMethod(str, Enum): + + get = "GET" + head = "HEAD" + + +class HealthProbeEnabled(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class SessionAffinityEnabledState(str, Enum): enabled = "Enabled" @@ -117,25 +163,31 @@ class NetworkOperationStatus(str, Enum): failed = "Failed" -class EnabledState(str, Enum): +class PolicyEnabledState(str, Enum): disabled = "Disabled" enabled = "Enabled" -class Mode(str, Enum): +class PolicyMode(str, Enum): prevention = "Prevention" detection = "Detection" +class CustomRuleEnabledState(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + class RuleType(str, Enum): match_rule = "MatchRule" rate_limit_rule = "RateLimitRule" -class MatchCondition(str, Enum): +class MatchVariable(str, Enum): remote_addr = "RemoteAddr" request_method = "RequestMethod" @@ -144,6 +196,8 @@ class MatchCondition(str, Enum): request_uri = "RequestUri" request_header = "RequestHeader" request_body = "RequestBody" + cookies = "Cookies" + socket_addr = "SocketAddr" class Operator(str, Enum): @@ -159,16 +213,10 @@ class Operator(str, Enum): greater_than_or_equal = "GreaterThanOrEqual" begins_with = "BeginsWith" ends_with = "EndsWith" + reg_ex = "RegEx" -class Action(str, Enum): - - allow = "Allow" - block = "Block" - log = "Log" - - -class Transform(str, Enum): +class TransformType(str, Enum): lowercase = "Lowercase" uppercase = "Uppercase" @@ -176,10 +224,40 @@ class Transform(str, Enum): url_decode = "UrlDecode" url_encode = "UrlEncode" remove_nulls = "RemoveNulls" - html_entity_decode = "HtmlEntityDecode" -class WebApplicationFirewallPolicy(str, Enum): +class ActionType(str, Enum): + + allow = "Allow" + block = "Block" + log = "Log" + redirect = "Redirect" + + +class ManagedRuleExclusionMatchVariable(str, Enum): + + request_header_names = "RequestHeaderNames" + request_cookie_names = "RequestCookieNames" + query_string_arg_names = "QueryStringArgNames" + request_body_post_arg_names = "RequestBodyPostArgNames" + + +class ManagedRuleExclusionSelectorMatchOperator(str, Enum): + + equals = "Equals" + contains = "Contains" + starts_with = "StartsWith" + ends_with = "EndsWith" + equals_any = "EqualsAny" + + +class ManagedRuleEnabledState(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + +class PolicyResourceState(str, Enum): creating = "Creating" enabling = "Enabling" @@ -187,9 +265,3 @@ class WebApplicationFirewallPolicy(str, Enum): disabling = "Disabling" disabled = "Disabled" deleting = "Deleting" - - -class RuleGroupOverride(str, Enum): - - sql_injection = "SqlInjection" - xss = "XSS" diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_py3.py index 1af837e68018..1fbac8455212 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_py3.py @@ -46,6 +46,9 @@ class FrontDoor(Resource): :param frontend_endpoints: Frontend endpoints available to routing rules. :type frontend_endpoints: list[~azure.mgmt.frontdoor.models.FrontendEndpoint] + :param backend_pools_settings: Settings for all backendPools + :type backend_pools_settings: + ~azure.mgmt.frontdoor.models.BackendPoolsSettings :param enabled_state: Operational status of the Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' @@ -82,13 +85,14 @@ class FrontDoor(Resource): 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': '[HealthProbeSettingsModel]'}, 'backend_pools': {'key': 'properties.backendPools', 'type': '[BackendPool]'}, 'frontend_endpoints': {'key': 'properties.frontendEndpoints', 'type': '[FrontendEndpoint]'}, + 'backend_pools_settings': {'key': 'properties.backendPoolsSettings', 'type': 'BackendPoolsSettings'}, '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: + 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, backend_pools_settings=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 @@ -96,6 +100,7 @@ def __init__(self, *, location: str=None, tags=None, friendly_name: str=None, ro self.health_probe_settings = health_probe_settings self.backend_pools = backend_pools self.frontend_endpoints = frontend_endpoints + self.backend_pools_settings = backend_pools_settings self.enabled_state = enabled_state self.resource_state = resource_state self.provisioning_state = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters.py index 9411f5c42c12..f5e1816bd91c 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters.py @@ -32,6 +32,9 @@ class FrontDoorUpdateParameters(Model): :param frontend_endpoints: Frontend endpoints available to routing rules. :type frontend_endpoints: list[~azure.mgmt.frontdoor.models.FrontendEndpoint] + :param backend_pools_settings: Settings for all backendPools + :type backend_pools_settings: + ~azure.mgmt.frontdoor.models.BackendPoolsSettings :param enabled_state: Operational status of the Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' @@ -46,6 +49,7 @@ class FrontDoorUpdateParameters(Model): 'health_probe_settings': {'key': 'healthProbeSettings', 'type': '[HealthProbeSettingsModel]'}, 'backend_pools': {'key': 'backendPools', 'type': '[BackendPool]'}, 'frontend_endpoints': {'key': 'frontendEndpoints', 'type': '[FrontendEndpoint]'}, + 'backend_pools_settings': {'key': 'backendPoolsSettings', 'type': 'BackendPoolsSettings'}, 'enabled_state': {'key': 'enabledState', 'type': 'str'}, } @@ -57,4 +61,5 @@ def __init__(self, **kwargs): 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.backend_pools_settings = kwargs.get('backend_pools_settings', None) self.enabled_state = kwargs.get('enabled_state', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters_py3.py index 127259641e8c..09b6cded262b 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/front_door_update_parameters_py3.py @@ -32,6 +32,9 @@ class FrontDoorUpdateParameters(Model): :param frontend_endpoints: Frontend endpoints available to routing rules. :type frontend_endpoints: list[~azure.mgmt.frontdoor.models.FrontendEndpoint] + :param backend_pools_settings: Settings for all backendPools + :type backend_pools_settings: + ~azure.mgmt.frontdoor.models.BackendPoolsSettings :param enabled_state: Operational status of the Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' @@ -46,10 +49,11 @@ class FrontDoorUpdateParameters(Model): 'health_probe_settings': {'key': 'healthProbeSettings', 'type': '[HealthProbeSettingsModel]'}, 'backend_pools': {'key': 'backendPools', 'type': '[BackendPool]'}, 'frontend_endpoints': {'key': 'frontendEndpoints', 'type': '[FrontendEndpoint]'}, + 'backend_pools_settings': {'key': 'backendPoolsSettings', 'type': 'BackendPoolsSettings'}, '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: + def __init__(self, *, friendly_name: str=None, routing_rules=None, load_balancing_settings=None, health_probe_settings=None, backend_pools=None, frontend_endpoints=None, backend_pools_settings=None, enabled_state=None, **kwargs) -> None: super(FrontDoorUpdateParameters, self).__init__(**kwargs) self.friendly_name = friendly_name self.routing_rules = routing_rules @@ -57,4 +61,5 @@ def __init__(self, *, friendly_name: str=None, routing_rules=None, load_balancin self.health_probe_settings = health_probe_settings self.backend_pools = backend_pools self.frontend_endpoints = frontend_endpoints + self.backend_pools_settings = backend_pools_settings self.enabled_state = enabled_state diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_link.py similarity index 61% rename from sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets.py rename to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_link.py index 37e70e26f118..f1497da99289 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_link.py @@ -12,17 +12,17 @@ from msrest.serialization import Model -class ManagedRuleSets(Model): - """Defines ManagedRuleSets - array of managedRuleSet. +class FrontendEndpointLink(Model): + """Defines the Resource ID for a Frontend Endpoint. - :param rule_sets: List of rules - :type rule_sets: list[~azure.mgmt.frontdoor.models.ManagedRuleSet] + :param id: Resource ID. + :type id: str """ _attribute_map = { - 'rule_sets': {'key': 'ruleSets', 'type': '[ManagedRuleSet]'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__(self, **kwargs): - super(ManagedRuleSets, self).__init__(**kwargs) - self.rule_sets = kwargs.get('rule_sets', None) + super(FrontendEndpointLink, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_link_py3.py similarity index 57% rename from sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets_py3.py rename to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_link_py3.py index 48f15606ed69..5493cb083a91 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_sets_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/frontend_endpoint_link_py3.py @@ -12,17 +12,17 @@ from msrest.serialization import Model -class ManagedRuleSets(Model): - """Defines ManagedRuleSets - array of managedRuleSet. +class FrontendEndpointLink(Model): + """Defines the Resource ID for a Frontend Endpoint. - :param rule_sets: List of rules - :type rule_sets: list[~azure.mgmt.frontdoor.models.ManagedRuleSet] + :param id: Resource ID. + :type id: str """ _attribute_map = { - 'rule_sets': {'key': 'ruleSets', 'type': '[ManagedRuleSet]'}, + 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, *, rule_sets=None, **kwargs) -> None: - super(ManagedRuleSets, self).__init__(**kwargs) - self.rule_sets = rule_sets + def __init__(self, *, id: str=None, **kwargs) -> None: + super(FrontendEndpointLink, self).__init__(**kwargs) + self.id = id diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_list_result.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_list_result.py new file mode 100644 index 000000000000..4128230da941 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_list_result.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 HealthProbeSettingsListResult(Model): + """Result of the request to list HealthProbeSettings. It contains a list of + HealthProbeSettings objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of HealthProbeSettings within a Front Door. + :vartype value: + list[~azure.mgmt.frontdoor.models.HealthProbeSettingsModel] + :param next_link: URL to get the next set of HealthProbeSettings objects + if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HealthProbeSettingsModel]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HealthProbeSettingsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_list_result_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_list_result_py3.py new file mode 100644 index 000000000000..0bc4a242611a --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_list_result_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 HealthProbeSettingsListResult(Model): + """Result of the request to list HealthProbeSettings. It contains a list of + HealthProbeSettings objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of HealthProbeSettings within a Front Door. + :vartype value: + list[~azure.mgmt.frontdoor.models.HealthProbeSettingsModel] + :param next_link: URL to get the next set of HealthProbeSettings objects + if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HealthProbeSettingsModel]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, next_link: str=None, **kwargs) -> None: + super(HealthProbeSettingsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model.py index 693eb0cf1f40..328782297e8a 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model.py @@ -27,6 +27,17 @@ class HealthProbeSettingsModel(SubResource): :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 health_probe_method: Configures which HTTP method to use to probe + the backends defined under backendPools. Possible values include: 'GET', + 'HEAD'. Default value: "HEAD" . + :type health_probe_method: str or + ~azure.mgmt.frontdoor.models.FrontDoorHealthProbeMethod + :param enabled_state: Whether to enable health probes to be made against + backends defined under backendPools. Health probes can only be disabled if + there is a single enabled backend in single enabled backend pool. Possible + values include: 'Enabled', 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.HealthProbeEnabled :param resource_state: Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' :type resource_state: str or @@ -46,6 +57,8 @@ class HealthProbeSettingsModel(SubResource): 'path': {'key': 'properties.path', 'type': 'str'}, 'protocol': {'key': 'properties.protocol', 'type': 'str'}, 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'health_probe_method': {'key': 'properties.healthProbeMethod', 'type': 'str'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, @@ -56,6 +69,8 @@ def __init__(self, **kwargs): self.path = kwargs.get('path', None) self.protocol = kwargs.get('protocol', None) self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.health_probe_method = kwargs.get('health_probe_method', "HEAD") + 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_py3.py index ef1d1f5749b3..d379453e3b7c 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_py3.py @@ -27,6 +27,17 @@ class HealthProbeSettingsModel(SubResource): :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 health_probe_method: Configures which HTTP method to use to probe + the backends defined under backendPools. Possible values include: 'GET', + 'HEAD'. Default value: "HEAD" . + :type health_probe_method: str or + ~azure.mgmt.frontdoor.models.FrontDoorHealthProbeMethod + :param enabled_state: Whether to enable health probes to be made against + backends defined under backendPools. Health probes can only be disabled if + there is a single enabled backend in single enabled backend pool. Possible + values include: 'Enabled', 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.HealthProbeEnabled :param resource_state: Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' :type resource_state: str or @@ -46,16 +57,20 @@ class HealthProbeSettingsModel(SubResource): 'path': {'key': 'properties.path', 'type': 'str'}, 'protocol': {'key': 'properties.protocol', 'type': 'str'}, 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'health_probe_method': {'key': 'properties.healthProbeMethod', 'type': 'str'}, + '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, path: str=None, protocol=None, interval_in_seconds: int=None, resource_state=None, name: str=None, **kwargs) -> None: + def __init__(self, *, id: str=None, path: str=None, protocol=None, interval_in_seconds: int=None, health_probe_method="HEAD", enabled_state=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.health_probe_method = health_probe_method + self.enabled_state = enabled_state self.resource_state = resource_state self.name = name self.type = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters.py index a9bad070a4a2..be6cfd6173e0 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters.py @@ -22,12 +22,25 @@ class HealthProbeSettingsUpdateParameters(Model): :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 health_probe_method: Configures which HTTP method to use to probe + the backends defined under backendPools. Possible values include: 'GET', + 'HEAD'. Default value: "HEAD" . + :type health_probe_method: str or + ~azure.mgmt.frontdoor.models.FrontDoorHealthProbeMethod + :param enabled_state: Whether to enable health probes to be made against + backends defined under backendPools. Health probes can only be disabled if + there is a single enabled backend in single enabled backend pool. Possible + values include: 'Enabled', 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.HealthProbeEnabled """ _attribute_map = { 'path': {'key': 'path', 'type': 'str'}, 'protocol': {'key': 'protocol', 'type': 'str'}, 'interval_in_seconds': {'key': 'intervalInSeconds', 'type': 'int'}, + 'health_probe_method': {'key': 'healthProbeMethod', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, } def __init__(self, **kwargs): @@ -35,3 +48,5 @@ def __init__(self, **kwargs): self.path = kwargs.get('path', None) self.protocol = kwargs.get('protocol', None) self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.health_probe_method = kwargs.get('health_probe_method', "HEAD") + self.enabled_state = kwargs.get('enabled_state', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters_py3.py index 21eeab0350aa..8ea262f41c72 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_update_parameters_py3.py @@ -22,16 +22,31 @@ class HealthProbeSettingsUpdateParameters(Model): :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 health_probe_method: Configures which HTTP method to use to probe + the backends defined under backendPools. Possible values include: 'GET', + 'HEAD'. Default value: "HEAD" . + :type health_probe_method: str or + ~azure.mgmt.frontdoor.models.FrontDoorHealthProbeMethod + :param enabled_state: Whether to enable health probes to be made against + backends defined under backendPools. Health probes can only be disabled if + there is a single enabled backend in single enabled backend pool. Possible + values include: 'Enabled', 'Disabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.HealthProbeEnabled """ _attribute_map = { 'path': {'key': 'path', 'type': 'str'}, 'protocol': {'key': 'protocol', 'type': 'str'}, 'interval_in_seconds': {'key': 'intervalInSeconds', 'type': 'int'}, + 'health_probe_method': {'key': 'healthProbeMethod', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, } - def __init__(self, *, path: str=None, protocol=None, interval_in_seconds: int=None, **kwargs) -> None: + def __init__(self, *, path: str=None, protocol=None, interval_in_seconds: int=None, health_probe_method="HEAD", enabled_state=None, **kwargs) -> None: super(HealthProbeSettingsUpdateParameters, self).__init__(**kwargs) self.path = path self.protocol = protocol self.interval_in_seconds = interval_in_seconds + self.health_probe_method = health_probe_method + self.enabled_state = enabled_state diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_list_result.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_list_result.py new file mode 100644 index 000000000000..f88bd8da54cd --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_list_result.py @@ -0,0 +1,43 @@ +# 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 LoadBalancingSettingsListResult(Model): + """Result of the request to list load balancing settings. It contains a list + of load balancing settings objects and a URL link to get the next set of + results. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of Backend Pools within a Front Door. + :vartype value: + list[~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel] + :param next_link: URL to get the next set of LoadBalancingSettings objects + if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LoadBalancingSettingsModel]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LoadBalancingSettingsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_list_result_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_list_result_py3.py new file mode 100644 index 000000000000..48cb4db4ee4d --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_list_result_py3.py @@ -0,0 +1,43 @@ +# 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 LoadBalancingSettingsListResult(Model): + """Result of the request to list load balancing settings. It contains a list + of load balancing settings objects and a URL link to get the next set of + results. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of Backend Pools within a Front Door. + :vartype value: + list[~azure.mgmt.frontdoor.models.LoadBalancingSettingsModel] + :param next_link: URL to get the next set of LoadBalancingSettings objects + if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LoadBalancingSettingsModel]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, next_link: str=None, **kwargs) -> None: + super(LoadBalancingSettingsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model_paged.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model_paged.py deleted file mode 100644 index 20d94f0be273..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/load_balancing_settings_model_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_definition.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_definition.py new file mode 100644 index 000000000000..77ebcf2299f6 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_definition.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 + + +class ManagedRuleDefinition(Model): + """Describes a managed rule definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar rule_id: Identifier for the managed rule. + :vartype rule_id: str + :ivar default_state: Describes the default state for the managed rule. + Possible values include: 'Disabled', 'Enabled' + :vartype default_state: str or + ~azure.mgmt.frontdoor.models.ManagedRuleEnabledState + :ivar default_action: Describes the default action to be applied when the + managed rule matches. Possible values include: 'Allow', 'Block', 'Log', + 'Redirect' + :vartype default_action: str or ~azure.mgmt.frontdoor.models.ActionType + :ivar description: Describes the functionality of the managed rule. + :vartype description: str + """ + + _validation = { + 'rule_id': {'readonly': True}, + 'default_state': {'readonly': True}, + 'default_action': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'default_state': {'key': 'defaultState', 'type': 'str'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedRuleDefinition, self).__init__(**kwargs) + self.rule_id = None + self.default_state = None + self.default_action = None + self.description = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_definition_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_definition_py3.py new file mode 100644 index 000000000000..1ba86cdae079 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_definition_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 + + +class ManagedRuleDefinition(Model): + """Describes a managed rule definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar rule_id: Identifier for the managed rule. + :vartype rule_id: str + :ivar default_state: Describes the default state for the managed rule. + Possible values include: 'Disabled', 'Enabled' + :vartype default_state: str or + ~azure.mgmt.frontdoor.models.ManagedRuleEnabledState + :ivar default_action: Describes the default action to be applied when the + managed rule matches. Possible values include: 'Allow', 'Block', 'Log', + 'Redirect' + :vartype default_action: str or ~azure.mgmt.frontdoor.models.ActionType + :ivar description: Describes the functionality of the managed rule. + :vartype description: str + """ + + _validation = { + 'rule_id': {'readonly': True}, + 'default_state': {'readonly': True}, + 'default_action': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'default_state': {'key': 'defaultState', 'type': 'str'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ManagedRuleDefinition, self).__init__(**kwargs) + self.rule_id = None + self.default_state = None + self.default_action = None + self.description = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_exclusion.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_exclusion.py new file mode 100644 index 000000000000..4f92404a8962 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_exclusion.py @@ -0,0 +1,52 @@ +# 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 ManagedRuleExclusion(Model): + """Exclude variables from managed rule evaluation. + + All required parameters must be populated in order to send to Azure. + + :param match_variable: Required. The variable type to be excluded. + Possible values include: 'RequestHeaderNames', 'RequestCookieNames', + 'QueryStringArgNames', 'RequestBodyPostArgNames' + :type match_variable: str or + ~azure.mgmt.frontdoor.models.ManagedRuleExclusionMatchVariable + :param selector_match_operator: Required. Comparison operator to apply to + the selector when specifying which elements in the collection this + exclusion applies to. Possible values include: 'Equals', 'Contains', + 'StartsWith', 'EndsWith', 'EqualsAny' + :type selector_match_operator: str or + ~azure.mgmt.frontdoor.models.ManagedRuleExclusionSelectorMatchOperator + :param selector: Required. Selector value for which elements in the + collection this exclusion applies to. + :type selector: str + """ + + _validation = { + 'match_variable': {'required': True}, + 'selector_match_operator': {'required': True}, + 'selector': {'required': True}, + } + + _attribute_map = { + 'match_variable': {'key': 'matchVariable', 'type': 'str'}, + 'selector_match_operator': {'key': 'selectorMatchOperator', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedRuleExclusion, self).__init__(**kwargs) + self.match_variable = kwargs.get('match_variable', None) + self.selector_match_operator = kwargs.get('selector_match_operator', None) + self.selector = kwargs.get('selector', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_exclusion_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_exclusion_py3.py new file mode 100644 index 000000000000..0ce39d22f91c --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_exclusion_py3.py @@ -0,0 +1,52 @@ +# 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 ManagedRuleExclusion(Model): + """Exclude variables from managed rule evaluation. + + All required parameters must be populated in order to send to Azure. + + :param match_variable: Required. The variable type to be excluded. + Possible values include: 'RequestHeaderNames', 'RequestCookieNames', + 'QueryStringArgNames', 'RequestBodyPostArgNames' + :type match_variable: str or + ~azure.mgmt.frontdoor.models.ManagedRuleExclusionMatchVariable + :param selector_match_operator: Required. Comparison operator to apply to + the selector when specifying which elements in the collection this + exclusion applies to. Possible values include: 'Equals', 'Contains', + 'StartsWith', 'EndsWith', 'EqualsAny' + :type selector_match_operator: str or + ~azure.mgmt.frontdoor.models.ManagedRuleExclusionSelectorMatchOperator + :param selector: Required. Selector value for which elements in the + collection this exclusion applies to. + :type selector: str + """ + + _validation = { + 'match_variable': {'required': True}, + 'selector_match_operator': {'required': True}, + 'selector': {'required': True}, + } + + _attribute_map = { + 'match_variable': {'key': 'matchVariable', 'type': 'str'}, + 'selector_match_operator': {'key': 'selectorMatchOperator', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + } + + def __init__(self, *, match_variable, selector_match_operator, selector: str, **kwargs) -> None: + super(ManagedRuleExclusion, self).__init__(**kwargs) + self.match_variable = match_variable + self.selector_match_operator = selector_match_operator + self.selector = selector diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_definition.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_definition.py new file mode 100644 index 000000000000..c9670337c72f --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_definition.py @@ -0,0 +1,45 @@ +# 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 ManagedRuleGroupDefinition(Model): + """Describes a managed rule group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar rule_group_name: Name of the managed rule group. + :vartype rule_group_name: str + :ivar description: Description of the managed rule group. + :vartype description: str + :ivar rules: List of rules within the managed rule group. + :vartype rules: list[~azure.mgmt.frontdoor.models.ManagedRuleDefinition] + """ + + _validation = { + 'rule_group_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rules': {'readonly': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ManagedRuleDefinition]'}, + } + + def __init__(self, **kwargs): + super(ManagedRuleGroupDefinition, self).__init__(**kwargs) + self.rule_group_name = None + self.description = None + self.rules = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_definition_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_definition_py3.py new file mode 100644 index 000000000000..95d1e3f303cd --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_definition_py3.py @@ -0,0 +1,45 @@ +# 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 ManagedRuleGroupDefinition(Model): + """Describes a managed rule group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar rule_group_name: Name of the managed rule group. + :vartype rule_group_name: str + :ivar description: Description of the managed rule group. + :vartype description: str + :ivar rules: List of rules within the managed rule group. + :vartype rules: list[~azure.mgmt.frontdoor.models.ManagedRuleDefinition] + """ + + _validation = { + 'rule_group_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rules': {'readonly': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ManagedRuleDefinition]'}, + } + + def __init__(self, **kwargs) -> None: + super(ManagedRuleGroupDefinition, self).__init__(**kwargs) + self.rule_group_name = None + self.description = None + self.rules = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_override.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_override.py new file mode 100644 index 000000000000..006ead2e4b59 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_override.py @@ -0,0 +1,45 @@ +# 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 ManagedRuleGroupOverride(Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. Describes the managed rule group to + override. + :type rule_group_name: str + :param exclusions: Describes the exclusions that are applied to all rules + in the group. + :type exclusions: list[~azure.mgmt.frontdoor.models.ManagedRuleExclusion] + :param rules: List of rules that will be disabled. If none specified, all + rules in the group will be disabled. + :type rules: list[~azure.mgmt.frontdoor.models.ManagedRuleOverride] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'exclusions': {'key': 'exclusions', 'type': '[ManagedRuleExclusion]'}, + 'rules': {'key': 'rules', 'type': '[ManagedRuleOverride]'}, + } + + def __init__(self, **kwargs): + super(ManagedRuleGroupOverride, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.exclusions = kwargs.get('exclusions', None) + self.rules = kwargs.get('rules', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_override_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_override_py3.py new file mode 100644 index 000000000000..9218d912569f --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_group_override_py3.py @@ -0,0 +1,45 @@ +# 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 ManagedRuleGroupOverride(Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. Describes the managed rule group to + override. + :type rule_group_name: str + :param exclusions: Describes the exclusions that are applied to all rules + in the group. + :type exclusions: list[~azure.mgmt.frontdoor.models.ManagedRuleExclusion] + :param rules: List of rules that will be disabled. If none specified, all + rules in the group will be disabled. + :type rules: list[~azure.mgmt.frontdoor.models.ManagedRuleOverride] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'exclusions': {'key': 'exclusions', 'type': '[ManagedRuleExclusion]'}, + 'rules': {'key': 'rules', 'type': '[ManagedRuleOverride]'}, + } + + def __init__(self, *, rule_group_name: str, exclusions=None, rules=None, **kwargs) -> None: + super(ManagedRuleGroupOverride, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.exclusions = exclusions + self.rules = rules diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_override.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_override.py new file mode 100644 index 000000000000..f716795d8f15 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_override.py @@ -0,0 +1,51 @@ +# 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 ManagedRuleOverride(Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. Identifier for the managed rule. + :type rule_id: str + :param enabled_state: Describes if the managed rule is in enabled or + disabled state. Defaults to Disabled if not specified. Possible values + include: 'Disabled', 'Enabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.ManagedRuleEnabledState + :param action: Describes the override action to be applied when rule + matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + :type action: str or ~azure.mgmt.frontdoor.models.ActionType + :param exclusions: Describes the exclusions that are applied to this + specific rule. + :type exclusions: list[~azure.mgmt.frontdoor.models.ManagedRuleExclusion] + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'exclusions': {'key': 'exclusions', 'type': '[ManagedRuleExclusion]'}, + } + + def __init__(self, **kwargs): + super(ManagedRuleOverride, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.enabled_state = kwargs.get('enabled_state', None) + self.action = kwargs.get('action', None) + self.exclusions = kwargs.get('exclusions', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_override_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_override_py3.py new file mode 100644 index 000000000000..502a60766dde --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_override_py3.py @@ -0,0 +1,51 @@ +# 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 ManagedRuleOverride(Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. Identifier for the managed rule. + :type rule_id: str + :param enabled_state: Describes if the managed rule is in enabled or + disabled state. Defaults to Disabled if not specified. Possible values + include: 'Disabled', 'Enabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.ManagedRuleEnabledState + :param action: Describes the override action to be applied when rule + matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + :type action: str or ~azure.mgmt.frontdoor.models.ActionType + :param exclusions: Describes the exclusions that are applied to this + specific rule. + :type exclusions: list[~azure.mgmt.frontdoor.models.ManagedRuleExclusion] + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'exclusions': {'key': 'exclusions', 'type': '[ManagedRuleExclusion]'}, + } + + def __init__(self, *, rule_id: str, enabled_state=None, action=None, exclusions=None, **kwargs) -> None: + super(ManagedRuleOverride, self).__init__(**kwargs) + self.rule_id = rule_id + self.enabled_state = enabled_state + self.action = action + self.exclusions = exclusions diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set.py index 58c23333357c..f66ce140396a 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set.py @@ -13,37 +13,39 @@ 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 + """Defines a managed rule set. 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. + :param rule_set_type: Required. Defines the rule set type to use. :type rule_set_type: str + :param rule_set_version: Required. Defines the version of the rule set to + use. + :type rule_set_version: str + :param exclusions: Describes the exclusions that are applied to all rules + in the set. + :type exclusions: list[~azure.mgmt.frontdoor.models.ManagedRuleExclusion] + :param rule_group_overrides: Defines the rule group overrides to apply to + the rule set. + :type rule_group_overrides: + list[~azure.mgmt.frontdoor.models.ManagedRuleGroupOverride] """ _validation = { 'rule_set_type': {'required': True}, + 'rule_set_version': {'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'} + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'exclusions': {'key': 'exclusions', 'type': '[ManagedRuleExclusion]'}, + 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[ManagedRuleGroupOverride]'}, } 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 + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.exclusions = kwargs.get('exclusions', None) + self.rule_group_overrides = kwargs.get('rule_group_overrides', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_definition.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_definition.py new file mode 100644 index 000000000000..0864cd16bfd0 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_definition.py @@ -0,0 +1,69 @@ +# 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 ManagedRuleSetDefinition(Resource): + """Describes the a managed rule set definition. + + 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] + :ivar provisioning_state: Provisioning state of the managed rule set. + :vartype provisioning_state: str + :ivar rule_set_type: Type of the managed rule set. + :vartype rule_set_type: str + :ivar rule_set_version: Version of the managed rule set type. + :vartype rule_set_version: str + :ivar rule_groups: Rule groups of the managed rule set. + :vartype rule_groups: + list[~azure.mgmt.frontdoor.models.ManagedRuleGroupDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'rule_set_type': {'readonly': True}, + 'rule_set_version': {'readonly': True}, + 'rule_groups': {'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}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ManagedRuleGroupDefinition]'}, + } + + def __init__(self, **kwargs): + super(ManagedRuleSetDefinition, self).__init__(**kwargs) + self.provisioning_state = None + self.rule_set_type = None + self.rule_set_version = None + self.rule_groups = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_paged.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_definition_paged.py similarity index 66% rename from sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_paged.py rename to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_definition_paged.py index 8d368f07bcd9..cdec085e91a5 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/health_probe_settings_model_paged.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_definition_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class HealthProbeSettingsModelPaged(Paged): +class ManagedRuleSetDefinitionPaged(Paged): """ - A paging container for iterating over a list of :class:`HealthProbeSettingsModel ` object + A paging container for iterating over a list of :class:`ManagedRuleSetDefinition ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[HealthProbeSettingsModel]'} + 'current_page': {'key': 'value', 'type': '[ManagedRuleSetDefinition]'} } def __init__(self, *args, **kwargs): - super(HealthProbeSettingsModelPaged, self).__init__(*args, **kwargs) + super(ManagedRuleSetDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_definition_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_definition_py3.py new file mode 100644 index 000000000000..763cc211949b --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_definition_py3.py @@ -0,0 +1,69 @@ +# 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 ManagedRuleSetDefinition(Resource): + """Describes the a managed rule set definition. + + 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] + :ivar provisioning_state: Provisioning state of the managed rule set. + :vartype provisioning_state: str + :ivar rule_set_type: Type of the managed rule set. + :vartype rule_set_type: str + :ivar rule_set_version: Version of the managed rule set type. + :vartype rule_set_version: str + :ivar rule_groups: Rule groups of the managed rule set. + :vartype rule_groups: + list[~azure.mgmt.frontdoor.models.ManagedRuleGroupDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'rule_set_type': {'readonly': True}, + 'rule_set_version': {'readonly': True}, + 'rule_groups': {'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}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ManagedRuleGroupDefinition]'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(ManagedRuleSetDefinition, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.rule_set_type = None + self.rule_set_version = None + self.rule_groups = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_list.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_list.py new file mode 100644 index 000000000000..ef51205649fc --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_list.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 ManagedRuleSetList(Model): + """Defines the list of managed rule sets for the policy. + + :param managed_rule_sets: List of rule sets. + :type managed_rule_sets: list[~azure.mgmt.frontdoor.models.ManagedRuleSet] + """ + + _attribute_map = { + 'managed_rule_sets': {'key': 'managedRuleSets', 'type': '[ManagedRuleSet]'}, + } + + def __init__(self, **kwargs): + super(ManagedRuleSetList, self).__init__(**kwargs) + self.managed_rule_sets = kwargs.get('managed_rule_sets', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_list_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_list_py3.py new file mode 100644 index 000000000000..e75eb870a407 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_list_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 ManagedRuleSetList(Model): + """Defines the list of managed rule sets for the policy. + + :param managed_rule_sets: List of rule sets. + :type managed_rule_sets: list[~azure.mgmt.frontdoor.models.ManagedRuleSet] + """ + + _attribute_map = { + 'managed_rule_sets': {'key': 'managedRuleSets', 'type': '[ManagedRuleSet]'}, + } + + def __init__(self, *, managed_rule_sets=None, **kwargs) -> None: + super(ManagedRuleSetList, self).__init__(**kwargs) + self.managed_rule_sets = managed_rule_sets diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_py3.py index 423d1317f6ca..cc77e482911a 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/managed_rule_set_py3.py @@ -13,37 +13,39 @@ 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 + """Defines a managed rule set. 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. + :param rule_set_type: Required. Defines the rule set type to use. :type rule_set_type: str + :param rule_set_version: Required. Defines the version of the rule set to + use. + :type rule_set_version: str + :param exclusions: Describes the exclusions that are applied to all rules + in the set. + :type exclusions: list[~azure.mgmt.frontdoor.models.ManagedRuleExclusion] + :param rule_group_overrides: Defines the rule group overrides to apply to + the rule set. + :type rule_group_overrides: + list[~azure.mgmt.frontdoor.models.ManagedRuleGroupOverride] """ _validation = { 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, } _attribute_map = { - 'priority': {'key': 'priority', 'type': 'int'}, - 'version': {'key': 'version', 'type': 'int'}, 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'exclusions': {'key': 'exclusions', 'type': '[ManagedRuleExclusion]'}, + 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[ManagedRuleGroupOverride]'}, } - _subtype_map = { - 'rule_set_type': {'AzureManagedRuleSet': 'AzureManagedRuleSet'} - } - - def __init__(self, *, priority: int=None, version: int=None, **kwargs) -> None: + def __init__(self, *, rule_set_type: str, rule_set_version: str, exclusions=None, rule_group_overrides=None, **kwargs) -> None: super(ManagedRuleSet, self).__init__(**kwargs) - self.priority = priority - self.version = version - self.rule_set_type = None + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.exclusions = exclusions + self.rule_group_overrides = rule_group_overrides diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition.py similarity index 58% rename from sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1.py rename to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition.py index 6667f15c68c9..1b44b3e1c91d 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition.py @@ -12,27 +12,31 @@ from msrest.serialization import Model -class MatchCondition1(Model): - """Define match conditions. +class MatchCondition(Model): + """Define a match condition. 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 + :param match_variable: Required. Request variable to compare with. + Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', + 'PostArgs', 'RequestUri', 'RequestHeader', 'RequestBody', 'Cookies', + 'SocketAddr' + :type match_variable: str or ~azure.mgmt.frontdoor.models.MatchVariable + :param selector: Match against a specific key from the QueryString, + PostArgs, RequestHeader or Cookies variables. Default is null. :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' + :param operator: Required. Comparison type to use for matching with the + variable value. Possible values include: 'Any', 'IPMatch', 'GeoMatch', + 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', + 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'RegEx' :type operator: str or ~azure.mgmt.frontdoor.models.Operator - :param negate_condition: Describes if this is negate condition or not + :param negate_condition: Describes if the result of this condition should + be negated. :type negate_condition: bool - :param match_value: Required. Match value + :param match_value: Required. List of possible match values. :type match_value: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.frontdoor.models.TransformType] """ _validation = { @@ -47,12 +51,14 @@ class MatchCondition1(Model): 'operator': {'key': 'operator', 'type': 'str'}, 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, 'match_value': {'key': 'matchValue', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, } def __init__(self, **kwargs): - super(MatchCondition1, self).__init__(**kwargs) + super(MatchCondition, 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) + self.transforms = kwargs.get('transforms', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition_py3.py similarity index 55% rename from sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1_py3.py rename to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition_py3.py index 827eae5fc708..ea65422bff52 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition1_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/match_condition_py3.py @@ -12,27 +12,31 @@ from msrest.serialization import Model -class MatchCondition1(Model): - """Define match conditions. +class MatchCondition(Model): + """Define a match condition. 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 + :param match_variable: Required. Request variable to compare with. + Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', + 'PostArgs', 'RequestUri', 'RequestHeader', 'RequestBody', 'Cookies', + 'SocketAddr' + :type match_variable: str or ~azure.mgmt.frontdoor.models.MatchVariable + :param selector: Match against a specific key from the QueryString, + PostArgs, RequestHeader or Cookies variables. Default is null. :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' + :param operator: Required. Comparison type to use for matching with the + variable value. Possible values include: 'Any', 'IPMatch', 'GeoMatch', + 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', + 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'RegEx' :type operator: str or ~azure.mgmt.frontdoor.models.Operator - :param negate_condition: Describes if this is negate condition or not + :param negate_condition: Describes if the result of this condition should + be negated. :type negate_condition: bool - :param match_value: Required. Match value + :param match_value: Required. List of possible match values. :type match_value: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.frontdoor.models.TransformType] """ _validation = { @@ -47,12 +51,14 @@ class MatchCondition1(Model): 'operator': {'key': 'operator', 'type': 'str'}, 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, 'match_value': {'key': 'matchValue', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, } - def __init__(self, *, match_variable, operator, match_value, selector: str=None, negate_condition: bool=None, **kwargs) -> None: - super(MatchCondition1, self).__init__(**kwargs) + def __init__(self, *, match_variable, operator, match_value, selector: str=None, negate_condition: bool=None, transforms=None, **kwargs) -> None: + super(MatchCondition, self).__init__(**kwargs) self.match_variable = match_variable self.selector = selector self.operator = operator self.negate_condition = negate_condition self.match_value = match_value + self.transforms = transforms diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings.py index 3046acd2c7ac..498f0afd6f02 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings.py @@ -13,22 +13,44 @@ class PolicySettings(Model): - """Defines contents of a web application firewall global configuration. + """Defines top-level WebApplicationFirewallPolicy configuration settings. - :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 + :param enabled_state: Describes if the policy is in enabled or disabled + state. Defaults to Enabled if not specified. Possible values include: + 'Disabled', 'Enabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.PolicyEnabledState + :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 + :type mode: str or ~azure.mgmt.frontdoor.models.PolicyMode + :param redirect_url: If action type is redirect, this field represents + redirect URL for the client. + :type redirect_url: str + :param custom_block_response_status_code: If the action type is block, + customer can override the response status code. + :type custom_block_response_status_code: int + :param custom_block_response_body: If the action type is block, customer + can override the response body. The body must be specified in base64 + encoding. + :type custom_block_response_body: str """ + _validation = { + 'custom_block_response_body': {'pattern': r'^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$'}, + } + _attribute_map = { 'enabled_state': {'key': 'enabledState', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, + 'redirect_url': {'key': 'redirectUrl', 'type': 'str'}, + 'custom_block_response_status_code': {'key': 'customBlockResponseStatusCode', 'type': 'int'}, + 'custom_block_response_body': {'key': 'customBlockResponseBody', '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) + self.redirect_url = kwargs.get('redirect_url', None) + self.custom_block_response_status_code = kwargs.get('custom_block_response_status_code', None) + self.custom_block_response_body = kwargs.get('custom_block_response_body', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings_py3.py index 95244a4a4274..f538e85e0755 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/policy_settings_py3.py @@ -13,22 +13,44 @@ class PolicySettings(Model): - """Defines contents of a web application firewall global configuration. + """Defines top-level WebApplicationFirewallPolicy configuration settings. - :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 + :param enabled_state: Describes if the policy is in enabled or disabled + state. Defaults to Enabled if not specified. Possible values include: + 'Disabled', 'Enabled' + :type enabled_state: str or + ~azure.mgmt.frontdoor.models.PolicyEnabledState + :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 + :type mode: str or ~azure.mgmt.frontdoor.models.PolicyMode + :param redirect_url: If action type is redirect, this field represents + redirect URL for the client. + :type redirect_url: str + :param custom_block_response_status_code: If the action type is block, + customer can override the response status code. + :type custom_block_response_status_code: int + :param custom_block_response_body: If the action type is block, customer + can override the response body. The body must be specified in base64 + encoding. + :type custom_block_response_body: str """ + _validation = { + 'custom_block_response_body': {'pattern': r'^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$'}, + } + _attribute_map = { 'enabled_state': {'key': 'enabledState', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, + 'redirect_url': {'key': 'redirectUrl', 'type': 'str'}, + 'custom_block_response_status_code': {'key': 'customBlockResponseStatusCode', 'type': 'int'}, + 'custom_block_response_body': {'key': 'customBlockResponseBody', 'type': 'str'}, } - def __init__(self, *, enabled_state=None, mode=None, **kwargs) -> None: + def __init__(self, *, enabled_state=None, mode=None, redirect_url: str=None, custom_block_response_status_code: int=None, custom_block_response_body: str=None, **kwargs) -> None: super(PolicySettings, self).__init__(**kwargs) self.enabled_state = enabled_state self.mode = mode + self.redirect_url = redirect_url + self.custom_block_response_status_code = custom_block_response_status_code + self.custom_block_response_body = custom_block_response_body diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/redirect_configuration.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/redirect_configuration.py new file mode 100644 index 000000000000..47b90831e846 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/redirect_configuration.py @@ -0,0 +1,73 @@ +# 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 .route_configuration import RouteConfiguration + + +class RedirectConfiguration(RouteConfiguration): + """Describes Redirect Route. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param redirect_type: The redirect type the rule will use when redirecting + traffic. Possible values include: 'Moved', 'Found', 'TemporaryRedirect', + 'PermanentRedirect' + :type redirect_type: str or + ~azure.mgmt.frontdoor.models.FrontDoorRedirectType + :param redirect_protocol: The protocol of the destination to where the + traffic is redirected. Possible values include: 'HttpOnly', 'HttpsOnly', + 'MatchRequest' + :type redirect_protocol: str or + ~azure.mgmt.frontdoor.models.FrontDoorRedirectProtocol + :param custom_host: Host to redirect. Leave empty to use the incoming host + as the destination host. + :type custom_host: str + :param custom_path: The full path to redirect. Path cannot be empty and + must start with /. Leave empty to use the incoming path as destination + path. + :type custom_path: str + :param custom_fragment: Fragment to add to the redirect URL. Fragment is + the part of the URL that comes after #. Do not include the #. + :type custom_fragment: str + :param custom_query_string: The set of query strings to be placed in the + redirect URL. Setting this value would replace any existing query string; + leave empty to preserve the incoming query string. Query string must be in + = format. The first ? and & will be added automatically so do + not include them in the front, but do separate multiple query strings with + &. + :type custom_query_string: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + 'redirect_type': {'key': 'redirectType', 'type': 'str'}, + 'redirect_protocol': {'key': 'redirectProtocol', 'type': 'str'}, + 'custom_host': {'key': 'customHost', 'type': 'str'}, + 'custom_path': {'key': 'customPath', 'type': 'str'}, + 'custom_fragment': {'key': 'customFragment', 'type': 'str'}, + 'custom_query_string': {'key': 'customQueryString', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RedirectConfiguration, self).__init__(**kwargs) + self.redirect_type = kwargs.get('redirect_type', None) + self.redirect_protocol = kwargs.get('redirect_protocol', None) + self.custom_host = kwargs.get('custom_host', None) + self.custom_path = kwargs.get('custom_path', None) + self.custom_fragment = kwargs.get('custom_fragment', None) + self.custom_query_string = kwargs.get('custom_query_string', None) + self.odatatype = '#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration' diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/redirect_configuration_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/redirect_configuration_py3.py new file mode 100644 index 000000000000..28641951bdf2 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/redirect_configuration_py3.py @@ -0,0 +1,73 @@ +# 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 .route_configuration_py3 import RouteConfiguration + + +class RedirectConfiguration(RouteConfiguration): + """Describes Redirect Route. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param redirect_type: The redirect type the rule will use when redirecting + traffic. Possible values include: 'Moved', 'Found', 'TemporaryRedirect', + 'PermanentRedirect' + :type redirect_type: str or + ~azure.mgmt.frontdoor.models.FrontDoorRedirectType + :param redirect_protocol: The protocol of the destination to where the + traffic is redirected. Possible values include: 'HttpOnly', 'HttpsOnly', + 'MatchRequest' + :type redirect_protocol: str or + ~azure.mgmt.frontdoor.models.FrontDoorRedirectProtocol + :param custom_host: Host to redirect. Leave empty to use the incoming host + as the destination host. + :type custom_host: str + :param custom_path: The full path to redirect. Path cannot be empty and + must start with /. Leave empty to use the incoming path as destination + path. + :type custom_path: str + :param custom_fragment: Fragment to add to the redirect URL. Fragment is + the part of the URL that comes after #. Do not include the #. + :type custom_fragment: str + :param custom_query_string: The set of query strings to be placed in the + redirect URL. Setting this value would replace any existing query string; + leave empty to preserve the incoming query string. Query string must be in + = format. The first ? and & will be added automatically so do + not include them in the front, but do separate multiple query strings with + &. + :type custom_query_string: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + 'redirect_type': {'key': 'redirectType', 'type': 'str'}, + 'redirect_protocol': {'key': 'redirectProtocol', 'type': 'str'}, + 'custom_host': {'key': 'customHost', 'type': 'str'}, + 'custom_path': {'key': 'customPath', 'type': 'str'}, + 'custom_fragment': {'key': 'customFragment', 'type': 'str'}, + 'custom_query_string': {'key': 'customQueryString', 'type': 'str'}, + } + + def __init__(self, *, redirect_type=None, redirect_protocol=None, custom_host: str=None, custom_path: str=None, custom_fragment: str=None, custom_query_string: str=None, **kwargs) -> None: + super(RedirectConfiguration, self).__init__(**kwargs) + self.redirect_type = redirect_type + self.redirect_protocol = redirect_protocol + self.custom_host = custom_host + self.custom_path = custom_path + self.custom_fragment = custom_fragment + self.custom_query_string = custom_query_string + self.odatatype = '#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration' diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/route_configuration.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/route_configuration.py new file mode 100644 index 000000000000..c3f93b30b83f --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/route_configuration.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 RouteConfiguration(Model): + """Base class for all types of Route. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ForwardingConfiguration, RedirectConfiguration + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration': 'ForwardingConfiguration', '#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration': 'RedirectConfiguration'} + } + + def __init__(self, **kwargs): + super(RouteConfiguration, self).__init__(**kwargs) + self.odatatype = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/route_configuration_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/route_configuration_py3.py new file mode 100644 index 000000000000..19badfcf9ad0 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/route_configuration_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 RouteConfiguration(Model): + """Base class for all types of Route. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ForwardingConfiguration, RedirectConfiguration + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration': 'ForwardingConfiguration', '#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration': 'RedirectConfiguration'} + } + + def __init__(self, **kwargs) -> None: + super(RouteConfiguration, self).__init__(**kwargs) + self.odatatype = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule.py index 90e6d8aa71fd..e5302a8a886b 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule.py @@ -28,25 +28,13 @@ class RoutingRule(SubResource): ~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 + ~azure.mgmt.frontdoor.models.RoutingRuleEnabledState + :param route_configuration: A reference to the routing configuration. + :type route_configuration: ~azure.mgmt.frontdoor.models.RouteConfiguration :param resource_state: Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' :type resource_state: str or @@ -66,11 +54,8 @@ class RoutingRule(SubResource): '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'}, + 'route_configuration': {'key': 'properties.routeConfiguration', 'type': 'RouteConfiguration'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, @@ -81,11 +66,8 @@ def __init__(self, **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.route_configuration = kwargs.get('route_configuration', None) self.resource_state = kwargs.get('resource_state', None) self.name = kwargs.get('name', None) self.type = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_list_result.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_list_result.py new file mode 100644 index 000000000000..b5ea266e716e --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_list_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 RoutingRuleListResult(Model): + """Result of the request to list Routing Rules. It contains a list of Routing + Rule objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of Routing Rules within a Front Door. + :vartype value: list[~azure.mgmt.frontdoor.models.RoutingRule] + :param next_link: URL to get the next set of RoutingRule objects if there + are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RoutingRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoutingRuleListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_list_result_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_list_result_py3.py new file mode 100644 index 000000000000..15dd669d006a --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_list_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 RoutingRuleListResult(Model): + """Result of the request to list Routing Rules. It contains a list of Routing + Rule objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of Routing Rules within a Front Door. + :vartype value: list[~azure.mgmt.frontdoor.models.RoutingRule] + :param next_link: URL to get the next set of RoutingRule objects if there + are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RoutingRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, next_link: str=None, **kwargs) -> None: + super(RoutingRuleListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_paged.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_paged.py deleted file mode 100644 index f45f2a926a5d..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_py3.py index 75ab2b98b1ce..e104ced5e0ad 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_py3.py @@ -28,25 +28,13 @@ class RoutingRule(SubResource): ~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 + ~azure.mgmt.frontdoor.models.RoutingRuleEnabledState + :param route_configuration: A reference to the routing configuration. + :type route_configuration: ~azure.mgmt.frontdoor.models.RouteConfiguration :param resource_state: Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' :type resource_state: str or @@ -66,26 +54,20 @@ class RoutingRule(SubResource): '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'}, + 'route_configuration': {'key': 'properties.routeConfiguration', 'type': 'RouteConfiguration'}, '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: + def __init__(self, *, id: str=None, frontend_endpoints=None, accepted_protocols=None, patterns_to_match=None, enabled_state=None, route_configuration=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.route_configuration = route_configuration self.resource_state = resource_state self.name = name self.type = None diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters.py index 53a05bba5023..5d06877b4647 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters.py @@ -22,36 +22,21 @@ class RoutingRuleUpdateParameters(Model): ~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 + ~azure.mgmt.frontdoor.models.RoutingRuleEnabledState + :param route_configuration: A reference to the routing configuration. + :type route_configuration: ~azure.mgmt.frontdoor.models.RouteConfiguration """ _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'}, + 'route_configuration': {'key': 'routeConfiguration', 'type': 'RouteConfiguration'}, } def __init__(self, **kwargs): @@ -59,8 +44,5 @@ def __init__(self, **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.route_configuration = kwargs.get('route_configuration', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters_py3.py index 473dfd8888c9..098f7552659f 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/routing_rule_update_parameters_py3.py @@ -22,45 +22,27 @@ class RoutingRuleUpdateParameters(Model): ~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 + ~azure.mgmt.frontdoor.models.RoutingRuleEnabledState + :param route_configuration: A reference to the routing configuration. + :type route_configuration: ~azure.mgmt.frontdoor.models.RouteConfiguration """ _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'}, + 'route_configuration': {'key': 'routeConfiguration', 'type': 'RouteConfiguration'}, } - 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: + def __init__(self, *, frontend_endpoints=None, accepted_protocols=None, patterns_to_match=None, enabled_state=None, route_configuration=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 + self.route_configuration = route_configuration diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy.py similarity index 76% rename from sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1.py rename to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy.py index 6ed0220ac712..a0687bd3f192 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy.py @@ -12,7 +12,7 @@ from .resource import Resource -class WebApplicationFirewallPolicy1(Resource): +class WebApplicationFirewallPolicy(Resource): """Defines web application firewall policy. Variables are only populated by the server, and will be ignored when @@ -28,20 +28,23 @@ class WebApplicationFirewallPolicy1(Resource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param policy_settings: Describes policySettings for policy + :param policy_settings: Describes settings for the 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. + :param custom_rules: Describes custom rules inside the policy. + :type custom_rules: ~azure.mgmt.frontdoor.models.CustomRuleList + :param managed_rules: Describes managed rules inside the policy. + :type managed_rules: ~azure.mgmt.frontdoor.models.ManagedRuleSetList + :ivar frontend_endpoint_links: Describes Frontend Endpoints associated + with this Web Application Firewall policy. + :vartype frontend_endpoint_links: + list[~azure.mgmt.frontdoor.models.FrontendEndpointLink] + :ivar provisioning_state: Provisioning state of the policy. :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 + ~azure.mgmt.frontdoor.models.PolicyResourceState :param etag: Gets a unique read-only string that changes whenever the resource is updated. :type etag: str @@ -51,6 +54,7 @@ class WebApplicationFirewallPolicy1(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'frontend_endpoint_links': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'resource_state': {'readonly': True}, } @@ -62,18 +66,20 @@ class WebApplicationFirewallPolicy1(Resource): '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'}, + 'custom_rules': {'key': 'properties.customRules', 'type': 'CustomRuleList'}, + 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRuleSetList'}, + 'frontend_endpoint_links': {'key': 'properties.frontendEndpointLinks', 'type': '[FrontendEndpointLink]'}, '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) + super(WebApplicationFirewallPolicy, 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.frontend_endpoint_links = None self.provisioning_state = None self.resource_state = None self.etag = kwargs.get('etag', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_paged.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy_paged.py similarity index 76% rename from sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_paged.py rename to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy_paged.py index b3fc5baabd07..3f4e59c1dd7b 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_paged.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class WebApplicationFirewallPolicy1Paged(Paged): +class WebApplicationFirewallPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`WebApplicationFirewallPolicy1 ` object + A paging container for iterating over a list of :class:`WebApplicationFirewallPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[WebApplicationFirewallPolicy1]'} + 'current_page': {'key': 'value', 'type': '[WebApplicationFirewallPolicy]'} } def __init__(self, *args, **kwargs): - super(WebApplicationFirewallPolicy1Paged, self).__init__(*args, **kwargs) + super(WebApplicationFirewallPolicyPaged, self).__init__(*args, **kwargs) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy_py3.py similarity index 76% rename from sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_py3.py rename to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy_py3.py index 5920b8383ec2..4cc4cbf0c540 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy1_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/web_application_firewall_policy_py3.py @@ -12,7 +12,7 @@ from .resource_py3 import Resource -class WebApplicationFirewallPolicy1(Resource): +class WebApplicationFirewallPolicy(Resource): """Defines web application firewall policy. Variables are only populated by the server, and will be ignored when @@ -28,20 +28,23 @@ class WebApplicationFirewallPolicy1(Resource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param policy_settings: Describes policySettings for policy + :param policy_settings: Describes settings for the 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. + :param custom_rules: Describes custom rules inside the policy. + :type custom_rules: ~azure.mgmt.frontdoor.models.CustomRuleList + :param managed_rules: Describes managed rules inside the policy. + :type managed_rules: ~azure.mgmt.frontdoor.models.ManagedRuleSetList + :ivar frontend_endpoint_links: Describes Frontend Endpoints associated + with this Web Application Firewall policy. + :vartype frontend_endpoint_links: + list[~azure.mgmt.frontdoor.models.FrontendEndpointLink] + :ivar provisioning_state: Provisioning state of the policy. :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 + ~azure.mgmt.frontdoor.models.PolicyResourceState :param etag: Gets a unique read-only string that changes whenever the resource is updated. :type etag: str @@ -51,6 +54,7 @@ class WebApplicationFirewallPolicy1(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'frontend_endpoint_links': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'resource_state': {'readonly': True}, } @@ -62,18 +66,20 @@ class WebApplicationFirewallPolicy1(Resource): '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'}, + 'custom_rules': {'key': 'properties.customRules', 'type': 'CustomRuleList'}, + 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRuleSetList'}, + 'frontend_endpoint_links': {'key': 'properties.frontendEndpointLinks', 'type': '[FrontendEndpointLink]'}, '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) + super(WebApplicationFirewallPolicy, self).__init__(location=location, tags=tags, **kwargs) self.policy_settings = policy_settings self.custom_rules = custom_rules self.managed_rules = managed_rules + self.frontend_endpoint_links = None self.provisioning_state = None self.resource_state = None self.etag = etag diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py index 8f1ba5d477fb..29cd448203e8 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py @@ -10,21 +10,15 @@ # -------------------------------------------------------------------------- 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 +from .managed_rule_sets_operations import ManagedRuleSetsOperations __all__ = [ 'FrontDoorsOperations', - 'RoutingRulesOperations', - 'HealthProbeSettingsOperations', - 'LoadBalancingSettingsOperations', - 'BackendPoolsOperations', 'FrontendEndpointsOperations', 'EndpointsOperations', 'PoliciesOperations', + 'ManagedRuleSetsOperations', ] diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/backend_pools_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/backend_pools_operations.py deleted file mode 100644 index e7ddae7b45fe..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/backend_pools_operations.py +++ /dev/null @@ -1,376 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/endpoints_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/endpoints_operations.py index 16b6fe5722b8..54cb258ca99b 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/endpoints_operations.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/endpoints_operations.py @@ -24,7 +24,7 @@ class EndpointsOperations(object): :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". + :ivar api_version: Client API version. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-08-01" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/front_doors_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/front_doors_operations.py index 0e7070406164..1ae400044c09 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/front_doors_operations.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/front_doors_operations.py @@ -24,7 +24,7 @@ class FrontDoorsOperations(object): :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". + :ivar api_version: Client API version. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-08-01" + self.api_version = "2019-05-01" self.config = config diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/frontend_endpoints_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/frontend_endpoints_operations.py index 0e82bdf28f54..9116cd70f085 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/frontend_endpoints_operations.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/frontend_endpoints_operations.py @@ -24,7 +24,7 @@ class FrontendEndpointsOperations(object): :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". + :ivar api_version: Client API version. Constant value: "2019-05-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-08-01" + self.api_version = "2019-05-01" self.config = config @@ -178,204 +178,6 @@ def get( 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 diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/health_probe_settings_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/health_probe_settings_operations.py deleted file mode 100644 index a8e0356a75cc..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/health_probe_settings_operations.py +++ /dev/null @@ -1,377 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/load_balancing_settings_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/load_balancing_settings_operations.py deleted file mode 100644 index 6813d14f1ec9..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/load_balancing_settings_operations.py +++ /dev/null @@ -1,378 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/managed_rule_sets_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/managed_rule_sets_operations.py new file mode 100644 index 000000000000..5c804ff1f848 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/managed_rule_sets_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ManagedRuleSetsOperations(object): + """ManagedRuleSetsOperations 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: "2019-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all available managed rule sets. + + :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 ManagedRuleSetDefinition + :rtype: + ~azure.mgmt.frontdoor.models.ManagedRuleSetDefinitionPaged[~azure.mgmt.frontdoor.models.ManagedRuleSetDefinition] + :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.ManagedRuleSetDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ManagedRuleSetDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallManagedRuleSets'} diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/policies_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/policies_operations.py index 228a22b5c995..49eb097d5b19 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/policies_operations.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/policies_operations.py @@ -25,7 +25,7 @@ class PoliciesOperations(object): :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". + :ivar api_version: Client API version. Constant value: "2019-10-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-08-01" + self.api_version = "2019-10-01" self.config = config @@ -43,16 +43,17 @@ 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. + :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 WebApplicationFirewallPolicy1 + :return: An iterator like instance of WebApplicationFirewallPolicy :rtype: - ~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy1Paged[~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy1] + ~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicyPaged[~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy] :raises: :class:`ErrorResponseException` """ @@ -62,7 +63,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -95,11 +96,11 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.WebApplicationFirewallPolicy1Paged(internal_paging, self._deserialize.dependencies) + deserialized = models.WebApplicationFirewallPolicyPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.WebApplicationFirewallPolicy1Paged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.WebApplicationFirewallPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized @@ -109,18 +110,18 @@ 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. + :param resource_group_name: Name of the Resource group within the + Azure subscription. :type resource_group_name: str - :param policy_name: The name of the resource group. + :param policy_name: The name of the Web Application Firewall Policy. :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 + :return: WebApplicationFirewallPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -128,7 +129,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), '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') } @@ -158,7 +159,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('WebApplicationFirewallPolicy1', response) + deserialized = self._deserialize('WebApplicationFirewallPolicy', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -167,34 +168,13 @@ def get( 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` - """ + def _create_or_update_initial( + self, resource_group_name, policy_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), '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') } @@ -216,27 +196,83 @@ def create_or_update( 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') + body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') # 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]: + 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('WebApplicationFirewallPolicy1', response) + deserialized = self._deserialize('WebApplicationFirewallPolicy', response) if response.status_code == 201: - deserialized = self._deserialize('WebApplicationFirewallPolicy1', response) + deserialized = self._deserialize('WebApplicationFirewallPolicy', response) + if response.status_code == 202: + deserialized = self._deserialize('WebApplicationFirewallPolicy', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + + def create_or_update( + self, resource_group_name, policy_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update policy with specified rule set name within a resource + group. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param policy_name: The name of the Web Application Firewall Policy. + :type policy_name: str + :param parameters: Policy to be created. + :type parameters: + ~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy + :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 + WebApplicationFirewallPolicy or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.WebApplicationFirewallPolicy]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + policy_name=policy_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WebApplicationFirewallPolicy', 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/FrontDoorWebApplicationFirewallPolicies/{policyName}'} @@ -245,7 +281,7 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), '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') } @@ -281,9 +317,10 @@ 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. + :param resource_group_name: Name of the Resource group within the + Azure subscription. :type resource_group_name: str - :param policy_name: The name of the resource group. + :param policy_name: The name of the Web Application Firewall Policy. :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 diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/routing_rules_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/routing_rules_operations.py deleted file mode 100644 index 568968537d1a..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/routing_rules_operations.py +++ /dev/null @@ -1,376 +0,0 @@ -# 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/sdk/network/azure-mgmt-frontdoor/setup.py b/sdk/network/azure-mgmt-frontdoor/setup.py index bff1de6438bb..bb1b4df3475f 100644 --- a/sdk/network/azure-mgmt-frontdoor/setup.py +++ b/sdk/network/azure-mgmt-frontdoor/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com', @@ -63,7 +64,6 @@ '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',