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 bcaf7660d09f..84761d534350 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 @@ -13,20 +13,22 @@ from msrest import Serializer, Deserializer from ._configuration import FrontDoorManagementClientConfiguration -from .operations import FrontDoorManagementClientOperationsMixin from .operations import NetworkExperimentProfilesOperations from .operations import PreconfiguredEndpointsOperations from .operations import ExperimentsOperations from .operations import ReportsOperations +from .operations import FrontDoorNameAvailabilityOperations +from .operations import FrontDoorNameAvailabilityWithSubscriptionOperations from .operations import FrontDoorsOperations from .operations import FrontendEndpointsOperations from .operations import EndpointsOperations +from .operations import RulesEnginesOperations from .operations import PoliciesOperations from .operations import ManagedRuleSetsOperations from . import models -class FrontDoorManagementClient(FrontDoorManagementClientOperationsMixin, SDKClient): +class FrontDoorManagementClient(SDKClient): """FrontDoor Client :ivar config: Configuration for client. @@ -40,12 +42,18 @@ class FrontDoorManagementClient(FrontDoorManagementClientOperationsMixin, SDKCli :vartype experiments: azure.mgmt.frontdoor.operations.ExperimentsOperations :ivar reports: Reports operations :vartype reports: azure.mgmt.frontdoor.operations.ReportsOperations + :ivar front_door_name_availability: FrontDoorNameAvailability operations + :vartype front_door_name_availability: azure.mgmt.frontdoor.operations.FrontDoorNameAvailabilityOperations + :ivar front_door_name_availability_with_subscription: FrontDoorNameAvailabilityWithSubscription operations + :vartype front_door_name_availability_with_subscription: azure.mgmt.frontdoor.operations.FrontDoorNameAvailabilityWithSubscriptionOperations :ivar front_doors: FrontDoors operations :vartype front_doors: azure.mgmt.frontdoor.operations.FrontDoorsOperations :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 rules_engines: RulesEngines operations + :vartype rules_engines: azure.mgmt.frontdoor.operations.RulesEnginesOperations :ivar policies: Policies operations :vartype policies: azure.mgmt.frontdoor.operations.PoliciesOperations :ivar managed_rule_sets: ManagedRuleSets operations @@ -79,12 +87,18 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.reports = ReportsOperations( self._client, self.config, self._serialize, self._deserialize) + self.front_door_name_availability = FrontDoorNameAvailabilityOperations( + self._client, self.config, self._serialize, self._deserialize) + self.front_door_name_availability_with_subscription = FrontDoorNameAvailabilityWithSubscriptionOperations( + self._client, self.config, self._serialize, self._deserialize) self.front_doors = FrontDoorsOperations( 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.rules_engines = RulesEnginesOperations( + self._client, self.config, self._serialize, self._deserialize) self.policies = PoliciesOperations( self._client, self.config, self._serialize, self._deserialize) self.managed_rule_sets = ManagedRuleSetsOperations( 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 1fc048f731ec..bb39a347cbd5 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 @@ -35,6 +35,7 @@ from ._models_py3 import FrontendEndpointLink from ._models_py3 import FrontendEndpointUpdateParameters from ._models_py3 import FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink + from ._models_py3 import HeaderAction from ._models_py3 import HealthProbeSettingsListResult from ._models_py3 import HealthProbeSettingsModel from ._models_py3 import HealthProbeSettingsUpdateParameters @@ -62,8 +63,17 @@ from ._models_py3 import Resource from ._models_py3 import RouteConfiguration from ._models_py3 import RoutingRule + from ._models_py3 import RoutingRuleLink from ._models_py3 import RoutingRuleListResult from ._models_py3 import RoutingRuleUpdateParameters + from ._models_py3 import RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink + from ._models_py3 import RulesEngine + from ._models_py3 import RulesEngineAction + from ._models_py3 import RulesEngineMatchCondition + from ._models_py3 import RulesEngineRule + from ._models_py3 import RulesEngineUpdateParameters + from ._models_py3 import SecurityPolicyLink + from ._models_py3 import Sku from ._models_py3 import SubResource from ._models_py3 import TagsObject from ._models_py3 import Timeseries @@ -97,6 +107,7 @@ from ._models import FrontendEndpointLink from ._models import FrontendEndpointUpdateParameters from ._models import FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink + from ._models import HeaderAction from ._models import HealthProbeSettingsListResult from ._models import HealthProbeSettingsModel from ._models import HealthProbeSettingsUpdateParameters @@ -124,8 +135,17 @@ from ._models import Resource from ._models import RouteConfiguration from ._models import RoutingRule + from ._models import RoutingRuleLink from ._models import RoutingRuleListResult from ._models import RoutingRuleUpdateParameters + from ._models import RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink + from ._models import RulesEngine + from ._models import RulesEngineAction + from ._models import RulesEngineMatchCondition + from ._models import RulesEngineRule + from ._models import RulesEngineUpdateParameters + from ._models import SecurityPolicyLink + from ._models import Sku from ._models import SubResource from ._models import TagsObject from ._models import Timeseries @@ -139,6 +159,7 @@ from ._paged_models import ManagedRuleSetDefinitionPaged from ._paged_models import PreconfiguredEndpointPaged from ._paged_models import ProfilePaged +from ._paged_models import RulesEnginePaged from ._paged_models import WebApplicationFirewallPolicyPaged from ._front_door_management_client_enums import ( NetworkOperationStatus, @@ -162,24 +183,33 @@ DynamicCompressionEnabled, FrontDoorRedirectType, FrontDoorRedirectProtocol, + PrivateEndpointStatus, BackendEnabledState, FrontDoorHealthProbeMethod, HealthProbeEnabled, SessionAffinityEnabledState, + HeaderActionType, + RulesEngineMatchVariable, + RulesEngineOperator, + Transform, + MatchProcessingBehavior, ResourceType, Availability, PolicyEnabledState, PolicyMode, + PolicyRequestBodyCheck, CustomRuleEnabledState, RuleType, MatchVariable, Operator, TransformType, ActionType, + ManagedRuleSetActionType, ManagedRuleExclusionMatchVariable, ManagedRuleExclusionSelectorMatchOperator, ManagedRuleEnabledState, PolicyResourceState, + SkuName, LatencyScorecardAggregationInterval, TimeseriesAggregationInterval, ) @@ -210,6 +240,7 @@ 'FrontendEndpointLink', 'FrontendEndpointUpdateParameters', 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink', + 'HeaderAction', 'HealthProbeSettingsListResult', 'HealthProbeSettingsModel', 'HealthProbeSettingsUpdateParameters', @@ -237,8 +268,17 @@ 'Resource', 'RouteConfiguration', 'RoutingRule', + 'RoutingRuleLink', 'RoutingRuleListResult', 'RoutingRuleUpdateParameters', + 'RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink', + 'RulesEngine', + 'RulesEngineAction', + 'RulesEngineMatchCondition', + 'RulesEngineRule', + 'RulesEngineUpdateParameters', + 'SecurityPolicyLink', + 'Sku', 'SubResource', 'TagsObject', 'Timeseries', @@ -251,6 +291,7 @@ 'ExperimentPaged', 'FrontDoorPaged', 'FrontendEndpointPaged', + 'RulesEnginePaged', 'WebApplicationFirewallPolicyPaged', 'ManagedRuleSetDefinitionPaged', 'NetworkOperationStatus', @@ -274,24 +315,33 @@ 'DynamicCompressionEnabled', 'FrontDoorRedirectType', 'FrontDoorRedirectProtocol', + 'PrivateEndpointStatus', 'BackendEnabledState', 'FrontDoorHealthProbeMethod', 'HealthProbeEnabled', 'SessionAffinityEnabledState', + 'HeaderActionType', + 'RulesEngineMatchVariable', + 'RulesEngineOperator', + 'Transform', + 'MatchProcessingBehavior', 'ResourceType', 'Availability', 'PolicyEnabledState', 'PolicyMode', + 'PolicyRequestBodyCheck', 'CustomRuleEnabledState', 'RuleType', 'MatchVariable', 'Operator', 'TransformType', 'ActionType', + 'ManagedRuleSetActionType', 'ManagedRuleExclusionMatchVariable', 'ManagedRuleExclusionSelectorMatchOperator', 'ManagedRuleEnabledState', 'PolicyResourceState', + 'SkuName', 'LatencyScorecardAggregationInterval', 'TimeseriesAggregationInterval', ] 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 3b6f0ce5093f..455e843a743d 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 @@ -142,6 +142,8 @@ class FrontDoorQuery(str, Enum): strip_none = "StripNone" strip_all = "StripAll" + strip_only = "StripOnly" + strip_all_except = "StripAllExcept" class DynamicCompressionEnabled(str, Enum): @@ -165,6 +167,15 @@ class FrontDoorRedirectProtocol(str, Enum): match_request = "MatchRequest" +class PrivateEndpointStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + timeout = "Timeout" + + class BackendEnabledState(str, Enum): enabled = "Enabled" @@ -189,6 +200,60 @@ class SessionAffinityEnabledState(str, Enum): disabled = "Disabled" +class HeaderActionType(str, Enum): + + append = "Append" + delete = "Delete" + overwrite = "Overwrite" + + +class RulesEngineMatchVariable(str, Enum): + + is_mobile = "IsMobile" + remote_addr = "RemoteAddr" + request_method = "RequestMethod" + query_string = "QueryString" + post_args = "PostArgs" + request_uri = "RequestUri" + request_path = "RequestPath" + request_filename = "RequestFilename" + request_filename_extension = "RequestFilenameExtension" + request_header = "RequestHeader" + request_body = "RequestBody" + request_scheme = "RequestScheme" + + +class RulesEngineOperator(str, Enum): + + any = "Any" + ip_match = "IPMatch" + geo_match = "GeoMatch" + equal = "Equal" + contains = "Contains" + less_than = "LessThan" + greater_than = "GreaterThan" + less_than_or_equal = "LessThanOrEqual" + greater_than_or_equal = "GreaterThanOrEqual" + begins_with = "BeginsWith" + ends_with = "EndsWith" + + +class Transform(str, Enum): + + lowercase = "Lowercase" + uppercase = "Uppercase" + trim = "Trim" + url_decode = "UrlDecode" + url_encode = "UrlEncode" + remove_nulls = "RemoveNulls" + + +class MatchProcessingBehavior(str, Enum): + + continue_enum = "Continue" + stop = "Stop" + + class ResourceType(str, Enum): microsoft_networkfront_doors = "Microsoft.Network/frontDoors" @@ -213,6 +278,12 @@ class PolicyMode(str, Enum): detection = "Detection" +class PolicyRequestBodyCheck(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + class CustomRuleEnabledState(str, Enum): disabled = "Disabled" @@ -272,12 +343,20 @@ class ActionType(str, Enum): redirect = "Redirect" +class ManagedRuleSetActionType(str, Enum): + + 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" + request_body_json_arg_names = "RequestBodyJsonArgNames" class ManagedRuleExclusionSelectorMatchOperator(str, Enum): @@ -305,6 +384,13 @@ class PolicyResourceState(str, Enum): deleting = "Deleting" +class SkuName(str, Enum): + + classic_azure_front_door = "Classic_AzureFrontDoor" + standard_azure_front_door = "Standard_AzureFrontDoor" + premium_azure_front_door = "Premium_AzureFrontDoor" + + class LatencyScorecardAggregationInterval(str, Enum): daily = "Daily" diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models.py index dafda2e813cd..c257d82a9034 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models.py @@ -45,8 +45,29 @@ def __init__(self, **kwargs): class Backend(Model): """Backend address of a frontDoor load balancer. + Variables are only populated by the server, and will be ignored when + sending a request. + :param address: Location of the backend (IP address or FQDN) :type address: str + :param private_link_alias: The Alias of the Private Link resource. + Populating this optional field indicates that this backend is 'Private' + :type private_link_alias: str + :param private_link_resource_id: The Resource Id of the Private Link + resource. Populating this optional field indicates that this backend is + 'Private' + :type private_link_resource_id: str + :param private_link_location: The location of the Private Link resource. + Required only if 'privateLinkResourceId' is populated + :type private_link_location: str + :ivar private_endpoint_status: The Approval status for the connection to + the Private Link. Possible values include: 'Pending', 'Approved', + 'Rejected', 'Disconnected', 'Timeout' + :vartype private_endpoint_status: str or + ~azure.mgmt.frontdoor.models.PrivateEndpointStatus + :param private_link_approval_message: A custom message to be included in + the approval request to connect to the Private Link + :type private_link_approval_message: str :param http_port: The HTTP TCP port number. Must be between 1 and 65535. :type http_port: int :param https_port: The HTTPS TCP port number. Must be between 1 and 65535. @@ -68,6 +89,7 @@ class Backend(Model): """ _validation = { + 'private_endpoint_status': {'readonly': True}, 'http_port': {'maximum': 65535, 'minimum': 1}, 'https_port': {'maximum': 65535, 'minimum': 1}, 'priority': {'maximum': 5, 'minimum': 1}, @@ -76,6 +98,11 @@ class Backend(Model): _attribute_map = { 'address': {'key': 'address', 'type': 'str'}, + 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, + 'private_endpoint_status': {'key': 'privateEndpointStatus', 'type': 'str'}, + 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, 'http_port': {'key': 'httpPort', 'type': 'int'}, 'https_port': {'key': 'httpsPort', 'type': 'int'}, 'enabled_state': {'key': 'enabledState', 'type': 'str'}, @@ -87,6 +114,11 @@ class Backend(Model): def __init__(self, **kwargs): super(Backend, self).__init__(**kwargs) self.address = kwargs.get('address', None) + self.private_link_alias = kwargs.get('private_link_alias', None) + self.private_link_resource_id = kwargs.get('private_link_resource_id', None) + self.private_link_location = kwargs.get('private_link_location', None) + self.private_endpoint_status = None + self.private_link_approval_message = kwargs.get('private_link_approval_message', None) self.http_port = kwargs.get('http_port', None) self.https_port = kwargs.get('https_port', None) self.enabled_state = kwargs.get('enabled_state', None) @@ -247,24 +279,37 @@ class CacheConfiguration(Model): provide a cacheConfiguration object. :param query_parameter_strip_directive: Treatment of URL query terms when - forming the cache key. Possible values include: 'StripNone', 'StripAll' + forming the cache key. Possible values include: 'StripNone', 'StripAll', + 'StripOnly', 'StripAllExcept' :type query_parameter_strip_directive: str or ~azure.mgmt.frontdoor.models.FrontDoorQuery + :param query_parameters: query parameters to include or exclude (comma + separated). + :type query_parameters: str :param dynamic_compression: Whether to use dynamic compression for cached content. Possible values include: 'Enabled', 'Disabled' :type dynamic_compression: str or ~azure.mgmt.frontdoor.models.DynamicCompressionEnabled + :param cache_duration: The duration for which the content needs to be + cached. Allowed format is in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations). HTTP requires the value + to be no more than a year + :type cache_duration: timedelta """ _attribute_map = { 'query_parameter_strip_directive': {'key': 'queryParameterStripDirective', 'type': 'str'}, + 'query_parameters': {'key': 'queryParameters', 'type': 'str'}, 'dynamic_compression': {'key': 'dynamicCompression', 'type': 'str'}, + 'cache_duration': {'key': 'cacheDuration', 'type': 'duration'}, } def __init__(self, **kwargs): super(CacheConfiguration, self).__init__(**kwargs) self.query_parameter_strip_directive = kwargs.get('query_parameter_strip_directive', None) + self.query_parameters = kwargs.get('query_parameters', None) self.dynamic_compression = kwargs.get('dynamic_compression', None) + self.cache_duration = kwargs.get('cache_duration', None) class CheckNameAvailabilityInput(Model): @@ -862,6 +907,11 @@ class FrontDoor(Resource): :vartype provisioning_state: str :ivar cname: The host that each frontendEndpoint must CNAME to. :vartype cname: str + :ivar frontdoor_id: The Id of the frontdoor. + :vartype frontdoor_id: str + :ivar rules_engines: Rules Engine Configurations available to routing + rules. + :vartype rules_engines: list[~azure.mgmt.frontdoor.models.RulesEngine] """ _validation = { @@ -870,6 +920,8 @@ class FrontDoor(Resource): 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'cname': {'readonly': True}, + 'frontdoor_id': {'readonly': True}, + 'rules_engines': {'readonly': True}, } _attribute_map = { @@ -889,6 +941,8 @@ class FrontDoor(Resource): 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'cname': {'key': 'properties.cname', 'type': 'str'}, + 'frontdoor_id': {'key': 'properties.frontdoorId', 'type': 'str'}, + 'rules_engines': {'key': 'properties.rulesEngines', 'type': '[RulesEngine]'}, } def __init__(self, **kwargs): @@ -904,6 +958,8 @@ def __init__(self, **kwargs): self.resource_state = kwargs.get('resource_state', None) self.provisioning_state = None self.cname = None + self.frontdoor_id = None + self.rules_engines = None class FrontDoorUpdateParameters(Model): @@ -1114,6 +1170,41 @@ def __init__(self, **kwargs): self.id = kwargs.get('id', None) +class HeaderAction(Model): + """An action that can manipulate an http header. + + All required parameters must be populated in order to send to Azure. + + :param header_action_type: Required. Which type of manipulation to apply + to the header. Possible values include: 'Append', 'Delete', 'Overwrite' + :type header_action_type: str or + ~azure.mgmt.frontdoor.models.HeaderActionType + :param header_name: Required. The name of the header this action will + apply to. + :type header_name: str + :param value: The value to update the given header name with. This value + is not used if the actionType is Delete. + :type value: str + """ + + _validation = { + 'header_action_type': {'required': True}, + 'header_name': {'required': True}, + } + + _attribute_map = { + 'header_action_type': {'key': 'headerActionType', 'type': 'str'}, + 'header_name': {'key': 'headerName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HeaderAction, self).__init__(**kwargs) + self.header_action_type = kwargs.get('header_action_type', None) + self.header_name = kwargs.get('header_name', None) + self.value = kwargs.get('value', None) + + 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. @@ -1576,7 +1667,8 @@ class ManagedRuleExclusion(Model): :param match_variable: Required. The variable type to be excluded. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', - 'QueryStringArgNames', 'RequestBodyPostArgNames' + 'QueryStringArgNames', 'RequestBodyPostArgNames', + 'RequestBodyJsonArgNames' :type match_variable: str or ~azure.mgmt.frontdoor.models.ManagedRuleExclusionMatchVariable :param selector_match_operator: Required. Comparison operator to apply to @@ -1724,6 +1816,10 @@ class ManagedRuleSet(Model): :param rule_set_version: Required. Defines the version of the rule set to use. :type rule_set_version: str + :param rule_set_action: Possible values include: 'Block', 'Log', + 'Redirect' + :type rule_set_action: str or + ~azure.mgmt.frontdoor.models.ManagedRuleSetActionType :param exclusions: Describes the exclusions that are applied to all rules in the set. :type exclusions: list[~azure.mgmt.frontdoor.models.ManagedRuleExclusion] @@ -1741,6 +1837,7 @@ class ManagedRuleSet(Model): _attribute_map = { 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'rule_set_action': {'key': 'ruleSetAction', 'type': 'str'}, 'exclusions': {'key': 'exclusions', 'type': '[ManagedRuleExclusion]'}, 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[ManagedRuleGroupOverride]'}, } @@ -1749,6 +1846,7 @@ def __init__(self, **kwargs): super(ManagedRuleSet, self).__init__(**kwargs) self.rule_set_type = kwargs.get('rule_set_type', None) self.rule_set_version = kwargs.get('rule_set_version', None) + self.rule_set_action = kwargs.get('rule_set_action', None) self.exclusions = kwargs.get('exclusions', None) self.rule_group_overrides = kwargs.get('rule_group_overrides', None) @@ -1771,6 +1869,8 @@ class ManagedRuleSetDefinition(Resource): :type tags: dict[str, str] :ivar provisioning_state: Provisioning state of the managed rule set. :vartype provisioning_state: str + :ivar rule_set_id: Id of the managed rule set. + :vartype rule_set_id: 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. @@ -1785,6 +1885,7 @@ class ManagedRuleSetDefinition(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'rule_set_id': {'readonly': True}, 'rule_set_type': {'readonly': True}, 'rule_set_version': {'readonly': True}, 'rule_groups': {'readonly': True}, @@ -1797,6 +1898,7 @@ class ManagedRuleSetDefinition(Resource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_id': {'key': 'properties.ruleSetId', '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]'}, @@ -1805,6 +1907,7 @@ class ManagedRuleSetDefinition(Resource): def __init__(self, **kwargs): super(ManagedRuleSetDefinition, self).__init__(**kwargs) self.provisioning_state = None + self.rule_set_id = None self.rule_set_type = None self.rule_set_version = None self.rule_groups = None @@ -1899,6 +2002,10 @@ class PolicySettings(Model): can override the response body. The body must be specified in base64 encoding. :type custom_block_response_body: str + :param request_body_check: Describes if policy managed rules will inspect + the request body content. Possible values include: 'Disabled', 'Enabled' + :type request_body_check: str or + ~azure.mgmt.frontdoor.models.PolicyRequestBodyCheck """ _validation = { @@ -1911,6 +2018,7 @@ class PolicySettings(Model): 'redirect_url': {'key': 'redirectUrl', 'type': 'str'}, 'custom_block_response_status_code': {'key': 'customBlockResponseStatusCode', 'type': 'int'}, 'custom_block_response_body': {'key': 'customBlockResponseBody', 'type': 'str'}, + 'request_body_check': {'key': 'requestBodyCheck', 'type': 'str'}, } def __init__(self, **kwargs): @@ -1920,6 +2028,7 @@ def __init__(self, **kwargs): 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) + self.request_body_check = kwargs.get('request_body_check', None) class PreconfiguredEndpoint(Resource): @@ -2155,6 +2264,13 @@ class RoutingRule(SubResource): ~azure.mgmt.frontdoor.models.RoutingRuleEnabledState :param route_configuration: A reference to the routing configuration. :type route_configuration: ~azure.mgmt.frontdoor.models.RouteConfiguration + :param rules_engine: A reference to a specific Rules Engine Configuration + to apply to this route. + :type rules_engine: ~azure.mgmt.frontdoor.models.SubResource + :param web_application_firewall_policy_link: Defines the Web Application + Firewall policy for each routing rule (if applicable) + :type web_application_firewall_policy_link: + ~azure.mgmt.frontdoor.models.RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink :param resource_state: Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' :type resource_state: str or @@ -2176,6 +2292,8 @@ class RoutingRule(SubResource): 'patterns_to_match': {'key': 'properties.patternsToMatch', 'type': '[str]'}, 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, 'route_configuration': {'key': 'properties.routeConfiguration', 'type': 'RouteConfiguration'}, + 'rules_engine': {'key': 'properties.rulesEngine', 'type': 'SubResource'}, + 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, @@ -2188,11 +2306,29 @@ def __init__(self, **kwargs): self.patterns_to_match = kwargs.get('patterns_to_match', None) self.enabled_state = kwargs.get('enabled_state', None) self.route_configuration = kwargs.get('route_configuration', None) + self.rules_engine = kwargs.get('rules_engine', None) + self.web_application_firewall_policy_link = kwargs.get('web_application_firewall_policy_link', None) self.resource_state = kwargs.get('resource_state', None) self.name = kwargs.get('name', None) self.type = None +class RoutingRuleLink(Model): + """Defines the Resource ID for a Routing Rule. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoutingRuleLink, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + 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. @@ -2239,6 +2375,13 @@ class RoutingRuleUpdateParameters(Model): ~azure.mgmt.frontdoor.models.RoutingRuleEnabledState :param route_configuration: A reference to the routing configuration. :type route_configuration: ~azure.mgmt.frontdoor.models.RouteConfiguration + :param rules_engine: A reference to a specific Rules Engine Configuration + to apply to this route. + :type rules_engine: ~azure.mgmt.frontdoor.models.SubResource + :param web_application_firewall_policy_link: Defines the Web Application + Firewall policy for each routing rule (if applicable) + :type web_application_firewall_policy_link: + ~azure.mgmt.frontdoor.models.RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink """ _attribute_map = { @@ -2247,6 +2390,8 @@ class RoutingRuleUpdateParameters(Model): 'patterns_to_match': {'key': 'patternsToMatch', 'type': '[str]'}, 'enabled_state': {'key': 'enabledState', 'type': 'str'}, 'route_configuration': {'key': 'routeConfiguration', 'type': 'RouteConfiguration'}, + 'rules_engine': {'key': 'rulesEngine', 'type': 'SubResource'}, + 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink'}, } def __init__(self, **kwargs): @@ -2256,6 +2401,258 @@ def __init__(self, **kwargs): self.patterns_to_match = kwargs.get('patterns_to_match', None) self.enabled_state = kwargs.get('enabled_state', None) self.route_configuration = kwargs.get('route_configuration', None) + self.rules_engine = kwargs.get('rules_engine', None) + self.web_application_firewall_policy_link = kwargs.get('web_application_firewall_policy_link', None) + + +class RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink(Model): + """Defines the Web Application Firewall policy for each routing rule (if + applicable). + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class RulesEngine(Model): + """A rules engine configuration containing a list of rules that will run to + modify the runtime behavior of the request and response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param rules: A list of rules that define a particular Rules Engine + Configuration. + :type rules: list[~azure.mgmt.frontdoor.models.RulesEngineRule] + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar id: Resource ID. + :vartype id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'rules': {'key': 'properties.rules', 'type': '[RulesEngineRule]'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RulesEngine, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.resource_state = kwargs.get('resource_state', None) + self.name = None + self.type = None + self.id = None + + +class RulesEngineAction(Model): + """One or more actions that will execute, modifying the request and/or + response. + + :param request_header_actions: A list of header actions to apply from the + request from AFD to the origin. + :type request_header_actions: + list[~azure.mgmt.frontdoor.models.HeaderAction] + :param response_header_actions: A list of header actions to apply from the + response from AFD to the client. + :type response_header_actions: + list[~azure.mgmt.frontdoor.models.HeaderAction] + :param route_configuration_override: Override the route configuration. + :type route_configuration_override: + ~azure.mgmt.frontdoor.models.RouteConfiguration + """ + + _attribute_map = { + 'request_header_actions': {'key': 'requestHeaderActions', 'type': '[HeaderAction]'}, + 'response_header_actions': {'key': 'responseHeaderActions', 'type': '[HeaderAction]'}, + 'route_configuration_override': {'key': 'routeConfigurationOverride', 'type': 'RouteConfiguration'}, + } + + def __init__(self, **kwargs): + super(RulesEngineAction, self).__init__(**kwargs) + self.request_header_actions = kwargs.get('request_header_actions', None) + self.response_header_actions = kwargs.get('response_header_actions', None) + self.route_configuration_override = kwargs.get('route_configuration_override', None) + + +class RulesEngineMatchCondition(Model): + """Define a match condition. + + All required parameters must be populated in order to send to Azure. + + :param rules_engine_match_variable: Required. Match Variable. Possible + values include: 'IsMobile', 'RemoteAddr', 'RequestMethod', 'QueryString', + 'PostArgs', 'RequestUri', 'RequestPath', 'RequestFilename', + 'RequestFilenameExtension', 'RequestHeader', 'RequestBody', + 'RequestScheme' + :type rules_engine_match_variable: str or + ~azure.mgmt.frontdoor.models.RulesEngineMatchVariable + :param selector: Name of selector in RequestHeader or RequestBody to be + matched + :type selector: str + :param rules_engine_operator: Required. Describes operator to apply to the + match condition. Possible values include: 'Any', 'IPMatch', 'GeoMatch', + 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', + 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith' + :type rules_engine_operator: str or + ~azure.mgmt.frontdoor.models.RulesEngineOperator + :param negate_condition: Describes if this is negate condition or not + :type negate_condition: bool + :param rules_engine_match_value: Required. Match values to match against. + The operator will apply to each value in here with OR semantics. If any of + them match the variable with the given operator this match condition is + considered a match. + :type rules_engine_match_value: list[str] + :param transforms: List of transforms + :type transforms: list[str or ~azure.mgmt.frontdoor.models.Transform] + """ + + _validation = { + 'rules_engine_match_variable': {'required': True}, + 'rules_engine_operator': {'required': True}, + 'rules_engine_match_value': {'required': True}, + } + + _attribute_map = { + 'rules_engine_match_variable': {'key': 'rulesEngineMatchVariable', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'rules_engine_operator': {'key': 'rulesEngineOperator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'rules_engine_match_value': {'key': 'rulesEngineMatchValue', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(RulesEngineMatchCondition, self).__init__(**kwargs) + self.rules_engine_match_variable = kwargs.get('rules_engine_match_variable', None) + self.selector = kwargs.get('selector', None) + self.rules_engine_operator = kwargs.get('rules_engine_operator', None) + self.negate_condition = kwargs.get('negate_condition', None) + self.rules_engine_match_value = kwargs.get('rules_engine_match_value', None) + self.transforms = kwargs.get('transforms', None) + + +class RulesEngineRule(Model): + """Contains a list of match conditions, and an action on how to modify the + request/response. If multiple rules match, the actions from one rule that + conflict with a previous rule overwrite for a singular action, or append in + the case of headers manipulation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A name to refer to this specific rule. + :type name: str + :param priority: Required. A priority assigned to this rule. + :type priority: int + :param action: Required. Actions to perform on the request and response if + all of the match conditions are met. + :type action: ~azure.mgmt.frontdoor.models.RulesEngineAction + :param match_conditions: A list of match conditions that must meet in + order for the actions of this rule to run. Having no match conditions + means the actions will always run. + :type match_conditions: + list[~azure.mgmt.frontdoor.models.RulesEngineMatchCondition] + :param match_processing_behavior: If this rule is a match should the rules + engine continue running the remaining rules or stop. If not present, + defaults to Continue. Possible values include: 'Continue', 'Stop' + :type match_processing_behavior: str or + ~azure.mgmt.frontdoor.models.MatchProcessingBehavior + """ + + _validation = { + 'name': {'required': True}, + 'priority': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'RulesEngineAction'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[RulesEngineMatchCondition]'}, + 'match_processing_behavior': {'key': 'matchProcessingBehavior', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RulesEngineRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.priority = kwargs.get('priority', None) + self.action = kwargs.get('action', None) + self.match_conditions = kwargs.get('match_conditions', None) + self.match_processing_behavior = kwargs.get('match_processing_behavior', None) + + +class RulesEngineUpdateParameters(Model): + """Rules Engine Configuration to apply to a Routing Rule. + + :param rules: A list of rules that define a particular Rules Engine + Configuration. + :type rules: list[~azure.mgmt.frontdoor.models.RulesEngineRule] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[RulesEngineRule]'}, + } + + def __init__(self, **kwargs): + super(RulesEngineUpdateParameters, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + + +class SecurityPolicyLink(Model): + """Defines the Resource ID for a Security Policy. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityPolicyLink, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class Sku(Model): + """The pricing tier of the web application firewall policy. + + :param name: Name of the pricing tier. Possible values include: + 'Classic_AzureFrontDoor', 'Standard_AzureFrontDoor', + 'Premium_AzureFrontDoor' + :type name: str or ~azure.mgmt.frontdoor.models.SkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) class TagsObject(Model): @@ -2448,6 +2845,14 @@ class WebApplicationFirewallPolicy(Resource): with this Web Application Firewall policy. :vartype frontend_endpoint_links: list[~azure.mgmt.frontdoor.models.FrontendEndpointLink] + :ivar routing_rule_links: Describes Routing Rules associated with this Web + Application Firewall policy. + :vartype routing_rule_links: + list[~azure.mgmt.frontdoor.models.RoutingRuleLink] + :ivar security_policy_links: Describes Security Policy associated with + this Web Application Firewall policy. + :vartype security_policy_links: + list[~azure.mgmt.frontdoor.models.SecurityPolicyLink] :ivar provisioning_state: Provisioning state of the policy. :vartype provisioning_state: str :ivar resource_state: Resource status of the policy. Possible values @@ -2458,6 +2863,9 @@ class WebApplicationFirewallPolicy(Resource): :param etag: Gets a unique read-only string that changes whenever the resource is updated. :type etag: str + :param sku: The pricing tier of web application firewall policy. Defaults + to Classic_AzureFrontDoor if not specified. + :type sku: ~azure.mgmt.frontdoor.models.Sku """ _validation = { @@ -2465,6 +2873,8 @@ class WebApplicationFirewallPolicy(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'frontend_endpoint_links': {'readonly': True}, + 'routing_rule_links': {'readonly': True}, + 'security_policy_links': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'resource_state': {'readonly': True}, } @@ -2479,9 +2889,12 @@ class WebApplicationFirewallPolicy(Resource): 'custom_rules': {'key': 'properties.customRules', 'type': 'CustomRuleList'}, 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRuleSetList'}, 'frontend_endpoint_links': {'key': 'properties.frontendEndpointLinks', 'type': '[FrontendEndpointLink]'}, + 'routing_rule_links': {'key': 'properties.routingRuleLinks', 'type': '[RoutingRuleLink]'}, + 'security_policy_links': {'key': 'properties.securityPolicyLinks', 'type': '[SecurityPolicyLink]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } def __init__(self, **kwargs): @@ -2490,6 +2903,9 @@ def __init__(self, **kwargs): self.custom_rules = kwargs.get('custom_rules', None) self.managed_rules = kwargs.get('managed_rules', None) self.frontend_endpoint_links = None + self.routing_rule_links = None + self.security_policy_links = None self.provisioning_state = None self.resource_state = None self.etag = kwargs.get('etag', None) + self.sku = kwargs.get('sku', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models_py3.py index 41059ec2978c..b07879a9b063 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models_py3.py @@ -45,8 +45,29 @@ def __init__(self, *, status=None, error=None, **kwargs) -> None: class Backend(Model): """Backend address of a frontDoor load balancer. + Variables are only populated by the server, and will be ignored when + sending a request. + :param address: Location of the backend (IP address or FQDN) :type address: str + :param private_link_alias: The Alias of the Private Link resource. + Populating this optional field indicates that this backend is 'Private' + :type private_link_alias: str + :param private_link_resource_id: The Resource Id of the Private Link + resource. Populating this optional field indicates that this backend is + 'Private' + :type private_link_resource_id: str + :param private_link_location: The location of the Private Link resource. + Required only if 'privateLinkResourceId' is populated + :type private_link_location: str + :ivar private_endpoint_status: The Approval status for the connection to + the Private Link. Possible values include: 'Pending', 'Approved', + 'Rejected', 'Disconnected', 'Timeout' + :vartype private_endpoint_status: str or + ~azure.mgmt.frontdoor.models.PrivateEndpointStatus + :param private_link_approval_message: A custom message to be included in + the approval request to connect to the Private Link + :type private_link_approval_message: str :param http_port: The HTTP TCP port number. Must be between 1 and 65535. :type http_port: int :param https_port: The HTTPS TCP port number. Must be between 1 and 65535. @@ -68,6 +89,7 @@ class Backend(Model): """ _validation = { + 'private_endpoint_status': {'readonly': True}, 'http_port': {'maximum': 65535, 'minimum': 1}, 'https_port': {'maximum': 65535, 'minimum': 1}, 'priority': {'maximum': 5, 'minimum': 1}, @@ -76,6 +98,11 @@ class Backend(Model): _attribute_map = { 'address': {'key': 'address', 'type': 'str'}, + 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, + 'private_endpoint_status': {'key': 'privateEndpointStatus', 'type': 'str'}, + 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, 'http_port': {'key': 'httpPort', 'type': 'int'}, 'https_port': {'key': 'httpsPort', 'type': 'int'}, 'enabled_state': {'key': 'enabledState', 'type': 'str'}, @@ -84,9 +111,14 @@ class Backend(Model): 'backend_host_header': {'key': 'backendHostHeader', 'type': 'str'}, } - def __init__(self, *, address: str=None, http_port: int=None, https_port: int=None, enabled_state=None, priority: int=None, weight: int=None, backend_host_header: str=None, **kwargs) -> None: + def __init__(self, *, address: str=None, private_link_alias: str=None, private_link_resource_id: str=None, private_link_location: str=None, private_link_approval_message: str=None, http_port: int=None, https_port: int=None, enabled_state=None, priority: int=None, weight: int=None, backend_host_header: str=None, **kwargs) -> None: super(Backend, self).__init__(**kwargs) self.address = address + self.private_link_alias = private_link_alias + self.private_link_resource_id = private_link_resource_id + self.private_link_location = private_link_location + self.private_endpoint_status = None + self.private_link_approval_message = private_link_approval_message self.http_port = http_port self.https_port = https_port self.enabled_state = enabled_state @@ -247,24 +279,37 @@ class CacheConfiguration(Model): provide a cacheConfiguration object. :param query_parameter_strip_directive: Treatment of URL query terms when - forming the cache key. Possible values include: 'StripNone', 'StripAll' + forming the cache key. Possible values include: 'StripNone', 'StripAll', + 'StripOnly', 'StripAllExcept' :type query_parameter_strip_directive: str or ~azure.mgmt.frontdoor.models.FrontDoorQuery + :param query_parameters: query parameters to include or exclude (comma + separated). + :type query_parameters: str :param dynamic_compression: Whether to use dynamic compression for cached content. Possible values include: 'Enabled', 'Disabled' :type dynamic_compression: str or ~azure.mgmt.frontdoor.models.DynamicCompressionEnabled + :param cache_duration: The duration for which the content needs to be + cached. Allowed format is in ISO 8601 format + (http://en.wikipedia.org/wiki/ISO_8601#Durations). HTTP requires the value + to be no more than a year + :type cache_duration: timedelta """ _attribute_map = { 'query_parameter_strip_directive': {'key': 'queryParameterStripDirective', 'type': 'str'}, + 'query_parameters': {'key': 'queryParameters', 'type': 'str'}, 'dynamic_compression': {'key': 'dynamicCompression', 'type': 'str'}, + 'cache_duration': {'key': 'cacheDuration', 'type': 'duration'}, } - def __init__(self, *, query_parameter_strip_directive=None, dynamic_compression=None, **kwargs) -> None: + def __init__(self, *, query_parameter_strip_directive=None, query_parameters: str=None, dynamic_compression=None, cache_duration=None, **kwargs) -> None: super(CacheConfiguration, self).__init__(**kwargs) self.query_parameter_strip_directive = query_parameter_strip_directive + self.query_parameters = query_parameters self.dynamic_compression = dynamic_compression + self.cache_duration = cache_duration class CheckNameAvailabilityInput(Model): @@ -862,6 +907,11 @@ class FrontDoor(Resource): :vartype provisioning_state: str :ivar cname: The host that each frontendEndpoint must CNAME to. :vartype cname: str + :ivar frontdoor_id: The Id of the frontdoor. + :vartype frontdoor_id: str + :ivar rules_engines: Rules Engine Configurations available to routing + rules. + :vartype rules_engines: list[~azure.mgmt.frontdoor.models.RulesEngine] """ _validation = { @@ -870,6 +920,8 @@ class FrontDoor(Resource): 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'cname': {'readonly': True}, + 'frontdoor_id': {'readonly': True}, + 'rules_engines': {'readonly': True}, } _attribute_map = { @@ -889,6 +941,8 @@ class FrontDoor(Resource): 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'cname': {'key': 'properties.cname', 'type': 'str'}, + 'frontdoor_id': {'key': 'properties.frontdoorId', 'type': 'str'}, + 'rules_engines': {'key': 'properties.rulesEngines', 'type': '[RulesEngine]'}, } 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: @@ -904,6 +958,8 @@ def __init__(self, *, location: str=None, tags=None, friendly_name: str=None, ro self.resource_state = resource_state self.provisioning_state = None self.cname = None + self.frontdoor_id = None + self.rules_engines = None class FrontDoorUpdateParameters(Model): @@ -1114,6 +1170,41 @@ def __init__(self, *, id: str=None, **kwargs) -> None: self.id = id +class HeaderAction(Model): + """An action that can manipulate an http header. + + All required parameters must be populated in order to send to Azure. + + :param header_action_type: Required. Which type of manipulation to apply + to the header. Possible values include: 'Append', 'Delete', 'Overwrite' + :type header_action_type: str or + ~azure.mgmt.frontdoor.models.HeaderActionType + :param header_name: Required. The name of the header this action will + apply to. + :type header_name: str + :param value: The value to update the given header name with. This value + is not used if the actionType is Delete. + :type value: str + """ + + _validation = { + 'header_action_type': {'required': True}, + 'header_name': {'required': True}, + } + + _attribute_map = { + 'header_action_type': {'key': 'headerActionType', 'type': 'str'}, + 'header_name': {'key': 'headerName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, header_action_type, header_name: str, value: str=None, **kwargs) -> None: + super(HeaderAction, self).__init__(**kwargs) + self.header_action_type = header_action_type + self.header_name = header_name + self.value = value + + 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. @@ -1576,7 +1667,8 @@ class ManagedRuleExclusion(Model): :param match_variable: Required. The variable type to be excluded. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', - 'QueryStringArgNames', 'RequestBodyPostArgNames' + 'QueryStringArgNames', 'RequestBodyPostArgNames', + 'RequestBodyJsonArgNames' :type match_variable: str or ~azure.mgmt.frontdoor.models.ManagedRuleExclusionMatchVariable :param selector_match_operator: Required. Comparison operator to apply to @@ -1724,6 +1816,10 @@ class ManagedRuleSet(Model): :param rule_set_version: Required. Defines the version of the rule set to use. :type rule_set_version: str + :param rule_set_action: Possible values include: 'Block', 'Log', + 'Redirect' + :type rule_set_action: str or + ~azure.mgmt.frontdoor.models.ManagedRuleSetActionType :param exclusions: Describes the exclusions that are applied to all rules in the set. :type exclusions: list[~azure.mgmt.frontdoor.models.ManagedRuleExclusion] @@ -1741,14 +1837,16 @@ class ManagedRuleSet(Model): _attribute_map = { 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'rule_set_action': {'key': 'ruleSetAction', 'type': 'str'}, 'exclusions': {'key': 'exclusions', 'type': '[ManagedRuleExclusion]'}, 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[ManagedRuleGroupOverride]'}, } - def __init__(self, *, rule_set_type: str, rule_set_version: str, exclusions=None, rule_group_overrides=None, **kwargs) -> None: + def __init__(self, *, rule_set_type: str, rule_set_version: str, rule_set_action=None, exclusions=None, rule_group_overrides=None, **kwargs) -> None: super(ManagedRuleSet, self).__init__(**kwargs) self.rule_set_type = rule_set_type self.rule_set_version = rule_set_version + self.rule_set_action = rule_set_action self.exclusions = exclusions self.rule_group_overrides = rule_group_overrides @@ -1771,6 +1869,8 @@ class ManagedRuleSetDefinition(Resource): :type tags: dict[str, str] :ivar provisioning_state: Provisioning state of the managed rule set. :vartype provisioning_state: str + :ivar rule_set_id: Id of the managed rule set. + :vartype rule_set_id: 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. @@ -1785,6 +1885,7 @@ class ManagedRuleSetDefinition(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'rule_set_id': {'readonly': True}, 'rule_set_type': {'readonly': True}, 'rule_set_version': {'readonly': True}, 'rule_groups': {'readonly': True}, @@ -1797,6 +1898,7 @@ class ManagedRuleSetDefinition(Resource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_id': {'key': 'properties.ruleSetId', '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]'}, @@ -1805,6 +1907,7 @@ class ManagedRuleSetDefinition(Resource): 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_id = None self.rule_set_type = None self.rule_set_version = None self.rule_groups = None @@ -1899,6 +2002,10 @@ class PolicySettings(Model): can override the response body. The body must be specified in base64 encoding. :type custom_block_response_body: str + :param request_body_check: Describes if policy managed rules will inspect + the request body content. Possible values include: 'Disabled', 'Enabled' + :type request_body_check: str or + ~azure.mgmt.frontdoor.models.PolicyRequestBodyCheck """ _validation = { @@ -1911,15 +2018,17 @@ class PolicySettings(Model): 'redirect_url': {'key': 'redirectUrl', 'type': 'str'}, 'custom_block_response_status_code': {'key': 'customBlockResponseStatusCode', 'type': 'int'}, 'custom_block_response_body': {'key': 'customBlockResponseBody', 'type': 'str'}, + 'request_body_check': {'key': 'requestBodyCheck', 'type': 'str'}, } - 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: + 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, request_body_check=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 + self.request_body_check = request_body_check class PreconfiguredEndpoint(Resource): @@ -2155,6 +2264,13 @@ class RoutingRule(SubResource): ~azure.mgmt.frontdoor.models.RoutingRuleEnabledState :param route_configuration: A reference to the routing configuration. :type route_configuration: ~azure.mgmt.frontdoor.models.RouteConfiguration + :param rules_engine: A reference to a specific Rules Engine Configuration + to apply to this route. + :type rules_engine: ~azure.mgmt.frontdoor.models.SubResource + :param web_application_firewall_policy_link: Defines the Web Application + Firewall policy for each routing rule (if applicable) + :type web_application_firewall_policy_link: + ~azure.mgmt.frontdoor.models.RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink :param resource_state: Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' :type resource_state: str or @@ -2176,23 +2292,43 @@ class RoutingRule(SubResource): 'patterns_to_match': {'key': 'properties.patternsToMatch', 'type': '[str]'}, 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, 'route_configuration': {'key': 'properties.routeConfiguration', 'type': 'RouteConfiguration'}, + 'rules_engine': {'key': 'properties.rulesEngine', 'type': 'SubResource'}, + 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink'}, '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, enabled_state=None, route_configuration=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, rules_engine=None, web_application_firewall_policy_link=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.enabled_state = enabled_state self.route_configuration = route_configuration + self.rules_engine = rules_engine + self.web_application_firewall_policy_link = web_application_firewall_policy_link self.resource_state = resource_state self.name = name self.type = None +class RoutingRuleLink(Model): + """Defines the Resource ID for a Routing Rule. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(RoutingRuleLink, self).__init__(**kwargs) + self.id = id + + 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. @@ -2239,6 +2375,13 @@ class RoutingRuleUpdateParameters(Model): ~azure.mgmt.frontdoor.models.RoutingRuleEnabledState :param route_configuration: A reference to the routing configuration. :type route_configuration: ~azure.mgmt.frontdoor.models.RouteConfiguration + :param rules_engine: A reference to a specific Rules Engine Configuration + to apply to this route. + :type rules_engine: ~azure.mgmt.frontdoor.models.SubResource + :param web_application_firewall_policy_link: Defines the Web Application + Firewall policy for each routing rule (if applicable) + :type web_application_firewall_policy_link: + ~azure.mgmt.frontdoor.models.RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink """ _attribute_map = { @@ -2247,15 +2390,269 @@ class RoutingRuleUpdateParameters(Model): 'patterns_to_match': {'key': 'patternsToMatch', 'type': '[str]'}, 'enabled_state': {'key': 'enabledState', 'type': 'str'}, 'route_configuration': {'key': 'routeConfiguration', 'type': 'RouteConfiguration'}, + 'rules_engine': {'key': 'rulesEngine', 'type': 'SubResource'}, + 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink'}, } - def __init__(self, *, frontend_endpoints=None, accepted_protocols=None, patterns_to_match=None, enabled_state=None, route_configuration=None, **kwargs) -> None: + def __init__(self, *, frontend_endpoints=None, accepted_protocols=None, patterns_to_match=None, enabled_state=None, route_configuration=None, rules_engine=None, web_application_firewall_policy_link=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.enabled_state = enabled_state self.route_configuration = route_configuration + self.rules_engine = rules_engine + self.web_application_firewall_policy_link = web_application_firewall_policy_link + + +class RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink(Model): + """Defines the Web Application Firewall policy for each routing rule (if + applicable). + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink, self).__init__(**kwargs) + self.id = id + + +class RulesEngine(Model): + """A rules engine configuration containing a list of rules that will run to + modify the runtime behavior of the request and response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param rules: A list of rules that define a particular Rules Engine + Configuration. + :type rules: list[~azure.mgmt.frontdoor.models.RulesEngineRule] + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar id: Resource ID. + :vartype id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'rules': {'key': 'properties.rules', 'type': '[RulesEngineRule]'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, rules=None, resource_state=None, **kwargs) -> None: + super(RulesEngine, self).__init__(**kwargs) + self.rules = rules + self.resource_state = resource_state + self.name = None + self.type = None + self.id = None + + +class RulesEngineAction(Model): + """One or more actions that will execute, modifying the request and/or + response. + + :param request_header_actions: A list of header actions to apply from the + request from AFD to the origin. + :type request_header_actions: + list[~azure.mgmt.frontdoor.models.HeaderAction] + :param response_header_actions: A list of header actions to apply from the + response from AFD to the client. + :type response_header_actions: + list[~azure.mgmt.frontdoor.models.HeaderAction] + :param route_configuration_override: Override the route configuration. + :type route_configuration_override: + ~azure.mgmt.frontdoor.models.RouteConfiguration + """ + + _attribute_map = { + 'request_header_actions': {'key': 'requestHeaderActions', 'type': '[HeaderAction]'}, + 'response_header_actions': {'key': 'responseHeaderActions', 'type': '[HeaderAction]'}, + 'route_configuration_override': {'key': 'routeConfigurationOverride', 'type': 'RouteConfiguration'}, + } + + def __init__(self, *, request_header_actions=None, response_header_actions=None, route_configuration_override=None, **kwargs) -> None: + super(RulesEngineAction, self).__init__(**kwargs) + self.request_header_actions = request_header_actions + self.response_header_actions = response_header_actions + self.route_configuration_override = route_configuration_override + + +class RulesEngineMatchCondition(Model): + """Define a match condition. + + All required parameters must be populated in order to send to Azure. + + :param rules_engine_match_variable: Required. Match Variable. Possible + values include: 'IsMobile', 'RemoteAddr', 'RequestMethod', 'QueryString', + 'PostArgs', 'RequestUri', 'RequestPath', 'RequestFilename', + 'RequestFilenameExtension', 'RequestHeader', 'RequestBody', + 'RequestScheme' + :type rules_engine_match_variable: str or + ~azure.mgmt.frontdoor.models.RulesEngineMatchVariable + :param selector: Name of selector in RequestHeader or RequestBody to be + matched + :type selector: str + :param rules_engine_operator: Required. Describes operator to apply to the + match condition. Possible values include: 'Any', 'IPMatch', 'GeoMatch', + 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', + 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith' + :type rules_engine_operator: str or + ~azure.mgmt.frontdoor.models.RulesEngineOperator + :param negate_condition: Describes if this is negate condition or not + :type negate_condition: bool + :param rules_engine_match_value: Required. Match values to match against. + The operator will apply to each value in here with OR semantics. If any of + them match the variable with the given operator this match condition is + considered a match. + :type rules_engine_match_value: list[str] + :param transforms: List of transforms + :type transforms: list[str or ~azure.mgmt.frontdoor.models.Transform] + """ + + _validation = { + 'rules_engine_match_variable': {'required': True}, + 'rules_engine_operator': {'required': True}, + 'rules_engine_match_value': {'required': True}, + } + + _attribute_map = { + 'rules_engine_match_variable': {'key': 'rulesEngineMatchVariable', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'rules_engine_operator': {'key': 'rulesEngineOperator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'rules_engine_match_value': {'key': 'rulesEngineMatchValue', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + def __init__(self, *, rules_engine_match_variable, rules_engine_operator, rules_engine_match_value, selector: str=None, negate_condition: bool=None, transforms=None, **kwargs) -> None: + super(RulesEngineMatchCondition, self).__init__(**kwargs) + self.rules_engine_match_variable = rules_engine_match_variable + self.selector = selector + self.rules_engine_operator = rules_engine_operator + self.negate_condition = negate_condition + self.rules_engine_match_value = rules_engine_match_value + self.transforms = transforms + + +class RulesEngineRule(Model): + """Contains a list of match conditions, and an action on how to modify the + request/response. If multiple rules match, the actions from one rule that + conflict with a previous rule overwrite for a singular action, or append in + the case of headers manipulation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A name to refer to this specific rule. + :type name: str + :param priority: Required. A priority assigned to this rule. + :type priority: int + :param action: Required. Actions to perform on the request and response if + all of the match conditions are met. + :type action: ~azure.mgmt.frontdoor.models.RulesEngineAction + :param match_conditions: A list of match conditions that must meet in + order for the actions of this rule to run. Having no match conditions + means the actions will always run. + :type match_conditions: + list[~azure.mgmt.frontdoor.models.RulesEngineMatchCondition] + :param match_processing_behavior: If this rule is a match should the rules + engine continue running the remaining rules or stop. If not present, + defaults to Continue. Possible values include: 'Continue', 'Stop' + :type match_processing_behavior: str or + ~azure.mgmt.frontdoor.models.MatchProcessingBehavior + """ + + _validation = { + 'name': {'required': True}, + 'priority': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'RulesEngineAction'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[RulesEngineMatchCondition]'}, + 'match_processing_behavior': {'key': 'matchProcessingBehavior', 'type': 'str'}, + } + + def __init__(self, *, name: str, priority: int, action, match_conditions=None, match_processing_behavior=None, **kwargs) -> None: + super(RulesEngineRule, self).__init__(**kwargs) + self.name = name + self.priority = priority + self.action = action + self.match_conditions = match_conditions + self.match_processing_behavior = match_processing_behavior + + +class RulesEngineUpdateParameters(Model): + """Rules Engine Configuration to apply to a Routing Rule. + + :param rules: A list of rules that define a particular Rules Engine + Configuration. + :type rules: list[~azure.mgmt.frontdoor.models.RulesEngineRule] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[RulesEngineRule]'}, + } + + def __init__(self, *, rules=None, **kwargs) -> None: + super(RulesEngineUpdateParameters, self).__init__(**kwargs) + self.rules = rules + + +class SecurityPolicyLink(Model): + """Defines the Resource ID for a Security Policy. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SecurityPolicyLink, self).__init__(**kwargs) + self.id = id + + +class Sku(Model): + """The pricing tier of the web application firewall policy. + + :param name: Name of the pricing tier. Possible values include: + 'Classic_AzureFrontDoor', 'Standard_AzureFrontDoor', + 'Premium_AzureFrontDoor' + :type name: str or ~azure.mgmt.frontdoor.models.SkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name class TagsObject(Model): @@ -2448,6 +2845,14 @@ class WebApplicationFirewallPolicy(Resource): with this Web Application Firewall policy. :vartype frontend_endpoint_links: list[~azure.mgmt.frontdoor.models.FrontendEndpointLink] + :ivar routing_rule_links: Describes Routing Rules associated with this Web + Application Firewall policy. + :vartype routing_rule_links: + list[~azure.mgmt.frontdoor.models.RoutingRuleLink] + :ivar security_policy_links: Describes Security Policy associated with + this Web Application Firewall policy. + :vartype security_policy_links: + list[~azure.mgmt.frontdoor.models.SecurityPolicyLink] :ivar provisioning_state: Provisioning state of the policy. :vartype provisioning_state: str :ivar resource_state: Resource status of the policy. Possible values @@ -2458,6 +2863,9 @@ class WebApplicationFirewallPolicy(Resource): :param etag: Gets a unique read-only string that changes whenever the resource is updated. :type etag: str + :param sku: The pricing tier of web application firewall policy. Defaults + to Classic_AzureFrontDoor if not specified. + :type sku: ~azure.mgmt.frontdoor.models.Sku """ _validation = { @@ -2465,6 +2873,8 @@ class WebApplicationFirewallPolicy(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'frontend_endpoint_links': {'readonly': True}, + 'routing_rule_links': {'readonly': True}, + 'security_policy_links': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'resource_state': {'readonly': True}, } @@ -2479,17 +2889,23 @@ class WebApplicationFirewallPolicy(Resource): 'custom_rules': {'key': 'properties.customRules', 'type': 'CustomRuleList'}, 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRuleSetList'}, 'frontend_endpoint_links': {'key': 'properties.frontendEndpointLinks', 'type': '[FrontendEndpointLink]'}, + 'routing_rule_links': {'key': 'properties.routingRuleLinks', 'type': '[RoutingRuleLink]'}, + 'security_policy_links': {'key': 'properties.securityPolicyLinks', 'type': '[SecurityPolicyLink]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, *, location: str=None, tags=None, policy_settings=None, custom_rules=None, managed_rules=None, etag: str=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, policy_settings=None, custom_rules=None, managed_rules=None, etag: str=None, sku=None, **kwargs) -> None: 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.routing_rule_links = None + self.security_policy_links = None self.provisioning_state = None self.resource_state = None self.etag = etag + self.sku = sku diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_paged_models.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_paged_models.py index 8ae0f541895c..1696d3d710c7 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_paged_models.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_paged_models.py @@ -77,6 +77,19 @@ class FrontendEndpointPaged(Paged): def __init__(self, *args, **kwargs): super(FrontendEndpointPaged, self).__init__(*args, **kwargs) +class RulesEnginePaged(Paged): + """ + A paging container for iterating over a list of :class:`RulesEngine ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RulesEngine]'} + } + + def __init__(self, *args, **kwargs): + + super(RulesEnginePaged, self).__init__(*args, **kwargs) class WebApplicationFirewallPolicyPaged(Paged): """ A paging container for iterating over a list of :class:`WebApplicationFirewallPolicy ` object 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 8e04fc804f81..14b69c8467c9 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 @@ -13,22 +13,26 @@ from ._preconfigured_endpoints_operations import PreconfiguredEndpointsOperations from ._experiments_operations import ExperimentsOperations from ._reports_operations import ReportsOperations +from ._front_door_name_availability_operations import FrontDoorNameAvailabilityOperations +from ._front_door_name_availability_with_subscription_operations import FrontDoorNameAvailabilityWithSubscriptionOperations from ._front_doors_operations import FrontDoorsOperations from ._frontend_endpoints_operations import FrontendEndpointsOperations from ._endpoints_operations import EndpointsOperations +from ._rules_engines_operations import RulesEnginesOperations from ._policies_operations import PoliciesOperations from ._managed_rule_sets_operations import ManagedRuleSetsOperations -from ._front_door_management_client_operations import FrontDoorManagementClientOperationsMixin __all__ = [ 'NetworkExperimentProfilesOperations', 'PreconfiguredEndpointsOperations', 'ExperimentsOperations', 'ReportsOperations', + 'FrontDoorNameAvailabilityOperations', + 'FrontDoorNameAvailabilityWithSubscriptionOperations', 'FrontDoorsOperations', 'FrontendEndpointsOperations', 'EndpointsOperations', + 'RulesEnginesOperations', 'PoliciesOperations', 'ManagedRuleSetsOperations', - 'FrontDoorManagementClientOperationsMixin', ] 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 54445455a681..c0c27651b2f2 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 @@ -26,7 +26,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: "2019-05-01". + :ivar api_version: Client API version. Constant value: "2020-05-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2020-05-01" self.config = config @@ -124,7 +124,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_management_client_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_management_client_operations.py deleted file mode 100644 index 9e9e6a966f68..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_management_client_operations.py +++ /dev/null @@ -1,152 +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.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling -from .. import models -import uuid - - -class FrontDoorManagementClientOperationsMixin(object): - - def check_front_door_name_availability( - self, name, type, custom_headers=None, raw=False, **operation_config): - """Check the availability of a Front Door resource name. - - :param name: The resource name to validate. - :type name: str - :param type: The type of the resource whose name is to be validated. - Possible values include: 'Microsoft.Network/frontDoors', - 'Microsoft.Network/frontDoors/frontendEndpoints' - :type type: str or ~azure.mgmt.frontdoor.models.ResourceType - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CheckNameAvailabilityOutput or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.frontdoor.models.CheckNameAvailabilityOutput or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) - - api_version = "2019-05-01" - - # Construct URL - url = self.check_front_door_name_availability.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(check_front_door_name_availability_input, 'CheckNameAvailabilityInput') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('CheckNameAvailabilityOutput', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_front_door_name_availability.metadata = {'url': '/providers/Microsoft.Network/checkFrontDoorNameAvailability'} - - def check_front_door_name_availability_with_subscription( - self, name, type, custom_headers=None, raw=False, **operation_config): - """Check the availability of a Front Door subdomain. - - :param name: The resource name to validate. - :type name: str - :param type: The type of the resource whose name is to be validated. - Possible values include: 'Microsoft.Network/frontDoors', - 'Microsoft.Network/frontDoors/frontendEndpoints' - :type type: str or ~azure.mgmt.frontdoor.models.ResourceType - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CheckNameAvailabilityOutput or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.frontdoor.models.CheckNameAvailabilityOutput or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) - - api_version = "2019-05-01" - - # Construct URL - url = self.check_front_door_name_availability_with_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(check_front_door_name_availability_input, 'CheckNameAvailabilityInput') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('CheckNameAvailabilityOutput', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_front_door_name_availability_with_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/checkFrontDoorNameAvailability'} diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_operations.py new file mode 100644 index 000000000000..e37ce4dcc46a --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_operations.py @@ -0,0 +1,101 @@ +# 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 FrontDoorNameAvailabilityOperations(object): + """FrontDoorNameAvailabilityOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-01" + + self.config = config + + def check( + self, name, type, custom_headers=None, raw=False, **operation_config): + """Check the availability of a Front Door resource name. + + :param name: The resource name to validate. + :type name: str + :param type: The type of the resource whose name is to be validated. + Possible values include: 'Microsoft.Network/frontDoors', + 'Microsoft.Network/frontDoors/frontendEndpoints' + :type type: str or ~azure.mgmt.frontdoor.models.ResourceType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameAvailabilityOutput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.CheckNameAvailabilityOutput or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) + + # Construct URL + url = self.check.metadata['url'] + + # 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(check_front_door_name_availability_input, 'CheckNameAvailabilityInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityOutput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check.metadata = {'url': '/providers/Microsoft.Network/checkFrontDoorNameAvailability'} diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_with_subscription_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_with_subscription_operations.py new file mode 100644 index 000000000000..cdd13a30f660 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_with_subscription_operations.py @@ -0,0 +1,105 @@ +# 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 FrontDoorNameAvailabilityWithSubscriptionOperations(object): + """FrontDoorNameAvailabilityWithSubscriptionOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-01" + + self.config = config + + def check( + self, name, type, custom_headers=None, raw=False, **operation_config): + """Check the availability of a Front Door subdomain. + + :param name: The resource name to validate. + :type name: str + :param type: The type of the resource whose name is to be validated. + Possible values include: 'Microsoft.Network/frontDoors', + 'Microsoft.Network/frontDoors/frontendEndpoints' + :type type: str or ~azure.mgmt.frontdoor.models.ResourceType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameAvailabilityOutput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.CheckNameAvailabilityOutput or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) + + # Construct URL + url = self.check.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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(check_front_door_name_availability_input, 'CheckNameAvailabilityInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityOutput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/checkFrontDoorNameAvailability'} 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 c8023dfe4806..d8753006b9b3 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 @@ -26,7 +26,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: "2019-05-01". + :ivar api_version: Client API version. Constant value: "2020-05-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2020-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 73b8469f51ef..f933ca1969c4 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 @@ -26,7 +26,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: "2019-05-01". + :ivar api_version: Client API version. Constant value: "2020-05-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2020-05-01" self.config = config @@ -268,7 +268,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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) @@ -353,7 +353,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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) 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 index cf28d3b72414..0bfade8e4cf1 100644 --- 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 @@ -24,7 +24,7 @@ class ManagedRuleSetsOperations(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: "2019-10-01". + :ivar api_version: Client API version. Constant value: "2020-11-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 = "2019-10-01" + self.api_version = "2020-11-01" self.config = config 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 d709da5a562a..c8e04aa59a98 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 @@ -27,7 +27,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: "2019-10-01". + :ivar api_version: Client API version. Constant value: "2020-11-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-01" + self.api_version = "2020-11-01" self.config = config @@ -108,7 +108,7 @@ def internal_paging(next_link=None): deserialized = models.WebApplicationFirewallPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies'} def get( self, resource_group_name, policy_name, custom_headers=None, raw=False, **operation_config): diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_rules_engines_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_rules_engines_operations.py new file mode 100644 index 000000000000..5646cb4dc19b --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_rules_engines_operations.py @@ -0,0 +1,386 @@ +# 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 RulesEnginesOperations(object): + """RulesEnginesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-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 Rules Engine Configurations 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 RulesEngine + :rtype: + ~azure.mgmt.frontdoor.models.RulesEnginePaged[~azure.mgmt.frontdoor.models.RulesEngine] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RulesEnginePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_front_door.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/rulesEngines'} + + def get( + self, resource_group_name, front_door_name, rules_engine_name, custom_headers=None, raw=False, **operation_config): + """Gets a Rules Engine Configuration with the specified name within the + specified Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param rules_engine_name: Name of the Rules Engine which is unique + within the Front Door. + :type rules_engine_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: RulesEngine or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.RulesEngine 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])*$'), + 'rulesEngineName': self._serialize.url("rules_engine_name", rules_engine_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('RulesEngine', 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}/rulesEngines/{rulesEngineName}'} + + + def _create_or_update_initial( + self, resource_group_name, front_door_name, rules_engine_name, rules=None, resource_state=None, custom_headers=None, raw=False, **operation_config): + rules_engine_parameters = models.RulesEngine(rules=rules, resource_state=resource_state) + + # 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])*$'), + 'rulesEngineName': self._serialize.url("rules_engine_name", rules_engine_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(rules_engine_parameters, 'RulesEngine') + + # 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('RulesEngine', response) + if response.status_code == 201: + deserialized = self._deserialize('RulesEngine', response) + if response.status_code == 202: + deserialized = self._deserialize('RulesEngine', 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, rules_engine_name, rules=None, resource_state=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new Rules Engine Configuration with the specified name within + the specified Front Door. + + :param resource_group_name: Name of the Resource group within the + Azure subscription. + :type resource_group_name: str + :param front_door_name: Name of the Front Door which is globally + unique. + :type front_door_name: str + :param rules_engine_name: Name of the Rules Engine which is unique + within the Front Door. + :type rules_engine_name: str + :param rules: A list of rules that define a particular Rules Engine + Configuration. + :type rules: list[~azure.mgmt.frontdoor.models.RulesEngineRule] + :param resource_state: Resource status. Possible values include: + 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' + :type resource_state: str or + ~azure.mgmt.frontdoor.models.FrontDoorResourceState + :param 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 RulesEngine or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.frontdoor.models.RulesEngine] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.frontdoor.models.RulesEngine]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + front_door_name=front_door_name, + rules_engine_name=rules_engine_name, + rules=rules, + resource_state=resource_state, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RulesEngine', 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}/rulesEngines/{rulesEngineName}'} + + + def _delete_initial( + self, resource_group_name, front_door_name, rules_engine_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])*$'), + 'rulesEngineName': self._serialize.url("rules_engine_name", rules_engine_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, rules_engine_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Rules Engine Configuration 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 rules_engine_name: Name of the Rules Engine which is unique + within the Front Door. + :type rules_engine_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, + rules_engine_name=rules_engine_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}/rulesEngines/{rulesEngineName}'}