From 423dcbcbd624e8a63b75fa76518bfac2cb47bfb5 Mon Sep 17 00:00:00 2001 From: 00Kai0 Date: Tue, 19 Jan 2021 17:37:48 +0800 Subject: [PATCH] release track2 sdk for cdn --- sdk/cdn/azure-mgmt-cdn/CHANGELOG.md | 42 + .../azure/mgmt/cdn/_cdn_management_client.py | 60 + .../azure/mgmt/cdn/_configuration.py | 2 +- .../azure-mgmt-cdn/azure/mgmt/cdn/_version.py | 2 +- .../mgmt/cdn/aio/_cdn_management_client.py | 60 + .../azure/mgmt/cdn/aio/_configuration.py | 2 +- .../azure/mgmt/cdn/aio/operations/__init__.py | 24 + .../_afd_custom_domains_operations.py | 694 ++ .../operations/_afd_endpoints_operations.py | 854 ++ .../_afd_origin_groups_operations.py | 649 ++ .../aio/operations/_afd_origins_operations.py | 599 + .../operations/_afd_profiles_operations.py | 184 + .../_cdn_management_client_operations.py | 56 +- .../operations/_custom_domains_operations.py | 96 +- .../aio/operations/_edge_nodes_operations.py | 12 +- .../aio/operations/_endpoints_operations.py | 212 +- .../operations/_log_analytics_operations.py | 523 + .../_managed_rule_sets_operations.py | 12 +- .../mgmt/cdn/aio/operations/_operations.py | 12 +- .../operations/_origin_groups_operations.py | 86 +- .../cdn/aio/operations/_origins_operations.py | 86 +- .../aio/operations/_policies_operations.py | 91 +- .../aio/operations/_profiles_operations.py | 122 +- .../operations/_resource_usage_operations.py | 12 +- .../cdn/aio/operations/_routes_operations.py | 603 + .../aio/operations/_rule_sets_operations.py | 515 + .../cdn/aio/operations/_rules_operations.py | 599 + .../cdn/aio/operations/_secrets_operations.py | 570 + .../_security_policies_operations.py | 570 + .../aio/operations/_validate_operations.py | 100 + .../azure/mgmt/cdn/models/__init__.py | 338 +- .../models/_cdn_management_client_enums.py | 271 +- .../azure/mgmt/cdn/models/_models.py | 9008 ++++++++++----- .../azure/mgmt/cdn/models/_models_py3.py | 9993 ++++++++++++----- .../azure/mgmt/cdn/operations/__init__.py | 24 + .../_afd_custom_domains_operations.py | 708 ++ .../operations/_afd_endpoints_operations.py | 870 ++ .../_afd_origin_groups_operations.py | 662 ++ .../cdn/operations/_afd_origins_operations.py | 611 + .../operations/_afd_profiles_operations.py | 190 + .../_cdn_management_client_operations.py | 56 +- .../operations/_custom_domains_operations.py | 96 +- .../cdn/operations/_edge_nodes_operations.py | 12 +- .../cdn/operations/_endpoints_operations.py | 212 +- .../operations/_log_analytics_operations.py | 533 + .../_managed_rule_sets_operations.py | 12 +- .../azure/mgmt/cdn/operations/_operations.py | 12 +- .../operations/_origin_groups_operations.py | 86 +- .../cdn/operations/_origins_operations.py | 86 +- .../cdn/operations/_policies_operations.py | 91 +- .../cdn/operations/_profiles_operations.py | 122 +- .../operations/_resource_usage_operations.py | 12 +- .../mgmt/cdn/operations/_routes_operations.py | 615 + .../cdn/operations/_rule_sets_operations.py | 526 + .../mgmt/cdn/operations/_rules_operations.py | 611 + .../cdn/operations/_secrets_operations.py | 582 + .../_security_policies_operations.py | 582 + .../cdn/operations/_validate_operations.py | 105 + .../test_cli_mgmt_cdn.test_cdn.yaml | 1039 +- .../azure-mgmt-cdn/tests/test_cli_mgmt_cdn.py | 72 +- 60 files changed, 28633 insertions(+), 6953 deletions(-) create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_custom_domains_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_endpoints_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_origin_groups_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_origins_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_profiles_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_log_analytics_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_routes_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_rule_sets_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_rules_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_secrets_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_security_policies_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_validate_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_custom_domains_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_endpoints_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_origin_groups_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_origins_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_profiles_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_log_analytics_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_routes_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_rule_sets_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_rules_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_secrets_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_security_policies_operations.py create mode 100644 sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_validate_operations.py diff --git a/sdk/cdn/azure-mgmt-cdn/CHANGELOG.md b/sdk/cdn/azure-mgmt-cdn/CHANGELOG.md index 7f12b649ebbb..386ccaf509b6 100644 --- a/sdk/cdn/azure-mgmt-cdn/CHANGELOG.md +++ b/sdk/cdn/azure-mgmt-cdn/CHANGELOG.md @@ -1,5 +1,47 @@ # Release History +## 10.0.0 (2021-01-19) + +**Features** + + - Model ProxyResource has a new parameter system_data + - Model OriginGroup has a new parameter system_data + - Model Endpoint has a new parameter system_data + - Model EdgeNode has a new parameter system_data + - Model Origin has a new parameter system_data + - Model TrackedResource has a new parameter system_data + - Model Profile has a new parameter system_data + - Model Profile has a new parameter frontdoor_id + - Model CdnWebApplicationFirewallPolicy has a new parameter system_data + - Model CustomDomain has a new parameter system_data + - Added operation group AFDOriginsOperations + - Added operation group AFDProfilesOperations + - Added operation group AFDEndpointsOperations + - Added operation group RoutesOperations + - Added operation group LogAnalyticsOperations + - Added operation group RulesOperations + - Added operation group ValidateOperations + - Added operation group AFDOriginGroupsOperations + - Added operation group SecretsOperations + - Added operation group SecurityPoliciesOperations + - Added operation group AFDCustomDomainsOperations + - Added operation group RuleSetsOperations + +**Breaking changes** + + - Parameter odata_type of model UrlSigningActionParameters is now required + - Operation PoliciesOperations.begin_update has a new signature + - Operation EndpointsOperations.validate_custom_domain has a new signature + - Operation EndpointsOperations.begin_load_content has a new signature + - Operation EndpointsOperations.begin_purge_content has a new signature + - Operation ProfilesOperations.begin_update has a new signature + - Operation CdnManagementClientOperationsMixin.check_name_availability has a new signature + - Operation CdnManagementClientOperationsMixin.check_name_availability_with_subscription has a new signature + - Operation CdnManagementClientOperationsMixin.validate_probe has a new signature + - Operation CustomDomainsOperations.begin_create has a new signature + - Model UrlSigningActionParameters no longer has parameter ip_subnets + - Model UrlSigningActionParameters no longer has parameter key_id + ## 10.0.0b1 (2020-10-31) This is beta preview version. For detailed changelog please refer to equivalent stable version 5.1.0 (https://pypi.org/project/azure-mgmt-cdn/5.1.0/) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_cdn_management_client.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_cdn_management_client.py index 45b882eb7cf1..f61aa97cc6d1 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_cdn_management_client.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_cdn_management_client.py @@ -27,6 +27,18 @@ from .operations import ResourceUsageOperations from .operations import Operations from .operations import EdgeNodesOperations +from .operations import AFDProfilesOperations +from .operations import AFDCustomDomainsOperations +from .operations import AFDEndpointsOperations +from .operations import AFDOriginGroupsOperations +from .operations import AFDOriginsOperations +from .operations import RoutesOperations +from .operations import RuleSetsOperations +from .operations import RulesOperations +from .operations import SecurityPoliciesOperations +from .operations import SecretsOperations +from .operations import ValidateOperations +from .operations import LogAnalyticsOperations from .operations import PoliciesOperations from .operations import ManagedRuleSetsOperations from . import models @@ -51,6 +63,30 @@ class CdnManagementClient(CdnManagementClientOperationsMixin): :vartype operations: azure.mgmt.cdn.operations.Operations :ivar edge_nodes: EdgeNodesOperations operations :vartype edge_nodes: azure.mgmt.cdn.operations.EdgeNodesOperations + :ivar afd_profiles: AFDProfilesOperations operations + :vartype afd_profiles: azure.mgmt.cdn.operations.AFDProfilesOperations + :ivar afd_custom_domains: AFDCustomDomainsOperations operations + :vartype afd_custom_domains: azure.mgmt.cdn.operations.AFDCustomDomainsOperations + :ivar afd_endpoints: AFDEndpointsOperations operations + :vartype afd_endpoints: azure.mgmt.cdn.operations.AFDEndpointsOperations + :ivar afd_origin_groups: AFDOriginGroupsOperations operations + :vartype afd_origin_groups: azure.mgmt.cdn.operations.AFDOriginGroupsOperations + :ivar afd_origins: AFDOriginsOperations operations + :vartype afd_origins: azure.mgmt.cdn.operations.AFDOriginsOperations + :ivar routes: RoutesOperations operations + :vartype routes: azure.mgmt.cdn.operations.RoutesOperations + :ivar rule_sets: RuleSetsOperations operations + :vartype rule_sets: azure.mgmt.cdn.operations.RuleSetsOperations + :ivar rules: RulesOperations operations + :vartype rules: azure.mgmt.cdn.operations.RulesOperations + :ivar security_policies: SecurityPoliciesOperations operations + :vartype security_policies: azure.mgmt.cdn.operations.SecurityPoliciesOperations + :ivar secrets: SecretsOperations operations + :vartype secrets: azure.mgmt.cdn.operations.SecretsOperations + :ivar validate: ValidateOperations operations + :vartype validate: azure.mgmt.cdn.operations.ValidateOperations + :ivar log_analytics: LogAnalyticsOperations operations + :vartype log_analytics: azure.mgmt.cdn.operations.LogAnalyticsOperations :ivar policies: PoliciesOperations operations :vartype policies: azure.mgmt.cdn.operations.PoliciesOperations :ivar managed_rule_sets: ManagedRuleSetsOperations operations @@ -97,6 +133,30 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.edge_nodes = EdgeNodesOperations( self._client, self._config, self._serialize, self._deserialize) + self.afd_profiles = AFDProfilesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.afd_custom_domains = AFDCustomDomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.afd_endpoints = AFDEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.afd_origin_groups = AFDOriginGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.afd_origins = AFDOriginsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.routes = RoutesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.rule_sets = RuleSetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.rules = RulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.security_policies = SecurityPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.secrets = SecretsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.validate = ValidateOperations( + self._client, self._config, self._serialize, self._deserialize) + self.log_analytics = LogAnalyticsOperations( + 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/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_configuration.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_configuration.py index 71d9af4baeab..5edde19c7eca 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_configuration.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-04-15" + self.api_version = "2020-09-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-cdn/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_version.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_version.py index 79aaa33e5e04..9f8bb24bdd99 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_version.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.0.0b1" +VERSION = "10.0.0" diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_cdn_management_client.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_cdn_management_client.py index 5471caf15af8..f5e372c51d5f 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_cdn_management_client.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_cdn_management_client.py @@ -25,6 +25,18 @@ from .operations import ResourceUsageOperations from .operations import Operations from .operations import EdgeNodesOperations +from .operations import AFDProfilesOperations +from .operations import AFDCustomDomainsOperations +from .operations import AFDEndpointsOperations +from .operations import AFDOriginGroupsOperations +from .operations import AFDOriginsOperations +from .operations import RoutesOperations +from .operations import RuleSetsOperations +from .operations import RulesOperations +from .operations import SecurityPoliciesOperations +from .operations import SecretsOperations +from .operations import ValidateOperations +from .operations import LogAnalyticsOperations from .operations import PoliciesOperations from .operations import ManagedRuleSetsOperations from .. import models @@ -49,6 +61,30 @@ class CdnManagementClient(CdnManagementClientOperationsMixin): :vartype operations: azure.mgmt.cdn.aio.operations.Operations :ivar edge_nodes: EdgeNodesOperations operations :vartype edge_nodes: azure.mgmt.cdn.aio.operations.EdgeNodesOperations + :ivar afd_profiles: AFDProfilesOperations operations + :vartype afd_profiles: azure.mgmt.cdn.aio.operations.AFDProfilesOperations + :ivar afd_custom_domains: AFDCustomDomainsOperations operations + :vartype afd_custom_domains: azure.mgmt.cdn.aio.operations.AFDCustomDomainsOperations + :ivar afd_endpoints: AFDEndpointsOperations operations + :vartype afd_endpoints: azure.mgmt.cdn.aio.operations.AFDEndpointsOperations + :ivar afd_origin_groups: AFDOriginGroupsOperations operations + :vartype afd_origin_groups: azure.mgmt.cdn.aio.operations.AFDOriginGroupsOperations + :ivar afd_origins: AFDOriginsOperations operations + :vartype afd_origins: azure.mgmt.cdn.aio.operations.AFDOriginsOperations + :ivar routes: RoutesOperations operations + :vartype routes: azure.mgmt.cdn.aio.operations.RoutesOperations + :ivar rule_sets: RuleSetsOperations operations + :vartype rule_sets: azure.mgmt.cdn.aio.operations.RuleSetsOperations + :ivar rules: RulesOperations operations + :vartype rules: azure.mgmt.cdn.aio.operations.RulesOperations + :ivar security_policies: SecurityPoliciesOperations operations + :vartype security_policies: azure.mgmt.cdn.aio.operations.SecurityPoliciesOperations + :ivar secrets: SecretsOperations operations + :vartype secrets: azure.mgmt.cdn.aio.operations.SecretsOperations + :ivar validate: ValidateOperations operations + :vartype validate: azure.mgmt.cdn.aio.operations.ValidateOperations + :ivar log_analytics: LogAnalyticsOperations operations + :vartype log_analytics: azure.mgmt.cdn.aio.operations.LogAnalyticsOperations :ivar policies: PoliciesOperations operations :vartype policies: azure.mgmt.cdn.aio.operations.PoliciesOperations :ivar managed_rule_sets: ManagedRuleSetsOperations operations @@ -94,6 +130,30 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.edge_nodes = EdgeNodesOperations( self._client, self._config, self._serialize, self._deserialize) + self.afd_profiles = AFDProfilesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.afd_custom_domains = AFDCustomDomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.afd_endpoints = AFDEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.afd_origin_groups = AFDOriginGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.afd_origins = AFDOriginsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.routes = RoutesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.rule_sets = RuleSetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.rules = RulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.security_policies = SecurityPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.secrets = SecretsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.validate = ValidateOperations( + self._client, self._config, self._serialize, self._deserialize) + self.log_analytics = LogAnalyticsOperations( + 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/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_configuration.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_configuration.py index 29679ff3fc88..b2553bc99e4d 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_configuration.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-04-15" + self.api_version = "2020-09-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-cdn/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/__init__.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/__init__.py index dc4970395883..17011eacfb60 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/__init__.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/__init__.py @@ -15,6 +15,18 @@ from ._resource_usage_operations import ResourceUsageOperations from ._operations import Operations from ._edge_nodes_operations import EdgeNodesOperations +from ._afd_profiles_operations import AFDProfilesOperations +from ._afd_custom_domains_operations import AFDCustomDomainsOperations +from ._afd_endpoints_operations import AFDEndpointsOperations +from ._afd_origin_groups_operations import AFDOriginGroupsOperations +from ._afd_origins_operations import AFDOriginsOperations +from ._routes_operations import RoutesOperations +from ._rule_sets_operations import RuleSetsOperations +from ._rules_operations import RulesOperations +from ._security_policies_operations import SecurityPoliciesOperations +from ._secrets_operations import SecretsOperations +from ._validate_operations import ValidateOperations +from ._log_analytics_operations import LogAnalyticsOperations from ._policies_operations import PoliciesOperations from ._managed_rule_sets_operations import ManagedRuleSetsOperations @@ -28,6 +40,18 @@ 'ResourceUsageOperations', 'Operations', 'EdgeNodesOperations', + 'AFDProfilesOperations', + 'AFDCustomDomainsOperations', + 'AFDEndpointsOperations', + 'AFDOriginGroupsOperations', + 'AFDOriginsOperations', + 'RoutesOperations', + 'RuleSetsOperations', + 'RulesOperations', + 'SecurityPoliciesOperations', + 'SecretsOperations', + 'ValidateOperations', + 'LogAnalyticsOperations', 'PoliciesOperations', 'ManagedRuleSetsOperations', ] diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_custom_domains_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_custom_domains_operations.py new file mode 100644 index 000000000000..391dbbc9f4e6 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_custom_domains_operations.py @@ -0,0 +1,694 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AFDCustomDomainsOperations: + """AFDCustomDomainsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name: str, + profile_name: str, + **kwargs + ) -> AsyncIterable["_models.AFDDomainListResult"]: + """Lists existing AzureFrontDoor domains. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AFDDomainListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.AFDDomainListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomainListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AFDDomainListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains'} # type: ignore + + async def get( + self, + resource_group_name: str, + profile_name: str, + custom_domain_name: str, + **kwargs + ) -> "_models.AFDDomain": + """Gets an existing AzureFrontDoor domain with the specified domain name under the specified + subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param custom_domain_name: Name of the domain under the profile which is unique globally. + :type custom_domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AFDDomain, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.AFDDomain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + profile_name: str, + custom_domain_name: str, + custom_domain: "_models.AFDDomain", + **kwargs + ) -> "_models.AFDDomain": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(custom_domain, 'AFDDomain') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + profile_name: str, + custom_domain_name: str, + custom_domain: "_models.AFDDomain", + **kwargs + ) -> AsyncLROPoller["_models.AFDDomain"]: + """Creates a new domain within the specified profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param custom_domain_name: Name of the domain under the profile which is unique globally. + :type custom_domain_name: str + :param custom_domain: Domain properties. + :type custom_domain: ~azure.mgmt.cdn.models.AFDDomain + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AFDDomain or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.AFDDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomain"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + custom_domain_name=custom_domain_name, + custom_domain=custom_domain, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + profile_name: str, + custom_domain_name: str, + custom_domain_update_properties: "_models.AFDDomainUpdateParameters", + **kwargs + ) -> "_models.AFDDomain": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(custom_domain_update_properties, 'AFDDomainUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + profile_name: str, + custom_domain_name: str, + custom_domain_update_properties: "_models.AFDDomainUpdateParameters", + **kwargs + ) -> AsyncLROPoller["_models.AFDDomain"]: + """Updates an existing domain within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param custom_domain_name: Name of the domain under the profile which is unique globally. + :type custom_domain_name: str + :param custom_domain_update_properties: Domain properties. + :type custom_domain_update_properties: ~azure.mgmt.cdn.models.AFDDomainUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AFDDomain or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.AFDDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomain"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + custom_domain_name=custom_domain_name, + custom_domain_update_properties=custom_domain_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + profile_name: str, + custom_domain_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + profile_name: str, + custom_domain_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing AzureFrontDoor domain with the specified domain name under the specified + subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param custom_domain_name: Name of the domain under the profile which is unique globally. + :type custom_domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + custom_domain_name=custom_domain_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + async def _refresh_validation_token_initial( + self, + resource_group_name: str, + profile_name: str, + custom_domain_name: str, + **kwargs + ) -> "_models.ValidationToken": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._refresh_validation_token_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidationToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _refresh_validation_token_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}/refreshValidationToken'} # type: ignore + + async def begin_refresh_validation_token( + self, + resource_group_name: str, + profile_name: str, + custom_domain_name: str, + **kwargs + ) -> AsyncLROPoller["_models.ValidationToken"]: + """Updates the domain validation token. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param custom_domain_name: Name of the domain under the profile which is unique globally. + :type custom_domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ValidationToken or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.ValidationToken] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationToken"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._refresh_validation_token_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + custom_domain_name=custom_domain_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ValidationToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh_validation_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}/refreshValidationToken'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_endpoints_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_endpoints_operations.py new file mode 100644 index 000000000000..8db3165829c0 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_endpoints_operations.py @@ -0,0 +1,854 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AFDEndpointsOperations: + """AFDEndpointsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name: str, + profile_name: str, + **kwargs + ) -> AsyncIterable["_models.AFDEndpointListResult"]: + """Lists existing AzureFrontDoor endpoints. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AFDEndpointListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.AFDEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpointListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AFDEndpointListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints'} # type: ignore + + async def get( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + **kwargs + ) -> "_models.AFDEndpoint": + """Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified + subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AFDEndpoint, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.AFDEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + endpoint: "_models.AFDEndpoint", + **kwargs + ) -> "_models.AFDEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(endpoint, 'AFDEndpoint') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + endpoint: "_models.AFDEndpoint", + **kwargs + ) -> AsyncLROPoller["_models.AFDEndpoint"]: + """Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified + subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param endpoint: Endpoint properties. + :type endpoint: ~azure.mgmt.cdn.models.AFDEndpoint + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AFDEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.AFDEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + endpoint=endpoint, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + endpoint_update_properties: "_models.AFDEndpointUpdateParameters", + **kwargs + ) -> "_models.AFDEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(endpoint_update_properties, 'AFDEndpointUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + endpoint_update_properties: "_models.AFDEndpointUpdateParameters", + **kwargs + ) -> AsyncLROPoller["_models.AFDEndpoint"]: + """Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the + specified subscription, resource group and profile. Only tags can be updated after creating an + endpoint. To update origins, use the Update Origin operation. To update origin groups, use the + Update Origin group operation. To update domains, use the Update Custom Domain operation. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param endpoint_update_properties: Endpoint update properties. + :type endpoint_update_properties: ~azure.mgmt.cdn.models.AFDEndpointUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AFDEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.AFDEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + endpoint_update_properties=endpoint_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the + specified subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + async def _purge_content_initial( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + contents: "_models.AfdPurgeParameters", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._purge_content_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(contents, 'AfdPurgeParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _purge_content_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/purge'} # type: ignore + + async def begin_purge_content( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + contents: "_models.AfdPurgeParameters", + **kwargs + ) -> AsyncLROPoller[None]: + """Removes a content from AzureFrontDoor. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param contents: The list of paths to the content and the list of linked domains to be purged. + Path can be a full URL, e.g. '/pictures/city.png' which removes a single file, or a directory + with a wildcard, e.g. '/pictures/*' which removes all folders and files in the directory. + :type contents: ~azure.mgmt.cdn.models.AfdPurgeParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._purge_content_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + contents=contents, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/purge'} # type: ignore + + def list_resource_usage( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + **kwargs + ) -> AsyncIterable["_models.UsagesListResult"]: + """Checks the quota and actual usage of endpoints under the given CDN profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_resource_usage.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_resource_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/usages'} # type: ignore + + async def validate_custom_domain( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + custom_domain_properties: "_models.ValidateCustomDomainInput", + **kwargs + ) -> "_models.ValidateCustomDomainOutput": + """Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param custom_domain_properties: Custom domain to be validated. + :type custom_domain_properties: ~azure.mgmt.cdn.models.ValidateCustomDomainInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateCustomDomainOutput, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.ValidateCustomDomainOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateCustomDomainOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(custom_domain_properties, 'ValidateCustomDomainInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateCustomDomainOutput', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/validateCustomDomain'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_origin_groups_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_origin_groups_operations.py new file mode 100644 index 000000000000..ce983d33d32c --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_origin_groups_operations.py @@ -0,0 +1,649 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AFDOriginGroupsOperations: + """AFDOriginGroupsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name: str, + profile_name: str, + **kwargs + ) -> AsyncIterable["_models.AFDOriginGroupListResult"]: + """Lists all of the existing origin groups within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AFDOriginGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.AFDOriginGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AFDOriginGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups'} # type: ignore + + async def get( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + **kwargs + ) -> "_models.AFDOriginGroup": + """Gets an existing origin group within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the endpoint. + :type origin_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AFDOriginGroup, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.AFDOriginGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_group: "_models.AFDOriginGroup", + **kwargs + ) -> "_models.AFDOriginGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(origin_group, 'AFDOriginGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_group: "_models.AFDOriginGroup", + **kwargs + ) -> AsyncLROPoller["_models.AFDOriginGroup"]: + """Creates a new origin group within the specified profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the endpoint. + :type origin_group_name: str + :param origin_group: Origin group properties. + :type origin_group: ~azure.mgmt.cdn.models.AFDOriginGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AFDOriginGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.AFDOriginGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + origin_group=origin_group, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_group_update_properties: "_models.AFDOriginGroupUpdateParameters", + **kwargs + ) -> "_models.AFDOriginGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(origin_group_update_properties, 'AFDOriginGroupUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_group_update_properties: "_models.AFDOriginGroupUpdateParameters", + **kwargs + ) -> AsyncLROPoller["_models.AFDOriginGroup"]: + """Updates an existing origin group within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :param origin_group_update_properties: Origin group properties. + :type origin_group_update_properties: ~azure.mgmt.cdn.models.AFDOriginGroupUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AFDOriginGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.AFDOriginGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + origin_group_update_properties=origin_group_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing origin group within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + def list_resource_usage( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + **kwargs + ) -> AsyncIterable["_models.UsagesListResult"]: + """Checks the quota and actual usage of endpoints under the given CDN profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the endpoint. + :type origin_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_resource_usage.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_resource_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/usages'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_origins_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_origins_operations.py new file mode 100644 index 000000000000..b8bc243c5ed5 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_origins_operations.py @@ -0,0 +1,599 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AFDOriginsOperations: + """AFDOriginsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_origin_group( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AFDOriginListResult"]: + """Lists all of the existing origins within an origin group. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AFDOriginListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.AFDOriginListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_origin_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AFDOriginListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_origin_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins'} # type: ignore + + async def get( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_name: str, + **kwargs + ) -> "_models.AFDOrigin": + """Gets an existing origin within an origin group. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :param origin_name: Name of the origin which is unique within the profile. + :type origin_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AFDOrigin, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.AFDOrigin + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOrigin"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_name: str, + origin: "_models.AFDOrigin", + **kwargs + ) -> "_models.AFDOrigin": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOrigin"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(origin, 'AFDOrigin') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_name: str, + origin: "_models.AFDOrigin", + **kwargs + ) -> AsyncLROPoller["_models.AFDOrigin"]: + """Creates a new origin within the specified origin group. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :param origin_name: Name of the origin that is unique within the profile. + :type origin_name: str + :param origin: Origin properties. + :type origin: ~azure.mgmt.cdn.models.AFDOrigin + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AFDOrigin or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.AFDOrigin] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOrigin"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + origin_name=origin_name, + origin=origin, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_name: str, + origin_update_properties: "_models.AFDOriginUpdateParameters", + **kwargs + ) -> "_models.AFDOrigin": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOrigin"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(origin_update_properties, 'AFDOriginUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_name: str, + origin_update_properties: "_models.AFDOriginUpdateParameters", + **kwargs + ) -> AsyncLROPoller["_models.AFDOrigin"]: + """Updates an existing origin within an origin group. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :param origin_name: Name of the origin which is unique within the profile. + :type origin_name: str + :param origin_update_properties: Origin properties. + :type origin_update_properties: ~azure.mgmt.cdn.models.AFDOriginUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AFDOrigin or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.AFDOrigin] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOrigin"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + origin_name=origin_name, + origin_update_properties=origin_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + profile_name: str, + origin_group_name: str, + origin_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing origin within an origin group. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :param origin_name: Name of the origin which is unique within the profile. + :type origin_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + origin_name=origin_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_profiles_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_profiles_operations.py new file mode 100644 index 000000000000..6df4d71edc95 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_profiles_operations.py @@ -0,0 +1,184 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AFDProfilesOperations: + """AFDProfilesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_resource_usage( + self, + resource_group_name: str, + profile_name: str, + **kwargs + ) -> AsyncIterable["_models.UsagesListResult"]: + """Checks the quota and actual usage of endpoints under the given CDN profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_resource_usage.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_resource_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/usages'} # type: ignore + + async def check_host_name_availability( + self, + resource_group_name: str, + profile_name: str, + check_host_name_availability_input: "_models.ValidateCustomDomainInput", + **kwargs + ) -> "_models.ValidateCustomDomainOutput": + """Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param check_host_name_availability_input: Custom domain to be validated. + :type check_host_name_availability_input: ~azure.mgmt.cdn.models.ValidateCustomDomainInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateCustomDomainOutput, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.ValidateCustomDomainOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateCustomDomainOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_host_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(check_host_name_availability_input, 'ValidateCustomDomainInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateCustomDomainOutput', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_host_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkHostNameAvailability'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_cdn_management_client_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_cdn_management_client_operations.py index 222f20b024d2..8e1b0d1e19bf 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_cdn_management_client_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_cdn_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -22,27 +22,25 @@ class CdnManagementClientOperationsMixin: async def check_name_availability( self, - name: str, + check_name_availability_input: "_models.CheckNameAvailabilityInput", **kwargs - ) -> "models.CheckNameAvailabilityOutput": + ) -> "_models.CheckNameAvailabilityOutput": """Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. - :param name: The resource name to validate. - :type name: str + :param check_name_availability_input: Input to check. + :type check_name_availability_input: ~azure.mgmt.cdn.models.CheckNameAvailabilityInput :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameAvailabilityOutput, or the result of cls(response) :rtype: ~azure.mgmt.cdn.models.CheckNameAvailabilityOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityOutput"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _check_name_availability_input = models.CheckNameAvailabilityInput(name=name) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -59,7 +57,7 @@ async def check_name_availability( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_check_name_availability_input, 'CheckNameAvailabilityInput') + body_content = self._serialize.body(check_name_availability_input, 'CheckNameAvailabilityInput') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -67,7 +65,7 @@ async def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityOutput', pipeline_response) @@ -80,27 +78,25 @@ async def check_name_availability( async def check_name_availability_with_subscription( self, - name: str, + check_name_availability_input: "_models.CheckNameAvailabilityInput", **kwargs - ) -> "models.CheckNameAvailabilityOutput": + ) -> "_models.CheckNameAvailabilityOutput": """Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. - :param name: The resource name to validate. - :type name: str + :param check_name_availability_input: Input to check. + :type check_name_availability_input: ~azure.mgmt.cdn.models.CheckNameAvailabilityInput :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameAvailabilityOutput, or the result of cls(response) :rtype: ~azure.mgmt.cdn.models.CheckNameAvailabilityOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityOutput"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _check_name_availability_input = models.CheckNameAvailabilityInput(name=name) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -121,7 +117,7 @@ async def check_name_availability_with_subscription( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_check_name_availability_input, 'CheckNameAvailabilityInput') + body_content = self._serialize.body(check_name_availability_input, 'CheckNameAvailabilityInput') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -129,7 +125,7 @@ async def check_name_availability_with_subscription( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityOutput', pipeline_response) @@ -142,28 +138,26 @@ async def check_name_availability_with_subscription( async def validate_probe( self, - probe_url: str, + validate_probe_input: "_models.ValidateProbeInput", **kwargs - ) -> "models.ValidateProbeOutput": + ) -> "_models.ValidateProbeOutput": """Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative to the origin path specified in the endpoint configuration. - :param probe_url: The probe URL to validate. - :type probe_url: str + :param validate_probe_input: Input to check. + :type validate_probe_input: ~azure.mgmt.cdn.models.ValidateProbeInput :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidateProbeOutput, or the result of cls(response) :rtype: ~azure.mgmt.cdn.models.ValidateProbeOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ValidateProbeOutput"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateProbeOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _validate_probe_input = models.ValidateProbeInput(probe_url=probe_url) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -184,7 +178,7 @@ async def validate_probe( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_validate_probe_input, 'ValidateProbeInput') + body_content = self._serialize.body(validate_probe_input, 'ValidateProbeInput') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -192,7 +186,7 @@ async def validate_probe( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidateProbeOutput', pipeline_response) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_custom_domains_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_custom_domains_operations.py index 5eb84d3dc8f8..9e9d9944c14f 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_custom_domains_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_custom_domains_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class CustomDomainsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ def list_by_endpoint( profile_name: str, endpoint_name: str, **kwargs - ) -> AsyncIterable["models.CustomDomainListResult"]: + ) -> AsyncIterable["_models.CustomDomainListResult"]: """Lists all of the existing custom domains within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -63,12 +63,12 @@ def list_by_endpoint( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.CustomDomainListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomDomainListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomDomainListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -111,7 +111,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -129,7 +129,7 @@ async def get( endpoint_name: str, custom_domain_name: str, **kwargs - ) -> "models.CustomDomain": + ) -> "_models.CustomDomain": """Gets an existing custom domain within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -145,12 +145,12 @@ async def get( :rtype: ~azure.mgmt.cdn.models.CustomDomain :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomDomain"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomDomain"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -178,7 +178,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CustomDomain', pipeline_response) @@ -195,17 +195,15 @@ async def _create_initial( profile_name: str, endpoint_name: str, custom_domain_name: str, - host_name: Optional[str] = None, + custom_domain_properties: "_models.CustomDomainParameters", **kwargs - ) -> "models.CustomDomain": - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomDomain"] + ) -> "_models.CustomDomain": + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomDomain"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _custom_domain_properties = models.CustomDomainParameters(host_name=host_name) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -230,7 +228,7 @@ async def _create_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_custom_domain_properties, 'CustomDomainParameters') + body_content = self._serialize.body(custom_domain_properties, 'CustomDomainParameters') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -238,7 +236,7 @@ async def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -262,9 +260,9 @@ async def begin_create( profile_name: str, endpoint_name: str, custom_domain_name: str, - host_name: Optional[str] = None, + custom_domain_properties: "_models.CustomDomainParameters", **kwargs - ) -> AsyncLROPoller["models.CustomDomain"]: + ) -> AsyncLROPoller["_models.CustomDomain"]: """Creates a new custom domain within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -275,8 +273,8 @@ async def begin_create( :type endpoint_name: str :param custom_domain_name: Name of the custom domain within an endpoint. :type custom_domain_name: str - :param host_name: The host name of the custom domain. Must be a domain name. - :type host_name: str + :param custom_domain_properties: Properties required to create a new custom domain. + :type custom_domain_properties: ~azure.mgmt.cdn.models.CustomDomainParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -288,7 +286,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomDomain"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomDomain"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -300,7 +298,7 @@ async def begin_create( profile_name=profile_name, endpoint_name=endpoint_name, custom_domain_name=custom_domain_name, - host_name=host_name, + custom_domain_properties=custom_domain_properties, cls=lambda x,y,z: x, **kwargs ) @@ -315,7 +313,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -336,13 +342,13 @@ async def _delete_initial( endpoint_name: str, custom_domain_name: str, **kwargs - ) -> Optional["models.CustomDomain"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.CustomDomain"]] + ) -> Optional["_models.CustomDomain"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CustomDomain"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -370,7 +376,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -390,7 +396,7 @@ async def begin_delete( endpoint_name: str, custom_domain_name: str, **kwargs - ) -> AsyncLROPoller["models.CustomDomain"]: + ) -> AsyncLROPoller["_models.CustomDomain"]: """Deletes an existing custom domain within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -412,7 +418,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomDomain"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomDomain"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +444,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -459,7 +473,7 @@ async def disable_custom_https( endpoint_name: str, custom_domain_name: str, **kwargs - ) -> Optional["models.CustomDomain"]: + ) -> Optional["_models.CustomDomain"]: """Disable https delivery of the custom domain. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -475,12 +489,12 @@ async def disable_custom_https( :rtype: ~azure.mgmt.cdn.models.CustomDomain or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.CustomDomain"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CustomDomain"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -508,7 +522,7 @@ async def disable_custom_https( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -527,9 +541,9 @@ async def enable_custom_https( profile_name: str, endpoint_name: str, custom_domain_name: str, - custom_domain_https_parameters: Optional["models.CustomDomainHttpsParameters"] = None, + custom_domain_https_parameters: Optional["_models.CustomDomainHttpsParameters"] = None, **kwargs - ) -> Optional["models.CustomDomain"]: + ) -> Optional["_models.CustomDomain"]: """Enable https delivery of the custom domain. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -549,12 +563,12 @@ async def enable_custom_https( :rtype: ~azure.mgmt.cdn.models.CustomDomain or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.CustomDomain"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CustomDomain"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -590,7 +604,7 @@ async def enable_custom_https( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_edge_nodes_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_edge_nodes_operations.py index 7c653f540df2..f2be0f50db1a 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_edge_nodes_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_edge_nodes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class EdgeNodesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.EdgenodeResult"]: + ) -> AsyncIterable["_models.EdgenodeResult"]: """Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. @@ -53,12 +53,12 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.EdgenodeResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EdgenodeResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EdgenodeResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -94,7 +94,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_endpoints_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_endpoints_operations.py index f033d8f8b9f1..cd7bbd4f49c2 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_endpoints_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_endpoints_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class EndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list_by_profile( resource_group_name: str, profile_name: str, **kwargs - ) -> AsyncIterable["models.EndpointListResult"]: + ) -> AsyncIterable["_models.EndpointListResult"]: """Lists existing CDN endpoints. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -60,12 +60,12 @@ def list_by_profile( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.EndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -107,7 +107,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -124,7 +124,7 @@ async def get( profile_name: str, endpoint_name: str, **kwargs - ) -> "models.Endpoint": + ) -> "_models.Endpoint": """Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. @@ -139,12 +139,12 @@ async def get( :rtype: ~azure.mgmt.cdn.models.Endpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -171,7 +171,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Endpoint', pipeline_response) @@ -187,15 +187,15 @@ async def _create_initial( resource_group_name: str, profile_name: str, endpoint_name: str, - endpoint: "models.Endpoint", + endpoint: "_models.Endpoint", **kwargs - ) -> "models.Endpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + ) -> "_models.Endpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -227,7 +227,7 @@ async def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -250,9 +250,9 @@ async def begin_create( resource_group_name: str, profile_name: str, endpoint_name: str, - endpoint: "models.Endpoint", + endpoint: "_models.Endpoint", **kwargs - ) -> AsyncLROPoller["models.Endpoint"]: + ) -> AsyncLROPoller["_models.Endpoint"]: """Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. @@ -275,7 +275,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -301,7 +301,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -320,15 +327,15 @@ async def _update_initial( resource_group_name: str, profile_name: str, endpoint_name: str, - endpoint_update_properties: "models.EndpointUpdateParameters", + endpoint_update_properties: "_models.EndpointUpdateParameters", **kwargs - ) -> "models.Endpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + ) -> "_models.Endpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -360,7 +367,7 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -380,9 +387,9 @@ async def begin_update( resource_group_name: str, profile_name: str, endpoint_name: str, - endpoint_update_properties: "models.EndpointUpdateParameters", + endpoint_update_properties: "_models.EndpointUpdateParameters", **kwargs - ) -> AsyncLROPoller["models.Endpoint"]: + ) -> AsyncLROPoller["_models.Endpoint"]: """Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update origin groups, use the Update @@ -407,7 +414,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +440,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -459,7 +473,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -486,7 +500,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -543,7 +557,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,13 +584,13 @@ async def _start_initial( profile_name: str, endpoint_name: str, **kwargs - ) -> "models.Endpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + ) -> "_models.Endpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -596,7 +617,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -617,7 +638,7 @@ async def begin_start( profile_name: str, endpoint_name: str, **kwargs - ) -> AsyncLROPoller["models.Endpoint"]: + ) -> AsyncLROPoller["_models.Endpoint"]: """Starts an existing CDN endpoint that is on a stopped state. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -637,7 +658,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -662,7 +683,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -682,13 +710,13 @@ async def _stop_initial( profile_name: str, endpoint_name: str, **kwargs - ) -> "models.Endpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + ) -> "_models.Endpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -715,7 +743,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -736,7 +764,7 @@ async def begin_stop( profile_name: str, endpoint_name: str, **kwargs - ) -> AsyncLROPoller["models.Endpoint"]: + ) -> AsyncLROPoller["_models.Endpoint"]: """Stops an existing running CDN endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -756,7 +784,7 @@ async def begin_stop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -781,7 +809,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +835,7 @@ async def _purge_content_initial( resource_group_name: str, profile_name: str, endpoint_name: str, - content_paths: List[str], + content_file_paths: "_models.PurgeParameters", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -808,9 +843,7 @@ async def _purge_content_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _content_file_paths = models.PurgeParameters(content_paths=content_paths) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -834,7 +867,7 @@ async def _purge_content_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_content_file_paths, 'PurgeParameters') + body_content = self._serialize.body(content_file_paths, 'PurgeParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -842,7 +875,7 @@ async def _purge_content_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -855,7 +888,7 @@ async def begin_purge_content( resource_group_name: str, profile_name: str, endpoint_name: str, - content_paths: List[str], + content_file_paths: "_models.PurgeParameters", **kwargs ) -> AsyncLROPoller[None]: """Removes a content from CDN. @@ -866,9 +899,10 @@ async def begin_purge_content( :type profile_name: str :param endpoint_name: Name of the endpoint under the profile which is unique globally. :type endpoint_name: str - :param content_paths: The path to the content to be purged. Can describe a file path or a wild - card directory. - :type content_paths: list[str] + :param content_file_paths: The path to the content to be purged. Path can be a full URL, e.g. + '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + '/pictures/*' which removes all folders and files in the directory. + :type content_file_paths: ~azure.mgmt.cdn.models.PurgeParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -891,7 +925,7 @@ async def begin_purge_content( resource_group_name=resource_group_name, profile_name=profile_name, endpoint_name=endpoint_name, - content_paths=content_paths, + content_file_paths=content_file_paths, cls=lambda x,y,z: x, **kwargs ) @@ -903,7 +937,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -922,7 +963,7 @@ async def _load_content_initial( resource_group_name: str, profile_name: str, endpoint_name: str, - content_paths: List[str], + content_file_paths: "_models.LoadParameters", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -930,9 +971,7 @@ async def _load_content_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _content_file_paths = models.LoadParameters(content_paths=content_paths) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -956,7 +995,7 @@ async def _load_content_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_content_file_paths, 'LoadParameters') + body_content = self._serialize.body(content_file_paths, 'LoadParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -964,7 +1003,7 @@ async def _load_content_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -977,7 +1016,7 @@ async def begin_load_content( resource_group_name: str, profile_name: str, endpoint_name: str, - content_paths: List[str], + content_file_paths: "_models.LoadParameters", **kwargs ) -> AsyncLROPoller[None]: """Pre-loads a content to CDN. Available for Verizon Profiles. @@ -988,9 +1027,9 @@ async def begin_load_content( :type profile_name: str :param endpoint_name: Name of the endpoint under the profile which is unique globally. :type endpoint_name: str - :param content_paths: The path to the content to be loaded. Path should be a relative file URL - of the origin. - :type content_paths: list[str] + :param content_file_paths: The path to the content to be loaded. Path should be a full URL, + e.g. ‘/pictures/city.png' which loads a single file. + :type content_file_paths: ~azure.mgmt.cdn.models.LoadParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -1013,7 +1052,7 @@ async def begin_load_content( resource_group_name=resource_group_name, profile_name=profile_name, endpoint_name=endpoint_name, - content_paths=content_paths, + content_file_paths=content_file_paths, cls=lambda x,y,z: x, **kwargs ) @@ -1025,7 +1064,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,9 +1090,9 @@ async def validate_custom_domain( resource_group_name: str, profile_name: str, endpoint_name: str, - host_name: str, + custom_domain_properties: "_models.ValidateCustomDomainInput", **kwargs - ) -> "models.ValidateCustomDomainOutput": + ) -> "_models.ValidateCustomDomainOutput": """Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -1055,21 +1101,19 @@ async def validate_custom_domain( :type profile_name: str :param endpoint_name: Name of the endpoint under the profile which is unique globally. :type endpoint_name: str - :param host_name: The host name of the custom domain. Must be a domain name. - :type host_name: str + :param custom_domain_properties: Custom domain to be validated. + :type custom_domain_properties: ~azure.mgmt.cdn.models.ValidateCustomDomainInput :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidateCustomDomainOutput, or the result of cls(response) :rtype: ~azure.mgmt.cdn.models.ValidateCustomDomainOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ValidateCustomDomainOutput"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateCustomDomainOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _custom_domain_properties = models.ValidateCustomDomainInput(host_name=host_name) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1093,7 +1137,7 @@ async def validate_custom_domain( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_custom_domain_properties, 'ValidateCustomDomainInput') + body_content = self._serialize.body(custom_domain_properties, 'ValidateCustomDomainInput') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -1101,7 +1145,7 @@ async def validate_custom_domain( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidateCustomDomainOutput', pipeline_response) @@ -1118,7 +1162,7 @@ def list_resource_usage( profile_name: str, endpoint_name: str, **kwargs - ) -> AsyncIterable["models.ResourceUsageListResult"]: + ) -> AsyncIterable["_models.ResourceUsageListResult"]: """Checks the quota and usage of geo filters and custom domains under the given endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -1132,12 +1176,12 @@ def list_resource_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.ResourceUsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceUsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceUsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -1180,7 +1224,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_log_analytics_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_log_analytics_operations.py new file mode 100644 index 000000000000..96d531608213 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_log_analytics_operations.py @@ -0,0 +1,523 @@ +# 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 datetime +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LogAnalyticsOperations: + """LogAnalyticsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_log_analytics_metrics( + self, + resource_group_name: str, + profile_name: str, + metrics: List[Union[str, "_models.Get4ItemsItem"]], + date_time_begin: datetime.datetime, + date_time_end: datetime.datetime, + granularity: Union[str, "_models.Enum31"], + group_by: Optional[List[Union[str, "_models.Get8ItemsItem"]]] = None, + continents: Optional[List[str]] = None, + country_or_regions: Optional[List[str]] = None, + custom_domains: Optional[List[str]] = None, + protocols: Optional[List[str]] = None, + **kwargs + ) -> "_models.MetricsResponse": + """Get log report for AFD profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param metrics: + :type metrics: list[str or ~azure.mgmt.cdn.models.Get4ItemsItem] + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param granularity: + :type granularity: str or ~azure.mgmt.cdn.models.Enum31 + :param group_by: + :type group_by: list[str or ~azure.mgmt.cdn.models.Get8ItemsItem] + :param continents: + :type continents: list[str] + :param country_or_regions: + :type country_or_regions: list[str] + :param custom_domains: + :type custom_domains: list[str] + :param protocols: + :type protocols: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MetricsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.MetricsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_log_analytics_metrics.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['metrics'] = self._serialize.query("metrics", metrics, '[str]', div=',') + query_parameters['dateTimeBegin'] = self._serialize.query("date_time_begin", date_time_begin, 'iso-8601') + query_parameters['dateTimeEnd'] = self._serialize.query("date_time_end", date_time_end, 'iso-8601') + query_parameters['granularity'] = self._serialize.query("granularity", granularity, 'str') + if group_by is not None: + query_parameters['groupBy'] = self._serialize.query("group_by", group_by, '[str]', div=',') + if continents is not None: + query_parameters['continents'] = self._serialize.query("continents", continents, '[str]', div=',') + if country_or_regions is not None: + query_parameters['countryOrRegions'] = self._serialize.query("country_or_regions", country_or_regions, '[str]', div=',') + if custom_domains is not None: + query_parameters['customDomains'] = self._serialize.query("custom_domains", custom_domains, '[str]', div=',') + if protocols is not None: + query_parameters['protocols'] = self._serialize.query("protocols", protocols, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MetricsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_log_analytics_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsMetrics'} # type: ignore + + async def get_log_analytics_rankings( + self, + resource_group_name: str, + profile_name: str, + rankings: List[Union[str, "_models.Enum35"]], + metrics: List[Union[str, "_models.Get5ItemsItem"]], + max_ranking: float, + date_time_begin: datetime.datetime, + date_time_end: datetime.datetime, + custom_domains: Optional[List[str]] = None, + **kwargs + ) -> "_models.RankingsResponse": + """Get log analytics ranking report for AFD profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rankings: + :type rankings: list[str or ~azure.mgmt.cdn.models.Enum35] + :param metrics: + :type metrics: list[str or ~azure.mgmt.cdn.models.Get5ItemsItem] + :param max_ranking: + :type max_ranking: float + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param custom_domains: + :type custom_domains: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RankingsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.RankingsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RankingsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_log_analytics_rankings.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['rankings'] = self._serialize.query("rankings", rankings, '[str]', div=',') + query_parameters['metrics'] = self._serialize.query("metrics", metrics, '[str]', div=',') + query_parameters['maxRanking'] = self._serialize.query("max_ranking", max_ranking, 'float') + query_parameters['dateTimeBegin'] = self._serialize.query("date_time_begin", date_time_begin, 'iso-8601') + query_parameters['dateTimeEnd'] = self._serialize.query("date_time_end", date_time_end, 'iso-8601') + if custom_domains is not None: + query_parameters['customDomains'] = self._serialize.query("custom_domains", custom_domains, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RankingsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_log_analytics_rankings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsRankings'} # type: ignore + + async def get_log_analytics_locations( + self, + resource_group_name: str, + profile_name: str, + **kwargs + ) -> "_models.ContinentsResponse": + """Get all available location names for AFD log analytics report. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinentsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.ContinentsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinentsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_log_analytics_locations.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ContinentsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_log_analytics_locations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsLocations'} # type: ignore + + async def get_log_analytics_resources( + self, + resource_group_name: str, + profile_name: str, + **kwargs + ) -> "_models.ResourcesResponse": + """Get all endpoints and custom domains available for AFD log report. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourcesResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.ResourcesResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcesResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_log_analytics_resources.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourcesResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_log_analytics_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsResources'} # type: ignore + + async def get_waf_log_analytics_metrics( + self, + resource_group_name: str, + profile_name: str, + metrics: List[str], + date_time_begin: datetime.datetime, + date_time_end: datetime.datetime, + granularity: Union[str, "_models.Enum37"], + actions: Optional[List[Union[str, "_models.Enum38"]]] = None, + group_by: Optional[List[Union[str, "_models.Enum39"]]] = None, + rule_types: Optional[List[Union[str, "_models.Enum40"]]] = None, + **kwargs + ) -> "_models.WafMetricsResponse": + """Get Waf related log analytics report for AFD profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param metrics: + :type metrics: list[str] + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param granularity: + :type granularity: str or ~azure.mgmt.cdn.models.Enum37 + :param actions: + :type actions: list[str or ~azure.mgmt.cdn.models.Enum38] + :param group_by: + :type group_by: list[str or ~azure.mgmt.cdn.models.Enum39] + :param rule_types: + :type rule_types: list[str or ~azure.mgmt.cdn.models.Enum40] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WafMetricsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.WafMetricsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WafMetricsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_waf_log_analytics_metrics.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['metrics'] = self._serialize.query("metrics", metrics, '[str]', div=',') + query_parameters['dateTimeBegin'] = self._serialize.query("date_time_begin", date_time_begin, 'iso-8601') + query_parameters['dateTimeEnd'] = self._serialize.query("date_time_end", date_time_end, 'iso-8601') + query_parameters['granularity'] = self._serialize.query("granularity", granularity, 'str') + if actions is not None: + query_parameters['actions'] = self._serialize.query("actions", actions, '[str]', div=',') + if group_by is not None: + query_parameters['groupBy'] = self._serialize.query("group_by", group_by, '[str]', div=',') + if rule_types is not None: + query_parameters['ruleTypes'] = self._serialize.query("rule_types", rule_types, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WafMetricsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_waf_log_analytics_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getWafLogAnalyticsMetrics'} # type: ignore + + async def get_waf_log_analytics_rankings( + self, + resource_group_name: str, + profile_name: str, + metrics: List[str], + date_time_begin: datetime.datetime, + date_time_end: datetime.datetime, + max_ranking: float, + rankings: List[Union[str, "_models.Enum42"]], + actions: Optional[List[Union[str, "_models.Enum43"]]] = None, + rule_types: Optional[List[Union[str, "_models.Enum44"]]] = None, + **kwargs + ) -> "_models.WafRankingsResponse": + """Get WAF log analytics charts for AFD profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param metrics: + :type metrics: list[str] + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param max_ranking: + :type max_ranking: float + :param rankings: + :type rankings: list[str or ~azure.mgmt.cdn.models.Enum42] + :param actions: + :type actions: list[str or ~azure.mgmt.cdn.models.Enum43] + :param rule_types: + :type rule_types: list[str or ~azure.mgmt.cdn.models.Enum44] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WafRankingsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.WafRankingsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WafRankingsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_waf_log_analytics_rankings.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['metrics'] = self._serialize.query("metrics", metrics, '[str]', div=',') + query_parameters['dateTimeBegin'] = self._serialize.query("date_time_begin", date_time_begin, 'iso-8601') + query_parameters['dateTimeEnd'] = self._serialize.query("date_time_end", date_time_end, 'iso-8601') + query_parameters['maxRanking'] = self._serialize.query("max_ranking", max_ranking, 'float') + query_parameters['rankings'] = self._serialize.query("rankings", rankings, '[str]', div=',') + if actions is not None: + query_parameters['actions'] = self._serialize.query("actions", actions, '[str]', div=',') + if rule_types is not None: + query_parameters['ruleTypes'] = self._serialize.query("rule_types", rule_types, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WafRankingsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_waf_log_analytics_rankings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getWafLogAnalyticsRankings'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_managed_rule_sets_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_managed_rule_sets_operations.py index 877bd337bb12..3730b2536a4e 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_managed_rule_sets_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_managed_rule_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ManagedRuleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ManagedRuleSetDefinitionList"]: + ) -> AsyncIterable["_models.ManagedRuleSetDefinitionList"]: """Lists all available managed rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,12 +52,12 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.ManagedRuleSetDefinitionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedRuleSetDefinitionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedRuleSetDefinitionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -97,7 +97,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_operations.py index 640394c34dfc..2f41fde63587 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationsListResult"]: + ) -> AsyncIterable["_models.OperationsListResult"]: """Lists all of the available CDN REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,12 +52,12 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.OperationsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_origin_groups_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_origin_groups_operations.py index e98822618619..ece5546c8d43 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_origin_groups_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_origin_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class OriginGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ def list_by_endpoint( profile_name: str, endpoint_name: str, **kwargs - ) -> AsyncIterable["models.OriginGroupListResult"]: + ) -> AsyncIterable["_models.OriginGroupListResult"]: """Lists all of the existing origin groups within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -63,12 +63,12 @@ def list_by_endpoint( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.OriginGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -111,7 +111,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -129,7 +129,7 @@ async def get( endpoint_name: str, origin_group_name: str, **kwargs - ) -> "models.OriginGroup": + ) -> "_models.OriginGroup": """Gets an existing origin group within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -145,12 +145,12 @@ async def get( :rtype: ~azure.mgmt.cdn.models.OriginGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -178,7 +178,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OriginGroup', pipeline_response) @@ -195,15 +195,15 @@ async def _create_initial( profile_name: str, endpoint_name: str, origin_group_name: str, - origin_group: "models.OriginGroup", + origin_group: "_models.OriginGroup", **kwargs - ) -> "models.OriginGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroup"] + ) -> "_models.OriginGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -236,7 +236,7 @@ async def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -260,9 +260,9 @@ async def begin_create( profile_name: str, endpoint_name: str, origin_group_name: str, - origin_group: "models.OriginGroup", + origin_group: "_models.OriginGroup", **kwargs - ) -> AsyncLROPoller["models.OriginGroup"]: + ) -> AsyncLROPoller["_models.OriginGroup"]: """Creates a new origin group within the specified endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -286,7 +286,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -313,7 +313,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,15 +341,15 @@ async def _update_initial( profile_name: str, endpoint_name: str, origin_group_name: str, - origin_group_update_properties: "models.OriginGroupUpdateParameters", + origin_group_update_properties: "_models.OriginGroupUpdateParameters", **kwargs - ) -> "models.OriginGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroup"] + ) -> "_models.OriginGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -374,7 +382,7 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -395,9 +403,9 @@ async def begin_update( profile_name: str, endpoint_name: str, origin_group_name: str, - origin_group_update_properties: "models.OriginGroupUpdateParameters", + origin_group_update_properties: "_models.OriginGroupUpdateParameters", **kwargs - ) -> AsyncLROPoller["models.OriginGroup"]: + ) -> AsyncLROPoller["_models.OriginGroup"]: """Updates an existing origin group within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -421,7 +429,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -448,7 +456,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -475,7 +491,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -503,7 +519,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -563,7 +579,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_origins_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_origins_operations.py index 9ac88d64fff3..7f17a17a07d5 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_origins_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_origins_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class OriginsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ def list_by_endpoint( profile_name: str, endpoint_name: str, **kwargs - ) -> AsyncIterable["models.OriginListResult"]: + ) -> AsyncIterable["_models.OriginListResult"]: """Lists all of the existing origins within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -63,12 +63,12 @@ def list_by_endpoint( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.OriginListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -111,7 +111,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -129,7 +129,7 @@ async def get( endpoint_name: str, origin_name: str, **kwargs - ) -> "models.Origin": + ) -> "_models.Origin": """Gets an existing origin within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -145,12 +145,12 @@ async def get( :rtype: ~azure.mgmt.cdn.models.Origin :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Origin"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Origin"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -178,7 +178,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Origin', pipeline_response) @@ -195,15 +195,15 @@ async def _create_initial( profile_name: str, endpoint_name: str, origin_name: str, - origin: "models.Origin", + origin: "_models.Origin", **kwargs - ) -> "models.Origin": - cls = kwargs.pop('cls', None) # type: ClsType["models.Origin"] + ) -> "_models.Origin": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Origin"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -236,7 +236,7 @@ async def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -260,9 +260,9 @@ async def begin_create( profile_name: str, endpoint_name: str, origin_name: str, - origin: "models.Origin", + origin: "_models.Origin", **kwargs - ) -> AsyncLROPoller["models.Origin"]: + ) -> AsyncLROPoller["_models.Origin"]: """Creates a new origin within the specified endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -286,7 +286,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Origin"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Origin"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -313,7 +313,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,15 +341,15 @@ async def _update_initial( profile_name: str, endpoint_name: str, origin_name: str, - origin_update_properties: "models.OriginUpdateParameters", + origin_update_properties: "_models.OriginUpdateParameters", **kwargs - ) -> "models.Origin": - cls = kwargs.pop('cls', None) # type: ClsType["models.Origin"] + ) -> "_models.Origin": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Origin"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -374,7 +382,7 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -395,9 +403,9 @@ async def begin_update( profile_name: str, endpoint_name: str, origin_name: str, - origin_update_properties: "models.OriginUpdateParameters", + origin_update_properties: "_models.OriginUpdateParameters", **kwargs - ) -> AsyncLROPoller["models.Origin"]: + ) -> AsyncLROPoller["_models.Origin"]: """Updates an existing origin within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -421,7 +429,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Origin"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Origin"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -448,7 +456,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -475,7 +491,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -503,7 +519,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -563,7 +579,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_policies_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_policies_operations.py index 2dd9cd35f031..d9f50420f06f 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_policies_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.CdnWebApplicationFirewallPolicyList"]: + ) -> AsyncIterable["_models.CdnWebApplicationFirewallPolicyList"]: """Lists all of the protection policies within a resource group. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -57,12 +57,12 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicyList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicyList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicyList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -74,7 +74,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -103,7 +103,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -119,7 +119,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.CdnWebApplicationFirewallPolicy": + ) -> "_models.CdnWebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -131,18 +131,18 @@ async def get( :rtype: ~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CdnWebApplicationFirewallPolicy', pipeline_response) @@ -177,22 +177,22 @@ async def _create_or_update_initial( self, resource_group_name: str, policy_name: str, - cdn_web_application_firewall_policy: "models.CdnWebApplicationFirewallPolicy", + cdn_web_application_firewall_policy: "_models.CdnWebApplicationFirewallPolicy", **kwargs - ) -> "models.CdnWebApplicationFirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicy"] + ) -> "_models.CdnWebApplicationFirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -216,7 +216,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -238,9 +238,9 @@ async def begin_create_or_update( self, resource_group_name: str, policy_name: str, - cdn_web_application_firewall_policy: "models.CdnWebApplicationFirewallPolicy", + cdn_web_application_firewall_policy: "_models.CdnWebApplicationFirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.CdnWebApplicationFirewallPolicy"]: + ) -> AsyncLROPoller["_models.CdnWebApplicationFirewallPolicy"]: """Create or update policy with specified rule set name within a resource group. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -260,7 +260,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +285,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -303,24 +309,22 @@ async def _update_initial( self, resource_group_name: str, policy_name: str, - tags: Optional[Dict[str, str]] = None, + cdn_web_application_firewall_policy_patch_parameters: "_models.CdnWebApplicationFirewallPolicyPatchParameters", **kwargs - ) -> "models.CdnWebApplicationFirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicy"] + ) -> "_models.CdnWebApplicationFirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _cdn_web_application_firewall_policy_patch_parameters = models.CdnWebApplicationFirewallPolicyPatchParameters(tags=tags) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -336,7 +340,7 @@ async def _update_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_cdn_web_application_firewall_policy_patch_parameters, 'CdnWebApplicationFirewallPolicyPatchParameters') + body_content = self._serialize.body(cdn_web_application_firewall_policy_patch_parameters, 'CdnWebApplicationFirewallPolicyPatchParameters') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -344,7 +348,7 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -363,9 +367,9 @@ async def begin_update( self, resource_group_name: str, policy_name: str, - tags: Optional[Dict[str, str]] = None, + cdn_web_application_firewall_policy_patch_parameters: "_models.CdnWebApplicationFirewallPolicyPatchParameters", **kwargs - ) -> AsyncLROPoller["models.CdnWebApplicationFirewallPolicy"]: + ) -> AsyncLROPoller["_models.CdnWebApplicationFirewallPolicy"]: """Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified subscription and resource group. @@ -373,8 +377,9 @@ async def begin_update( :type resource_group_name: str :param policy_name: The name of the CdnWebApplicationFirewallPolicy. :type policy_name: str - :param tags: CdnWebApplicationFirewallPolicy tags. - :type tags: dict[str, str] + :param cdn_web_application_firewall_policy_patch_parameters: CdnWebApplicationFirewallPolicy + parameters to be patched. + :type cdn_web_application_firewall_policy_patch_parameters: ~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicyPatchParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -386,7 +391,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -396,7 +401,7 @@ async def begin_update( raw_result = await self._update_initial( resource_group_name=resource_group_name, policy_name=policy_name, - tags=tags, + cdn_web_application_firewall_policy_patch_parameters=cdn_web_application_firewall_policy_patch_parameters, cls=lambda x,y,z: x, **kwargs ) @@ -411,7 +416,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,12 +458,12 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_profiles_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_profiles_operations.py index 12941b39f9ea..87b279328779 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_profiles_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ProfileListResult"]: + ) -> AsyncIterable["_models.ProfileListResult"]: """Lists all of the CDN profiles within an Azure subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,12 +54,12 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.ProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -99,7 +99,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -114,7 +114,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ProfileListResult"]: + ) -> AsyncIterable["_models.ProfileListResult"]: """Lists all of the CDN profiles within a resource group. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -124,12 +124,12 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.ProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -170,7 +170,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -186,7 +186,7 @@ async def get( resource_group_name: str, profile_name: str, **kwargs - ) -> "models.Profile": + ) -> "_models.Profile": """Gets a CDN profile with the specified profile name under the specified subscription and resource group. @@ -199,12 +199,12 @@ async def get( :rtype: ~azure.mgmt.cdn.models.Profile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Profile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Profile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -230,7 +230,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Profile', pipeline_response) @@ -245,15 +245,15 @@ async def _create_initial( self, resource_group_name: str, profile_name: str, - profile: "models.Profile", + profile: "_models.Profile", **kwargs - ) -> "models.Profile": - cls = kwargs.pop('cls', None) # type: ClsType["models.Profile"] + ) -> "_models.Profile": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Profile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -284,7 +284,7 @@ async def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -306,9 +306,9 @@ async def begin_create( self, resource_group_name: str, profile_name: str, - profile: "models.Profile", + profile: "_models.Profile", **kwargs - ) -> AsyncLROPoller["models.Profile"]: + ) -> AsyncLROPoller["_models.Profile"]: """Creates a new CDN profile with a profile name under the specified subscription and resource group. @@ -329,7 +329,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Profile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Profile"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -354,7 +354,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -372,17 +378,15 @@ async def _update_initial( self, resource_group_name: str, profile_name: str, - tags: Optional[Dict[str, str]] = None, + profile_update_parameters: "_models.ProfileUpdateParameters", **kwargs - ) -> "models.Profile": - cls = kwargs.pop('cls', None) # type: ClsType["models.Profile"] + ) -> "_models.Profile": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Profile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _profile_update_parameters = models.ProfileUpdateParameters(tags=tags) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -405,7 +409,7 @@ async def _update_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_profile_update_parameters, 'ProfileUpdateParameters') + body_content = self._serialize.body(profile_update_parameters, 'ProfileUpdateParameters') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -413,7 +417,7 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -432,9 +436,9 @@ async def begin_update( self, resource_group_name: str, profile_name: str, - tags: Optional[Dict[str, str]] = None, + profile_update_parameters: "_models.ProfileUpdateParameters", **kwargs - ) -> AsyncLROPoller["models.Profile"]: + ) -> AsyncLROPoller["_models.Profile"]: """Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. @@ -442,8 +446,8 @@ async def begin_update( :type resource_group_name: str :param profile_name: Name of the CDN profile which is unique within the resource group. :type profile_name: str - :param tags: Profile tags. - :type tags: dict[str, str] + :param profile_update_parameters: Profile properties needed to update an existing profile. + :type profile_update_parameters: ~azure.mgmt.cdn.models.ProfileUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -455,7 +459,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Profile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Profile"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -465,7 +469,7 @@ async def begin_update( raw_result = await self._update_initial( resource_group_name=resource_group_name, profile_name=profile_name, - tags=tags, + profile_update_parameters=profile_update_parameters, cls=lambda x,y,z: x, **kwargs ) @@ -480,7 +484,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -505,7 +515,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -531,7 +541,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -584,7 +594,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -603,7 +619,7 @@ async def generate_sso_uri( resource_group_name: str, profile_name: str, **kwargs - ) -> "models.SsoUri": + ) -> "_models.SsoUri": """Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a standard profile; rules engine, advanced HTTP reports, and @@ -619,12 +635,12 @@ async def generate_sso_uri( :rtype: ~azure.mgmt.cdn.models.SsoUri :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SsoUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SsoUri"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -650,7 +666,7 @@ async def generate_sso_uri( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SsoUri', pipeline_response) @@ -666,7 +682,7 @@ async def list_supported_optimization_types( resource_group_name: str, profile_name: str, **kwargs - ) -> "models.SupportedOptimizationTypesListResult": + ) -> "_models.SupportedOptimizationTypesListResult": """Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization type from the listed values. @@ -679,12 +695,12 @@ async def list_supported_optimization_types( :rtype: ~azure.mgmt.cdn.models.SupportedOptimizationTypesListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SupportedOptimizationTypesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SupportedOptimizationTypesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -710,7 +726,7 @@ async def list_supported_optimization_types( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SupportedOptimizationTypesListResult', pipeline_response) @@ -726,7 +742,7 @@ def list_resource_usage( resource_group_name: str, profile_name: str, **kwargs - ) -> AsyncIterable["models.ResourceUsageListResult"]: + ) -> AsyncIterable["_models.ResourceUsageListResult"]: """Checks the quota and actual usage of endpoints under the given CDN profile. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -738,12 +754,12 @@ def list_resource_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.ResourceUsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceUsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceUsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -785,7 +801,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_resource_usage_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_resource_usage_operations.py index 9975d93ba0e1..907309022416 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_resource_usage_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_resource_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ResourceUsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ResourceUsageListResult"]: + ) -> AsyncIterable["_models.ResourceUsageListResult"]: """Check the quota and actual usage of the CDN profiles under the given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,12 +52,12 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.ResourceUsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceUsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceUsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -97,7 +97,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_routes_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_routes_operations.py new file mode 100644 index 000000000000..6b664b4b88ce --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_routes_operations.py @@ -0,0 +1,603 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RoutesOperations: + """RoutesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_endpoint( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + **kwargs + ) -> AsyncIterable["_models.RouteListResult"]: + """Lists all of the existing origins within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.RouteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_endpoint.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RouteListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_endpoint.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes'} # type: ignore + + async def get( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + route_name: str, + **kwargs + ) -> "_models.Route": + """Gets an existing route with the specified route name under the specified subscription, resource + group, profile, and AzureFrontDoor endpoint. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param route_name: Name of the routing rule. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Route, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.Route + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + route_name: str, + route: "_models.Route", + **kwargs + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'Route') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Route', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + route_name: str, + route: "_models.Route", + **kwargs + ) -> AsyncLROPoller["_models.Route"]: + """Creates a new route with the specified route name under the specified subscription, resource + group, profile, and AzureFrontDoor endpoint. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param route_name: Name of the routing rule. + :type route_name: str + :param route: Route properties. + :type route: ~azure.mgmt.cdn.models.Route + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + route_name=route_name, + route=route, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + route_name: str, + route_update_properties: "_models.RouteUpdateParameters", + **kwargs + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route_update_properties, 'RouteUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Route', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + route_name: str, + route_update_properties: "_models.RouteUpdateParameters", + **kwargs + ) -> AsyncLROPoller["_models.Route"]: + """Updates an existing route with the specified route name under the specified subscription, + resource group, profile, and AzureFrontDoor endpoint. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param route_name: Name of the routing rule. + :type route_name: str + :param route_update_properties: Route update properties. + :type route_update_properties: ~azure.mgmt.cdn.models.RouteUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + route_name=route_name, + route_update_properties=route_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + route_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + profile_name: str, + endpoint_name: str, + route_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing route with the specified route name under the specified subscription, + resource group, profile, and AzureFrontDoor endpoint. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param route_name: Name of the routing rule. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + route_name=route_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_rule_sets_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_rule_sets_operations.py new file mode 100644 index 000000000000..f09eaf880fb6 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_rule_sets_operations.py @@ -0,0 +1,515 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RuleSetsOperations: + """RuleSetsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name: str, + profile_name: str, + **kwargs + ) -> AsyncIterable["_models.RuleSetListResult"]: + """Lists existing AzureFrontDoor rule sets within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RuleSetListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.RuleSetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RuleSetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RuleSetListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets'} # type: ignore + + async def get( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + **kwargs + ) -> "_models.RuleSet": + """Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified + subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile which is unique globally. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RuleSet, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.RuleSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RuleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RuleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + rule_set: "_models.RuleSet", + **kwargs + ) -> "_models.RuleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RuleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(rule_set, 'RuleSet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RuleSet', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RuleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + rule_set: "_models.RuleSet", + **kwargs + ) -> AsyncLROPoller["_models.RuleSet"]: + """Creates a new rule set within the specified profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile which is unique globally. + :type rule_set_name: str + :param rule_set: RuleSet properties. + :type rule_set: ~azure.mgmt.cdn.models.RuleSet + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RuleSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.RuleSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RuleSet"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + rule_set_name=rule_set_name, + rule_set=rule_set, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RuleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing AzureFrontDoor rule set with the specified rule set name under the + specified subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile which is unique globally. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + rule_set_name=rule_set_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}'} # type: ignore + + def list_resource_usage( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + **kwargs + ) -> AsyncIterable["_models.UsagesListResult"]: + """Checks the quota and actual usage of endpoints under the given CDN profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile which is unique globally. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_resource_usage.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_resource_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/usages'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_rules_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_rules_operations.py new file mode 100644 index 000000000000..a60be825443d --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_rules_operations.py @@ -0,0 +1,599 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RulesOperations: + """RulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_rule_set( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + **kwargs + ) -> AsyncIterable["_models.RuleListResult"]: + """Lists all of the existing delivery rules within a rule set. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.RuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_rule_set.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_rule_set.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules'} # type: ignore + + async def get( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + rule_name: str, + **kwargs + ) -> "_models.Rule": + """Gets an existing delivery rule within a rule set. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile. + :type rule_set_name: str + :param rule_name: Name of the delivery rule which is unique within the endpoint. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Rule, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.Rule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Rule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Rule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + rule_name: str, + rule: "_models.Rule", + **kwargs + ) -> "_models.Rule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Rule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(rule, 'Rule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Rule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Rule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + rule_name: str, + rule: "_models.Rule", + **kwargs + ) -> AsyncLROPoller["_models.Rule"]: + """Creates a new delivery rule within the specified rule set. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile. + :type rule_set_name: str + :param rule_name: Name of the delivery rule which is unique within the endpoint. + :type rule_name: str + :param rule: The delivery rule properties. + :type rule: ~azure.mgmt.cdn.models.Rule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Rule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.Rule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Rule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + rule_set_name=rule_set_name, + rule_name=rule_name, + rule=rule, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Rule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + rule_name: str, + rule_update_properties: "_models.RuleUpdateParameters", + **kwargs + ) -> "_models.Rule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Rule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(rule_update_properties, 'RuleUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Rule', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Rule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + rule_name: str, + rule_update_properties: "_models.RuleUpdateParameters", + **kwargs + ) -> AsyncLROPoller["_models.Rule"]: + """Updates an existing delivery rule within a rule set. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile. + :type rule_set_name: str + :param rule_name: Name of the delivery rule which is unique within the endpoint. + :type rule_name: str + :param rule_update_properties: Delivery rule properties. + :type rule_update_properties: ~azure.mgmt.cdn.models.RuleUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Rule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.Rule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Rule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + rule_set_name=rule_set_name, + rule_name=rule_name, + rule_update_properties=rule_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Rule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + rule_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + profile_name: str, + rule_set_name: str, + rule_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing delivery rule within a rule set. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile. + :type rule_set_name: str + :param rule_name: Name of the delivery rule which is unique within the endpoint. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + rule_set_name=rule_set_name, + rule_name=rule_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_secrets_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_secrets_operations.py new file mode 100644 index 000000000000..53a4a930c6ae --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_secrets_operations.py @@ -0,0 +1,570 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SecretsOperations: + """SecretsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name: str, + profile_name: str, + **kwargs + ) -> AsyncIterable["_models.SecretListResult"]: + """Lists existing AzureFrontDoor secrets. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecretListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.SecretListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecretListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SecretListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets'} # type: ignore + + async def get( + self, + resource_group_name: str, + profile_name: str, + secret_name: str, + **kwargs + ) -> "_models.Secret": + """Gets an existing Secret within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param secret_name: Name of the Secret under the profile. + :type secret_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Secret, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.Secret + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + profile_name: str, + secret_name: str, + secret: "_models.Secret", + **kwargs + ) -> "_models.Secret": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(secret, 'Secret') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Secret', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + profile_name: str, + secret_name: str, + secret: "_models.Secret", + **kwargs + ) -> AsyncLROPoller["_models.Secret"]: + """Creates a new Secret within the specified profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param secret_name: Name of the Secret under the profile. + :type secret_name: str + :param secret: The Secret properties. + :type secret: ~azure.mgmt.cdn.models.Secret + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Secret or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.Secret] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + secret_name=secret_name, + secret=secret, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + profile_name: str, + secret_name: str, + secret_properties: "_models.SecretProperties", + **kwargs + ) -> "_models.Secret": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(secret_properties, 'SecretProperties') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Secret', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + profile_name: str, + secret_name: str, + secret_properties: "_models.SecretProperties", + **kwargs + ) -> AsyncLROPoller["_models.Secret"]: + """Updates an existing Secret within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param secret_name: Name of the Secret under the profile. + :type secret_name: str + :param secret_properties: Secret properties. + :type secret_properties: ~azure.mgmt.cdn.models.SecretProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Secret or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.Secret] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + secret_name=secret_name, + secret_properties=secret_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + profile_name: str, + secret_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + profile_name: str, + secret_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing Secret within profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param secret_name: Name of the Secret under the profile. + :type secret_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + secret_name=secret_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_security_policies_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_security_policies_operations.py new file mode 100644 index 000000000000..0a8d3076ce35 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_security_policies_operations.py @@ -0,0 +1,570 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SecurityPoliciesOperations: + """SecurityPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name: str, + profile_name: str, + **kwargs + ) -> AsyncIterable["_models.SecurityPolicyListResult"]: + """Lists security policies associated with the profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecurityPolicyListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cdn.models.SecurityPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SecurityPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies'} # type: ignore + + async def get( + self, + resource_group_name: str, + profile_name: str, + security_policy_name: str, + **kwargs + ) -> "_models.SecurityPolicy": + """Gets an existing security policy within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param security_policy_name: Name of the security policy under the profile. + :type security_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SecurityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.SecurityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + profile_name: str, + security_policy_name: str, + security_policy: "_models.SecurityPolicy", + **kwargs + ) -> "_models.SecurityPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_policy, 'SecurityPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + profile_name: str, + security_policy_name: str, + security_policy: "_models.SecurityPolicy", + **kwargs + ) -> AsyncLROPoller["_models.SecurityPolicy"]: + """Creates a new security policy within the specified profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param security_policy_name: Name of the security policy under the profile. + :type security_policy_name: str + :param security_policy: The security policy properties. + :type security_policy: ~azure.mgmt.cdn.models.SecurityPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SecurityPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + security_policy_name=security_policy_name, + security_policy=security_policy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + async def _patch_initial( + self, + resource_group_name: str, + profile_name: str, + security_policy_name: str, + security_policy_parameters: "_models.SecurityPolicyWebApplicationFirewallParameters", + **kwargs + ) -> "_models.SecurityPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._patch_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_policy_parameters, 'SecurityPolicyWebApplicationFirewallParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _patch_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + async def begin_patch( + self, + resource_group_name: str, + profile_name: str, + security_policy_name: str, + security_policy_parameters: "_models.SecurityPolicyWebApplicationFirewallParameters", + **kwargs + ) -> AsyncLROPoller["_models.SecurityPolicy"]: + """Updates an existing Secret within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param security_policy_name: Name of the security policy under the profile. + :type security_policy_name: str + :param security_policy_parameters: Security policy update properties. + :type security_policy_parameters: ~azure.mgmt.cdn.models.SecurityPolicyWebApplicationFirewallParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SecurityPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cdn.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._patch_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + security_policy_name=security_policy_name, + security_policy_parameters=security_policy_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + profile_name: str, + security_policy_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + profile_name: str, + security_policy_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing security policy within profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param security_policy_name: Name of the Secret under the profile. + :type security_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + security_policy_name=security_policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_validate_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_validate_operations.py new file mode 100644 index 000000000000..13208ac6a88a --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_validate_operations.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ValidateOperations: + """ValidateOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def secret( + self, + validate_secret_input: "_models.ValidateSecretInput", + **kwargs + ) -> "_models.ValidateSecretOutput": + """Validate a Secret in the profile. + + :param validate_secret_input: The Secret source. + :type validate_secret_input: ~azure.mgmt.cdn.models.ValidateSecretInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateSecretOutput, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.ValidateSecretOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateSecretOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.secret.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_secret_input, 'ValidateSecretInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateSecretOutput', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + secret.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateSecret'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py index 3ade6aa1ec4a..39d2f308db6a 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py @@ -7,6 +7,30 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AFDDomain + from ._models_py3 import AFDDomainHttpsParameters + from ._models_py3 import AFDDomainListResult + from ._models_py3 import AFDDomainProperties + from ._models_py3 import AFDDomainUpdateParameters + from ._models_py3 import AFDDomainUpdatePropertiesParameters + from ._models_py3 import AFDEndpoint + from ._models_py3 import AFDEndpointListResult + from ._models_py3 import AFDEndpointProperties + from ._models_py3 import AFDEndpointPropertiesUpdateParameters + from ._models_py3 import AFDEndpointUpdateParameters + from ._models_py3 import AFDOrigin + from ._models_py3 import AFDOriginGroup + from ._models_py3 import AFDOriginGroupListResult + from ._models_py3 import AFDOriginGroupProperties + from ._models_py3 import AFDOriginGroupUpdateParameters + from ._models_py3 import AFDOriginGroupUpdatePropertiesParameters + from ._models_py3 import AFDOriginListResult + from ._models_py3 import AFDOriginProperties + from ._models_py3 import AFDOriginUpdateParameters + from ._models_py3 import AFDOriginUpdatePropertiesParameters + from ._models_py3 import AFDStateProperties + from ._models_py3 import AfdErrorResponse + from ._models_py3 import AfdPurgeParameters from ._models_py3 import CacheExpirationActionParameters from ._models_py3 import CacheKeyQueryStringActionParameters from ._models_py3 import CdnCertificateSourceParameters @@ -15,9 +39,17 @@ from ._models_py3 import CdnWebApplicationFirewallPolicy from ._models_py3 import CdnWebApplicationFirewallPolicyList from ._models_py3 import CdnWebApplicationFirewallPolicyPatchParameters + from ._models_py3 import Certificate from ._models_py3 import CheckNameAvailabilityInput from ._models_py3 import CheckNameAvailabilityOutput from ._models_py3 import CidrIpAddress + from ._models_py3 import Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems + from ._models_py3 import Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems + from ._models_py3 import ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems + from ._models_py3 import CompressionSettings + from ._models_py3 import ContinentsResponse + from ._models_py3 import ContinentsResponseContinentsItem + from ._models_py3 import ContinentsResponseCountryOrRegionsItem from ._models_py3 import CookiesMatchConditionParameters from ._models_py3 import CustomDomain from ._models_py3 import CustomDomainHttpsParameters @@ -25,6 +57,8 @@ from ._models_py3 import CustomDomainParameters from ._models_py3 import CustomRule from ._models_py3 import CustomRuleList + from ._models_py3 import CustomerCertificate + from ._models_py3 import CustomerCertificateParameters from ._models_py3 import DeepCreatedOrigin from ._models_py3 import DeepCreatedOriginGroup from ._models_py3 import DeliveryRule @@ -48,6 +82,7 @@ from ._models_py3 import DeliveryRuleUrlFileExtensionCondition from ._models_py3 import DeliveryRuleUrlFileNameCondition from ._models_py3 import DeliveryRuleUrlPathCondition + from ._models_py3 import DomainValidationProperties from ._models_py3 import EdgeNode from ._models_py3 import EdgenodeResult from ._models_py3 import Endpoint @@ -67,7 +102,10 @@ from ._models_py3 import IsDeviceMatchConditionParameters from ._models_py3 import KeyVaultCertificateSourceParameters from ._models_py3 import KeyVaultSigningKeyParameters + from ._models_py3 import LoadBalancingSettingsParameters from ._models_py3 import LoadParameters + from ._models_py3 import ManagedCertificate + from ._models_py3 import ManagedCertificateParameters from ._models_py3 import ManagedRuleDefinition from ._models_py3 import ManagedRuleGroupDefinition from ._models_py3 import ManagedRuleGroupOverride @@ -77,12 +115,17 @@ from ._models_py3 import ManagedRuleSetDefinitionList from ._models_py3 import ManagedRuleSetList from ._models_py3 import MatchCondition + from ._models_py3 import MetricsResponse + from ._models_py3 import MetricsResponseSeriesItem + from ._models_py3 import MetricsResponseSeriesPropertiesItemsItem from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationsListResult from ._models_py3 import Origin from ._models_py3 import OriginGroup from ._models_py3 import OriginGroupListResult + from ._models_py3 import OriginGroupOverrideAction + from ._models_py3 import OriginGroupOverrideActionParameters from ._models_py3 import OriginGroupProperties from ._models_py3 import OriginGroupUpdateParameters from ._models_py3 import OriginGroupUpdatePropertiesParameters @@ -98,6 +141,10 @@ from ._models_py3 import ProxyResource from ._models_py3 import PurgeParameters from ._models_py3 import QueryStringMatchConditionParameters + from ._models_py3 import RankingsResponse + from ._models_py3 import RankingsResponseTablesItem + from ._models_py3 import RankingsResponseTablesPropertiesItemsItem + from ._models_py3 import RankingsResponseTablesPropertiesItemsMetricsItem from ._models_py3 import RateLimitRule from ._models_py3 import RateLimitRuleList from ._models_py3 import RemoteAddressMatchConditionParameters @@ -110,10 +157,39 @@ from ._models_py3 import ResourceReference from ._models_py3 import ResourceUsage from ._models_py3 import ResourceUsageListResult + from ._models_py3 import ResourcesResponse + from ._models_py3 import ResourcesResponseCustomDomainsItem + from ._models_py3 import ResourcesResponseEndpointsItem + from ._models_py3 import ResourcesResponseEndpointsPropertiesItemsItem from ._models_py3 import ResponseBasedOriginErrorDetectionParameters + from ._models_py3 import Route + from ._models_py3 import RouteListResult + from ._models_py3 import RouteProperties + from ._models_py3 import RouteUpdateParameters + from ._models_py3 import RouteUpdatePropertiesParameters + from ._models_py3 import Rule + from ._models_py3 import RuleListResult + from ._models_py3 import RuleProperties + from ._models_py3 import RuleSet + from ._models_py3 import RuleSetListResult + from ._models_py3 import RuleSetProperties + from ._models_py3 import RuleUpdateParameters + from ._models_py3 import RuleUpdatePropertiesParameters + from ._models_py3 import Secret + from ._models_py3 import SecretListResult + from ._models_py3 import SecretParameters + from ._models_py3 import SecretProperties + from ._models_py3 import SecurityPolicy + from ._models_py3 import SecurityPolicyListResult + from ._models_py3 import SecurityPolicyParameters + from ._models_py3 import SecurityPolicyProperties + from ._models_py3 import SecurityPolicyWebApplicationFirewallAssociation + from ._models_py3 import SecurityPolicyWebApplicationFirewallParameters + from ._models_py3 import SharedPrivateLinkResourceProperties from ._models_py3 import Sku from ._models_py3 import SsoUri from ._models_py3 import SupportedOptimizationTypesListResult + from ._models_py3 import SystemData from ._models_py3 import TrackedResource from ._models_py3 import UrlFileExtensionMatchConditionParameters from ._models_py3 import UrlFileNameMatchConditionParameters @@ -125,13 +201,49 @@ from ._models_py3 import UrlSigningAction from ._models_py3 import UrlSigningActionParameters from ._models_py3 import UrlSigningKey + from ._models_py3 import UrlSigningKeyParameters from ._models_py3 import UrlSigningParamIdentifier + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import UsagesListResult from ._models_py3 import UserManagedHttpsParameters from ._models_py3 import ValidateCustomDomainInput from ._models_py3 import ValidateCustomDomainOutput from ._models_py3 import ValidateProbeInput from ._models_py3 import ValidateProbeOutput + from ._models_py3 import ValidateSecretInput + from ._models_py3 import ValidateSecretOutput + from ._models_py3 import ValidationToken + from ._models_py3 import WafMetricsResponse + from ._models_py3 import WafMetricsResponseSeriesItem + from ._models_py3 import WafMetricsResponseSeriesPropertiesItemsItem + from ._models_py3 import WafRankingsResponse + from ._models_py3 import WafRankingsResponseDataItem except (SyntaxError, ImportError): + from ._models import AFDDomain # type: ignore + from ._models import AFDDomainHttpsParameters # type: ignore + from ._models import AFDDomainListResult # type: ignore + from ._models import AFDDomainProperties # type: ignore + from ._models import AFDDomainUpdateParameters # type: ignore + from ._models import AFDDomainUpdatePropertiesParameters # type: ignore + from ._models import AFDEndpoint # type: ignore + from ._models import AFDEndpointListResult # type: ignore + from ._models import AFDEndpointProperties # type: ignore + from ._models import AFDEndpointPropertiesUpdateParameters # type: ignore + from ._models import AFDEndpointUpdateParameters # type: ignore + from ._models import AFDOrigin # type: ignore + from ._models import AFDOriginGroup # type: ignore + from ._models import AFDOriginGroupListResult # type: ignore + from ._models import AFDOriginGroupProperties # type: ignore + from ._models import AFDOriginGroupUpdateParameters # type: ignore + from ._models import AFDOriginGroupUpdatePropertiesParameters # type: ignore + from ._models import AFDOriginListResult # type: ignore + from ._models import AFDOriginProperties # type: ignore + from ._models import AFDOriginUpdateParameters # type: ignore + from ._models import AFDOriginUpdatePropertiesParameters # type: ignore + from ._models import AFDStateProperties # type: ignore + from ._models import AfdErrorResponse # type: ignore + from ._models import AfdPurgeParameters # type: ignore from ._models import CacheExpirationActionParameters # type: ignore from ._models import CacheKeyQueryStringActionParameters # type: ignore from ._models import CdnCertificateSourceParameters # type: ignore @@ -140,9 +252,17 @@ from ._models import CdnWebApplicationFirewallPolicy # type: ignore from ._models import CdnWebApplicationFirewallPolicyList # type: ignore from ._models import CdnWebApplicationFirewallPolicyPatchParameters # type: ignore + from ._models import Certificate # type: ignore from ._models import CheckNameAvailabilityInput # type: ignore from ._models import CheckNameAvailabilityOutput # type: ignore from ._models import CidrIpAddress # type: ignore + from ._models import Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems # type: ignore + from ._models import Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems # type: ignore + from ._models import ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems # type: ignore + from ._models import CompressionSettings # type: ignore + from ._models import ContinentsResponse # type: ignore + from ._models import ContinentsResponseContinentsItem # type: ignore + from ._models import ContinentsResponseCountryOrRegionsItem # type: ignore from ._models import CookiesMatchConditionParameters # type: ignore from ._models import CustomDomain # type: ignore from ._models import CustomDomainHttpsParameters # type: ignore @@ -150,6 +270,8 @@ from ._models import CustomDomainParameters # type: ignore from ._models import CustomRule # type: ignore from ._models import CustomRuleList # type: ignore + from ._models import CustomerCertificate # type: ignore + from ._models import CustomerCertificateParameters # type: ignore from ._models import DeepCreatedOrigin # type: ignore from ._models import DeepCreatedOriginGroup # type: ignore from ._models import DeliveryRule # type: ignore @@ -173,6 +295,7 @@ from ._models import DeliveryRuleUrlFileExtensionCondition # type: ignore from ._models import DeliveryRuleUrlFileNameCondition # type: ignore from ._models import DeliveryRuleUrlPathCondition # type: ignore + from ._models import DomainValidationProperties # type: ignore from ._models import EdgeNode # type: ignore from ._models import EdgenodeResult # type: ignore from ._models import Endpoint # type: ignore @@ -192,7 +315,10 @@ from ._models import IsDeviceMatchConditionParameters # type: ignore from ._models import KeyVaultCertificateSourceParameters # type: ignore from ._models import KeyVaultSigningKeyParameters # type: ignore + from ._models import LoadBalancingSettingsParameters # type: ignore from ._models import LoadParameters # type: ignore + from ._models import ManagedCertificate # type: ignore + from ._models import ManagedCertificateParameters # type: ignore from ._models import ManagedRuleDefinition # type: ignore from ._models import ManagedRuleGroupDefinition # type: ignore from ._models import ManagedRuleGroupOverride # type: ignore @@ -202,12 +328,17 @@ from ._models import ManagedRuleSetDefinitionList # type: ignore from ._models import ManagedRuleSetList # type: ignore from ._models import MatchCondition # type: ignore + from ._models import MetricsResponse # type: ignore + from ._models import MetricsResponseSeriesItem # type: ignore + from ._models import MetricsResponseSeriesPropertiesItemsItem # type: ignore from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore from ._models import OperationsListResult # type: ignore from ._models import Origin # type: ignore from ._models import OriginGroup # type: ignore from ._models import OriginGroupListResult # type: ignore + from ._models import OriginGroupOverrideAction # type: ignore + from ._models import OriginGroupOverrideActionParameters # type: ignore from ._models import OriginGroupProperties # type: ignore from ._models import OriginGroupUpdateParameters # type: ignore from ._models import OriginGroupUpdatePropertiesParameters # type: ignore @@ -223,6 +354,10 @@ from ._models import ProxyResource # type: ignore from ._models import PurgeParameters # type: ignore from ._models import QueryStringMatchConditionParameters # type: ignore + from ._models import RankingsResponse # type: ignore + from ._models import RankingsResponseTablesItem # type: ignore + from ._models import RankingsResponseTablesPropertiesItemsItem # type: ignore + from ._models import RankingsResponseTablesPropertiesItemsMetricsItem # type: ignore from ._models import RateLimitRule # type: ignore from ._models import RateLimitRuleList # type: ignore from ._models import RemoteAddressMatchConditionParameters # type: ignore @@ -235,10 +370,39 @@ from ._models import ResourceReference # type: ignore from ._models import ResourceUsage # type: ignore from ._models import ResourceUsageListResult # type: ignore + from ._models import ResourcesResponse # type: ignore + from ._models import ResourcesResponseCustomDomainsItem # type: ignore + from ._models import ResourcesResponseEndpointsItem # type: ignore + from ._models import ResourcesResponseEndpointsPropertiesItemsItem # type: ignore from ._models import ResponseBasedOriginErrorDetectionParameters # type: ignore + from ._models import Route # type: ignore + from ._models import RouteListResult # type: ignore + from ._models import RouteProperties # type: ignore + from ._models import RouteUpdateParameters # type: ignore + from ._models import RouteUpdatePropertiesParameters # type: ignore + from ._models import Rule # type: ignore + from ._models import RuleListResult # type: ignore + from ._models import RuleProperties # type: ignore + from ._models import RuleSet # type: ignore + from ._models import RuleSetListResult # type: ignore + from ._models import RuleSetProperties # type: ignore + from ._models import RuleUpdateParameters # type: ignore + from ._models import RuleUpdatePropertiesParameters # type: ignore + from ._models import Secret # type: ignore + from ._models import SecretListResult # type: ignore + from ._models import SecretParameters # type: ignore + from ._models import SecretProperties # type: ignore + from ._models import SecurityPolicy # type: ignore + from ._models import SecurityPolicyListResult # type: ignore + from ._models import SecurityPolicyParameters # type: ignore + from ._models import SecurityPolicyProperties # type: ignore + from ._models import SecurityPolicyWebApplicationFirewallAssociation # type: ignore + from ._models import SecurityPolicyWebApplicationFirewallParameters # type: ignore + from ._models import SharedPrivateLinkResourceProperties # type: ignore from ._models import Sku # type: ignore from ._models import SsoUri # type: ignore from ._models import SupportedOptimizationTypesListResult # type: ignore + from ._models import SystemData # type: ignore from ._models import TrackedResource # type: ignore from ._models import UrlFileExtensionMatchConditionParameters # type: ignore from ._models import UrlFileNameMatchConditionParameters # type: ignore @@ -250,15 +414,31 @@ from ._models import UrlSigningAction # type: ignore from ._models import UrlSigningActionParameters # type: ignore from ._models import UrlSigningKey # type: ignore + from ._models import UrlSigningKeyParameters # type: ignore from ._models import UrlSigningParamIdentifier # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageName # type: ignore + from ._models import UsagesListResult # type: ignore from ._models import UserManagedHttpsParameters # type: ignore from ._models import ValidateCustomDomainInput # type: ignore from ._models import ValidateCustomDomainOutput # type: ignore from ._models import ValidateProbeInput # type: ignore from ._models import ValidateProbeOutput # type: ignore + from ._models import ValidateSecretInput # type: ignore + from ._models import ValidateSecretOutput # type: ignore + from ._models import ValidationToken # type: ignore + from ._models import WafMetricsResponse # type: ignore + from ._models import WafMetricsResponseSeriesItem # type: ignore + from ._models import WafMetricsResponseSeriesPropertiesItemsItem # type: ignore + from ._models import WafRankingsResponse # type: ignore + from ._models import WafRankingsResponseDataItem # type: ignore from ._cdn_management_client_enums import ( + AFDEndpointProtocols, ActionType, + AfdCertificateType, + AfdMinimumTlsVersion, + AfdProvisioningState, Algorithm, CacheBehavior, CacheType, @@ -270,18 +450,40 @@ CustomHttpsProvisioningSubstate, CustomRuleEnabledState, DeleteRule, - DeliveryRuleActionName, + DeliveryRuleActionEnum, + DeploymentStatus, DestinationProtocol, + DomainValidationState, + EnabledState, EndpointResourceState, - Enum16, + Enum31, + Enum35, + Enum37, + Enum38, + Enum39, + Enum40, + Enum42, + Enum43, + Enum44, + Enum47, + ForwardingProtocol, GeoFilterActions, + Get4ItemsItem, + Get5ItemsItem, + Get8ItemsItem, HeaderAction, HealthProbeRequestType, HttpVersionOperator, + HttpsRedirect, + IdentityType, IsDeviceMatchConditionParametersMatchValuesItem, IsDeviceOperator, + LinkToDefaultDomain, ManagedRuleEnabledState, + MatchProcessingBehavior, MatchVariable, + MetricsResponseGranularity, + MetricsResponseSeriesItemUnit, MinimumTlsVersion, Operator, OptimizationType, @@ -309,16 +511,47 @@ RequestSchemeMatchConditionParametersMatchValuesItem, RequestUriOperator, ResponseBasedDetectedErrorTypes, + SecretType, + SecurityPolicyType, + SharedPrivateLinkResourceStatus, SkuName, + Status, Transform, TransformType, UpdateRule, UrlFileExtensionOperator, UrlFileNameOperator, UrlPathOperator, + UsageUnit, + ValidateSecretType, + WafMetricsResponseGranularity, ) __all__ = [ + 'AFDDomain', + 'AFDDomainHttpsParameters', + 'AFDDomainListResult', + 'AFDDomainProperties', + 'AFDDomainUpdateParameters', + 'AFDDomainUpdatePropertiesParameters', + 'AFDEndpoint', + 'AFDEndpointListResult', + 'AFDEndpointProperties', + 'AFDEndpointPropertiesUpdateParameters', + 'AFDEndpointUpdateParameters', + 'AFDOrigin', + 'AFDOriginGroup', + 'AFDOriginGroupListResult', + 'AFDOriginGroupProperties', + 'AFDOriginGroupUpdateParameters', + 'AFDOriginGroupUpdatePropertiesParameters', + 'AFDOriginListResult', + 'AFDOriginProperties', + 'AFDOriginUpdateParameters', + 'AFDOriginUpdatePropertiesParameters', + 'AFDStateProperties', + 'AfdErrorResponse', + 'AfdPurgeParameters', 'CacheExpirationActionParameters', 'CacheKeyQueryStringActionParameters', 'CdnCertificateSourceParameters', @@ -327,9 +560,17 @@ 'CdnWebApplicationFirewallPolicy', 'CdnWebApplicationFirewallPolicyList', 'CdnWebApplicationFirewallPolicyPatchParameters', + 'Certificate', 'CheckNameAvailabilityInput', 'CheckNameAvailabilityOutput', 'CidrIpAddress', + 'Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems', + 'Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems', + 'ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems', + 'CompressionSettings', + 'ContinentsResponse', + 'ContinentsResponseContinentsItem', + 'ContinentsResponseCountryOrRegionsItem', 'CookiesMatchConditionParameters', 'CustomDomain', 'CustomDomainHttpsParameters', @@ -337,6 +578,8 @@ 'CustomDomainParameters', 'CustomRule', 'CustomRuleList', + 'CustomerCertificate', + 'CustomerCertificateParameters', 'DeepCreatedOrigin', 'DeepCreatedOriginGroup', 'DeliveryRule', @@ -360,6 +603,7 @@ 'DeliveryRuleUrlFileExtensionCondition', 'DeliveryRuleUrlFileNameCondition', 'DeliveryRuleUrlPathCondition', + 'DomainValidationProperties', 'EdgeNode', 'EdgenodeResult', 'Endpoint', @@ -379,7 +623,10 @@ 'IsDeviceMatchConditionParameters', 'KeyVaultCertificateSourceParameters', 'KeyVaultSigningKeyParameters', + 'LoadBalancingSettingsParameters', 'LoadParameters', + 'ManagedCertificate', + 'ManagedCertificateParameters', 'ManagedRuleDefinition', 'ManagedRuleGroupDefinition', 'ManagedRuleGroupOverride', @@ -389,12 +636,17 @@ 'ManagedRuleSetDefinitionList', 'ManagedRuleSetList', 'MatchCondition', + 'MetricsResponse', + 'MetricsResponseSeriesItem', + 'MetricsResponseSeriesPropertiesItemsItem', 'Operation', 'OperationDisplay', 'OperationsListResult', 'Origin', 'OriginGroup', 'OriginGroupListResult', + 'OriginGroupOverrideAction', + 'OriginGroupOverrideActionParameters', 'OriginGroupProperties', 'OriginGroupUpdateParameters', 'OriginGroupUpdatePropertiesParameters', @@ -410,6 +662,10 @@ 'ProxyResource', 'PurgeParameters', 'QueryStringMatchConditionParameters', + 'RankingsResponse', + 'RankingsResponseTablesItem', + 'RankingsResponseTablesPropertiesItemsItem', + 'RankingsResponseTablesPropertiesItemsMetricsItem', 'RateLimitRule', 'RateLimitRuleList', 'RemoteAddressMatchConditionParameters', @@ -422,10 +678,39 @@ 'ResourceReference', 'ResourceUsage', 'ResourceUsageListResult', + 'ResourcesResponse', + 'ResourcesResponseCustomDomainsItem', + 'ResourcesResponseEndpointsItem', + 'ResourcesResponseEndpointsPropertiesItemsItem', 'ResponseBasedOriginErrorDetectionParameters', + 'Route', + 'RouteListResult', + 'RouteProperties', + 'RouteUpdateParameters', + 'RouteUpdatePropertiesParameters', + 'Rule', + 'RuleListResult', + 'RuleProperties', + 'RuleSet', + 'RuleSetListResult', + 'RuleSetProperties', + 'RuleUpdateParameters', + 'RuleUpdatePropertiesParameters', + 'Secret', + 'SecretListResult', + 'SecretParameters', + 'SecretProperties', + 'SecurityPolicy', + 'SecurityPolicyListResult', + 'SecurityPolicyParameters', + 'SecurityPolicyProperties', + 'SecurityPolicyWebApplicationFirewallAssociation', + 'SecurityPolicyWebApplicationFirewallParameters', + 'SharedPrivateLinkResourceProperties', 'Sku', 'SsoUri', 'SupportedOptimizationTypesListResult', + 'SystemData', 'TrackedResource', 'UrlFileExtensionMatchConditionParameters', 'UrlFileNameMatchConditionParameters', @@ -437,13 +722,29 @@ 'UrlSigningAction', 'UrlSigningActionParameters', 'UrlSigningKey', + 'UrlSigningKeyParameters', 'UrlSigningParamIdentifier', + 'Usage', + 'UsageName', + 'UsagesListResult', 'UserManagedHttpsParameters', 'ValidateCustomDomainInput', 'ValidateCustomDomainOutput', 'ValidateProbeInput', 'ValidateProbeOutput', + 'ValidateSecretInput', + 'ValidateSecretOutput', + 'ValidationToken', + 'WafMetricsResponse', + 'WafMetricsResponseSeriesItem', + 'WafMetricsResponseSeriesPropertiesItemsItem', + 'WafRankingsResponse', + 'WafRankingsResponseDataItem', + 'AFDEndpointProtocols', 'ActionType', + 'AfdCertificateType', + 'AfdMinimumTlsVersion', + 'AfdProvisioningState', 'Algorithm', 'CacheBehavior', 'CacheType', @@ -455,18 +756,40 @@ 'CustomHttpsProvisioningSubstate', 'CustomRuleEnabledState', 'DeleteRule', - 'DeliveryRuleActionName', + 'DeliveryRuleActionEnum', + 'DeploymentStatus', 'DestinationProtocol', + 'DomainValidationState', + 'EnabledState', 'EndpointResourceState', - 'Enum16', + 'Enum31', + 'Enum35', + 'Enum37', + 'Enum38', + 'Enum39', + 'Enum40', + 'Enum42', + 'Enum43', + 'Enum44', + 'Enum47', + 'ForwardingProtocol', 'GeoFilterActions', + 'Get4ItemsItem', + 'Get5ItemsItem', + 'Get8ItemsItem', 'HeaderAction', 'HealthProbeRequestType', 'HttpVersionOperator', + 'HttpsRedirect', + 'IdentityType', 'IsDeviceMatchConditionParametersMatchValuesItem', 'IsDeviceOperator', + 'LinkToDefaultDomain', 'ManagedRuleEnabledState', + 'MatchProcessingBehavior', 'MatchVariable', + 'MetricsResponseGranularity', + 'MetricsResponseSeriesItemUnit', 'MinimumTlsVersion', 'Operator', 'OptimizationType', @@ -494,11 +817,18 @@ 'RequestSchemeMatchConditionParametersMatchValuesItem', 'RequestUriOperator', 'ResponseBasedDetectedErrorTypes', + 'SecretType', + 'SecurityPolicyType', + 'SharedPrivateLinkResourceStatus', 'SkuName', + 'Status', 'Transform', 'TransformType', 'UpdateRule', 'UrlFileExtensionOperator', 'UrlFileNameOperator', 'UrlPathOperator', + 'UsageUnit', + 'ValidateSecretType', + 'WafMetricsResponseGranularity', ] diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_cdn_management_client_enums.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_cdn_management_client_enums.py index 6700dd488a2e..b2b6e5d987b5 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_cdn_management_client_enums.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_cdn_management_client_enums.py @@ -35,6 +35,37 @@ class ActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): LOG = "Log" REDIRECT = "Redirect" +class AfdCertificateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines the source of the SSL certificate. + """ + + CUSTOMER_CERTIFICATE = "CustomerCertificate" + MANAGED_CERTIFICATE = "ManagedCertificate" + +class AFDEndpointProtocols(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Supported protocols for the customer's endpoint. + """ + + HTTP = "Http" + HTTPS = "Https" + +class AfdMinimumTlsVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """TLS protocol version that will be used for Https + """ + + TLS10 = "TLS10" + TLS12 = "TLS12" + +class AfdProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning status + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + UPDATING = "Updating" + DELETING = "Deleting" + CREATING = "Creating" + class Algorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Algorithm to use for URL signing """ @@ -82,6 +113,7 @@ class CookiesOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): LESS_THAN_OR_EQUAL = "LessThanOrEqual" GREATER_THAN = "GreaterThan" GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + REG_EX = "RegEx" class CustomDomainResourceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Resource status of the custom domain. @@ -131,7 +163,7 @@ class DeleteRule(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NO_ACTION = "NoAction" -class DeliveryRuleActionName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DeliveryRuleActionEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The name of the action for the delivery rule. """ @@ -142,6 +174,14 @@ class DeliveryRuleActionName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) URL_REDIRECT = "UrlRedirect" URL_REWRITE = "UrlRewrite" URL_SIGNING = "UrlSigning" + ORIGIN_GROUP_OVERRIDE = "OriginGroupOverride" + +class DeploymentStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NOT_STARTED = "NotStarted" + IN_PROGRESS = "InProgress" + SUCCEEDED = "Succeeded" + FAILED = "Failed" class DestinationProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Protocol to use for the redirect. The default value is MatchRequest @@ -151,6 +191,25 @@ class DestinationProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): HTTP = "Http" HTTPS = "Https" +class DomainValidationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by + step. DCV stands for DomainControlValidation. + """ + + UNKNOWN = "Unknown" + SUBMITTING = "Submitting" + PENDING = "Pending" + TIMED_OUT = "TimedOut" + PENDING_REVALIDATION = "PendingRevalidation" + APPROVED = "Approved" + +class EnabledState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled' + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + class EndpointResourceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Resource status of the endpoint. """ @@ -162,7 +221,69 @@ class EndpointResourceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) STOPPED = "Stopped" STOPPING = "Stopping" -class Enum16(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): +class Enum31(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PT5_M = "PT5M" + PT1_H = "PT1H" + P1_D = "P1D" + +class Enum35(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + URL = "url" + REFERRER = "referrer" + BROWSER = "browser" + USER_AGENT = "userAgent" + COUNTRY_OR_REGION = "countryOrRegion" + +class Enum37(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PT5_M = "PT5M" + PT1_H = "PT1H" + P1_D = "P1D" + +class Enum38(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + ALLOW = "allow" + BLOCK = "block" + LOG = "log" + REDIRECT = "redirect" + +class Enum39(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + HTTP_STATUS_CODE = "httpStatusCode" + CUSTOM_DOMAIN = "customDomain" + +class Enum40(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MANAGED = "managed" + CUSTOM = "custom" + BOT = "bot" + +class Enum42(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + ACTION = "action" + RULE_GROUP = "ruleGroup" + RULE_ID = "ruleId" + USER_AGENT = "userAgent" + CLIENT_IP = "clientIp" + URL = "url" + COUNTRY = "country" + RULE_TYPE = "ruleType" + +class Enum43(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + ALLOW = "allow" + BLOCK = "block" + LOG = "log" + REDIRECT = "redirect" + +class Enum44(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MANAGED = "managed" + CUSTOM = "custom" + BOT = "bot" + +class Enum47(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): """If the action type is block, this field defines the default customer overridable http response status code. """ @@ -173,6 +294,14 @@ class Enum16(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): FOUR_HUNDRED_SIX = 406 FOUR_HUNDRED_TWENTY_NINE = 429 +class ForwardingProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Protocol this rule will use when forwarding traffic to backends. + """ + + HTTP_ONLY = "HttpOnly" + HTTPS_ONLY = "HttpsOnly" + MATCH_REQUEST = "MatchRequest" + class GeoFilterActions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Action of the geo filter, i.e. allow or block access. """ @@ -180,6 +309,31 @@ class GeoFilterActions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): BLOCK = "Block" ALLOW = "Allow" +class Get4ItemsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + CLIENT_REQUEST_COUNT = "clientRequestCount" + CLIENT_REQUEST_TRAFFIC = "clientRequestTraffic" + CLIENT_REQUEST_BANDWIDTH = "clientRequestBandwidth" + ORIGIN_REQUEST_TRAFFIC = "originRequestTraffic" + ORIGIN_REQUEST_BANDWIDTH = "originRequestBandwidth" + TOTAL_LATENCY = "totalLatency" + +class Get5ItemsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + CLIENT_REQUEST_COUNT = "clientRequestCount" + CLIENT_REQUEST_TRAFFIC = "clientRequestTraffic" + CLIENT_REQUEST_BANDWIDTH = "clientRequestBandwidth" + ORIGIN_REQUEST_TRAFFIC = "originRequestTraffic" + ORIGIN_REQUEST_BANDWIDTH = "originRequestBandwidth" + +class Get8ItemsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + HTTP_STATUS_CODE = "httpStatusCode" + PROTOCOL = "protocol" + CACHE_STATUS = "cacheStatus" + COUNTRY = "country" + CUSTOM_DOMAIN = "customDomain" + class HeaderAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Action to perform """ @@ -196,12 +350,29 @@ class HealthProbeRequestType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) GET = "GET" HEAD = "HEAD" +class HttpsRedirect(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way + to set up this rule and it will be the first rule that gets executed. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + class HttpVersionOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Describes operator to be matched """ EQUAL = "Equal" +class IdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that creates/modifies resources + """ + + USER = "user" + APPLICATION = "application" + MANAGED_IDENTITY = "managedIdentity" + KEY = "key" + class IsDeviceMatchConditionParametersMatchValuesItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MOBILE = "Mobile" @@ -213,6 +384,13 @@ class IsDeviceOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): EQUAL = "Equal" +class LinkToDefaultDomain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """whether this route will be linked to the default endpoint domain. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + class ManagedRuleEnabledState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. @@ -221,6 +399,14 @@ class ManagedRuleEnabledState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum DISABLED = "Disabled" ENABLED = "Enabled" +class MatchProcessingBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """If this rule is a match should the rules engine continue running the remaining rules or stop. + If not present, defaults to Continue. + """ + + CONTINUE_ENUM = "Continue" + STOP = "Stop" + class MatchVariable(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The name of the condition for the delivery rule. """ @@ -242,6 +428,18 @@ class MatchVariable(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): REMOTE_ADDR = "RemoteAddr" SOCKET_ADDR = "SocketAddr" +class MetricsResponseGranularity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PT5_M = "PT5M" + PT1_H = "PT1H" + P1_D = "P1D" + +class MetricsResponseSeriesItemUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + COUNT = "count" + BYTES = "bytes" + BITS_PER_SECOND = "bitsPerSecond" + class MinimumTlsVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """TLS protocol version that will be used for Https """ @@ -340,6 +538,7 @@ class PostArgsOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): LESS_THAN_OR_EQUAL = "LessThanOrEqual" GREATER_THAN = "GreaterThan" GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + REG_EX = "RegEx" class PrivateEndpointStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The approval status for the connection to the Private Link @@ -416,6 +615,7 @@ class QueryStringOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): LESS_THAN_OR_EQUAL = "LessThanOrEqual" GREATER_THAN = "GreaterThan" GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + REG_EX = "RegEx" class RedirectType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The redirect type the rule will use when redirecting traffic. @@ -447,6 +647,7 @@ class RequestBodyOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): LESS_THAN_OR_EQUAL = "LessThanOrEqual" GREATER_THAN = "GreaterThan" GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + REG_EX = "RegEx" class RequestHeaderOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Describes operator to be matched @@ -461,6 +662,7 @@ class RequestHeaderOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) LESS_THAN_OR_EQUAL = "LessThanOrEqual" GREATER_THAN = "GreaterThan" GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + REG_EX = "RegEx" class RequestMethodMatchConditionParametersMatchValuesItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): @@ -496,6 +698,7 @@ class RequestUriOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): LESS_THAN_OR_EQUAL = "LessThanOrEqual" GREATER_THAN = "GreaterThan" GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + REG_EX = "RegEx" class ResponseBasedDetectedErrorTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Type of response errors for real user requests for which origin will be deemed unhealthy @@ -505,6 +708,31 @@ class ResponseBasedDetectedErrorTypes(with_metaclass(_CaseInsensitiveEnumMeta, s TCP_ERRORS_ONLY = "TcpErrorsOnly" TCP_AND_HTTP_ERRORS = "TcpAndHttpErrors" +class SecretType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the Secret to create. + """ + + URL_SIGNING_KEY = "UrlSigningKey" + CUSTOMER_CERTIFICATE = "CustomerCertificate" + MANAGED_CERTIFICATE = "ManagedCertificate" + +class SecurityPolicyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the Security policy to create. + """ + + WEB_APPLICATION_FIREWALL = "WebApplicationFirewall" + +class SharedPrivateLinkResourceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the shared private link resource. Can be Pending, Approved, Rejected, Disconnected, + or Timeout. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + TIMEOUT = "Timeout" + class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Name of the pricing tier. """ @@ -516,6 +744,22 @@ class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): STANDARD_CHINA_CDN = "Standard_ChinaCdn" STANDARD_MICROSOFT = "Standard_Microsoft" PREMIUM_CHINA_CDN = "Premium_ChinaCdn" + STANDARD_AZURE_FRONT_DOOR = "Standard_AzureFrontDoor" + PREMIUM_AZURE_FRONT_DOOR = "Premium_AzureFrontDoor" + STANDARD955_BAND_WIDTH_CHINA_CDN = "Standard_955BandWidth_ChinaCdn" + STANDARD_AVG_BAND_WIDTH_CHINA_CDN = "Standard_AvgBandWidth_ChinaCdn" + STANDARD_PLUS_CHINA_CDN = "StandardPlus_ChinaCdn" + STANDARD_PLUS955_BAND_WIDTH_CHINA_CDN = "StandardPlus_955BandWidth_ChinaCdn" + STANDARD_PLUS_AVG_BAND_WIDTH_CHINA_CDN = "StandardPlus_AvgBandWidth_ChinaCdn" + +class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The validation status. + """ + + VALID = "Valid" + INVALID = "Invalid" + ACCESS_DENIED = "AccessDenied" + CERTIFICATE_EXPIRED = "CertificateExpired" class Transform(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Describes what transforms are applied before matching @@ -554,6 +798,7 @@ class UrlFileExtensionOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enu LESS_THAN_OR_EQUAL = "LessThanOrEqual" GREATER_THAN = "GreaterThan" GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + REG_EX = "RegEx" class UrlFileNameOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Describes operator to be matched @@ -568,6 +813,7 @@ class UrlFileNameOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): LESS_THAN_OR_EQUAL = "LessThanOrEqual" GREATER_THAN = "GreaterThan" GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + REG_EX = "RegEx" class UrlPathOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Describes operator to be matched @@ -583,3 +829,24 @@ class UrlPathOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): GREATER_THAN = "GreaterThan" GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" WILDCARD = "Wildcard" + REG_EX = "RegEx" + +class UsageUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """An enum describing the unit of measurement. + """ + + COUNT = "Count" + +class ValidateSecretType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The secret type. + """ + + URL_SIGNING_KEY = "UrlSigningKey" + MANAGED_CERTIFICATE = "ManagedCertificate" + CUSTOMER_CERTIFICATE = "CustomerCertificate" + +class WafMetricsResponseGranularity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PT5_M = "PT5M" + PT1_H = "PT1H" + P1_D = "P1D" diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_models.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_models.py index a46616b84154..51fdc195b0f4 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_models.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_models.py @@ -10,263 +10,362 @@ import msrest.serialization -class CacheExpirationActionParameters(msrest.serialization.Model): - """Defines the parameters for the cache expiration action. +class Resource(msrest.serialization.Model): + """The core properties of ARM resources. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters". - :vartype odata_type: str - :param cache_behavior: Required. Caching behavior for the requests. Possible values include: - "BypassCache", "Override", "SetIfMissing". - :type cache_behavior: str or ~azure.mgmt.cdn.models.CacheBehavior - :param cache_type: Required. The level at which the content needs to be cached. Possible values - include: "All". - :type cache_type: str or ~azure.mgmt.cdn.models.CacheType - :param cache_duration: The duration for which the content needs to be cached. Allowed format is - [d.]hh:mm:ss. - :type cache_duration: str + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'cache_behavior': {'required': True}, - 'cache_type': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'cache_behavior': {'key': 'cacheBehavior', 'type': 'str'}, - 'cache_type': {'key': 'cacheType', 'type': 'str'}, - 'cache_duration': {'key': 'cacheDuration', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" - def __init__( self, **kwargs ): - super(CacheExpirationActionParameters, self).__init__(**kwargs) - self.cache_behavior = kwargs['cache_behavior'] - self.cache_type = kwargs['cache_type'] - self.cache_duration = kwargs.get('cache_duration', None) + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class CacheKeyQueryStringActionParameters(msrest.serialization.Model): - """Defines the parameters for the cache-key query string action. +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters". - :vartype odata_type: str - :param query_string_behavior: Required. Caching behavior for the requests. Possible values - include: "Include", "IncludeAll", "Exclude", "ExcludeAll". - :type query_string_behavior: str or ~azure.mgmt.cdn.models.QueryStringBehavior - :param query_parameters: query parameters to include or exclude (comma separated). - :type query_parameters: str + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'query_string_behavior': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'query_string_behavior': {'key': 'queryStringBehavior', 'type': 'str'}, - 'query_parameters': {'key': 'queryParameters', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters" - def __init__( self, **kwargs ): - super(CacheKeyQueryStringActionParameters, self).__init__(**kwargs) - self.query_string_behavior = kwargs['query_string_behavior'] - self.query_parameters = kwargs.get('query_parameters', None) + super(ProxyResource, self).__init__(**kwargs) + self.system_data = None -class CdnCertificateSourceParameters(msrest.serialization.Model): - """Defines the parameters for using CDN managed certificate for securing custom domain. +class AFDDomain(ProxyResource): + """Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param tls_settings: The configuration specifying how to enable HTTPS for the domain - using + AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl + uses AzureFrontDoor managed certificate by default. + :type tls_settings: ~azure.mgmt.cdn.models.AFDDomainHttpsParameters + :param azure_dns_zone: Resource reference to the Azure DNS zone. + :type azure_dns_zone: ~azure.mgmt.cdn.models.ResourceReference + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :ivar domain_validation_state: Provisioning substate shows the progress of custom HTTPS + enabling/disabling process step by step. DCV stands for DomainControlValidation. Possible + values include: "Unknown", "Submitting", "Pending", "TimedOut", "PendingRevalidation", + "Approved". + :vartype domain_validation_state: str or ~azure.mgmt.cdn.models.DomainValidationState + :param host_name: The host name of the domain. Must be a domain name. + :type host_name: str + :ivar validation_properties: Values the customer needs to validate domain ownership. + :vartype validation_properties: ~azure.mgmt.cdn.models.DomainValidationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + 'domain_validation_state': {'readonly': True}, + 'validation_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tls_settings': {'key': 'properties.tlsSettings', 'type': 'AFDDomainHttpsParameters'}, + 'azure_dns_zone': {'key': 'properties.azureDnsZone', 'type': 'ResourceReference'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + 'domain_validation_state': {'key': 'properties.domainValidationState', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'validation_properties': {'key': 'properties.validationProperties', 'type': 'DomainValidationProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AFDDomain, self).__init__(**kwargs) + self.tls_settings = kwargs.get('tls_settings', None) + self.azure_dns_zone = kwargs.get('azure_dns_zone', None) + self.provisioning_state = None + self.deployment_status = None + self.domain_validation_state = None + self.host_name = kwargs.get('host_name', None) + self.validation_properties = None + + +class AFDDomainHttpsParameters(msrest.serialization.Model): + """The JSON object that contains the properties to secure a domain. + All required parameters must be populated in order to send to Azure. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters". - :vartype odata_type: str - :param certificate_type: Required. Type of certificate used. Possible values include: "Shared", - "Dedicated". - :type certificate_type: str or ~azure.mgmt.cdn.models.CertificateType + :param certificate_type: Required. Defines the source of the SSL certificate. Possible values + include: "CustomerCertificate", "ManagedCertificate". + :type certificate_type: str or ~azure.mgmt.cdn.models.AfdCertificateType + :param minimum_tls_version: TLS protocol version that will be used for Https. Possible values + include: "TLS10", "TLS12". + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.AfdMinimumTlsVersion + :param secret: Resource reference to the secret. ie. subs/rg/profile/secret. + :type secret: ~azure.mgmt.cdn.models.ResourceReference """ _validation = { - 'odata_type': {'required': True, 'constant': True}, 'certificate_type': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, 'certificate_type': {'key': 'certificateType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'ResourceReference'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters" - def __init__( self, **kwargs ): - super(CdnCertificateSourceParameters, self).__init__(**kwargs) + super(AFDDomainHttpsParameters, self).__init__(**kwargs) self.certificate_type = kwargs['certificate_type'] + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + self.secret = kwargs.get('secret', None) -class CdnEndpoint(msrest.serialization.Model): - """Defines the ARM Resource ID for the linked endpoints. +class AFDDomainListResult(msrest.serialization.Model): + """Result of the request to list domains. It contains a list of domain objects and a URL link to get the next set of results. - :param id: ARM Resource ID string. - :type id: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of AzureFrontDoor domains within a profile. + :vartype value: list[~azure.mgmt.cdn.models.AFDDomain] + :param next_link: URL to get the next set of domain objects if there are any. + :type next_link: str """ + _validation = { + 'value': {'readonly': True}, + } + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[AFDDomain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CdnEndpoint, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - + super(AFDDomainListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) -class CustomDomainHttpsParameters(msrest.serialization.Model): - """The JSON object that contains the properties to secure a custom domain. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: UserManagedHttpsParameters, CdnManagedHttpsParameters. +class AFDStateProperties(msrest.serialization.Model): + """The tracking states for afd resources. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param certificate_source: Required. Defines the source of the SSL certificate.Constant filled - by server. Possible values include: "AzureKeyVault", "Cdn". - :type certificate_source: str or ~azure.mgmt.cdn.models.CertificateSource - :param protocol_type: Required. Defines the TLS extension protocol that is used for secure - delivery. Possible values include: "ServerNameIndication", "IPBased". - :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType - :param minimum_tls_version: TLS protocol version that will be used for Https. Possible values - include: "None", "TLS10", "TLS12". - :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'certificate_source': {'required': True}, - 'protocol_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, - 'protocol_type': {'key': 'protocolType', 'type': 'str'}, - 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } - _subtype_map = { - 'certificate_source': {'AzureKeyVault': 'UserManagedHttpsParameters', 'Cdn': 'CdnManagedHttpsParameters'} + def __init__( + self, + **kwargs + ): + super(AFDStateProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_status = None + + +class AFDDomainUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the domain to create. + + :param tls_settings: The configuration specifying how to enable HTTPS for the domain - using + AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl + uses AzureFrontDoor managed certificate by default. + :type tls_settings: ~azure.mgmt.cdn.models.AFDDomainHttpsParameters + :param azure_dns_zone: Resource reference to the Azure DNS zone. + :type azure_dns_zone: ~azure.mgmt.cdn.models.ResourceReference + """ + + _attribute_map = { + 'tls_settings': {'key': 'tlsSettings', 'type': 'AFDDomainHttpsParameters'}, + 'azure_dns_zone': {'key': 'azureDnsZone', 'type': 'ResourceReference'}, } def __init__( self, **kwargs ): - super(CustomDomainHttpsParameters, self).__init__(**kwargs) - self.certificate_source = None # type: Optional[str] - self.protocol_type = kwargs['protocol_type'] - self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + super(AFDDomainUpdatePropertiesParameters, self).__init__(**kwargs) + self.tls_settings = kwargs.get('tls_settings', None) + self.azure_dns_zone = kwargs.get('azure_dns_zone', None) -class CdnManagedHttpsParameters(CustomDomainHttpsParameters): - """Defines the certificate source parameters using CDN managed certificate for enabling SSL. +class AFDDomainProperties(AFDDomainUpdatePropertiesParameters, AFDStateProperties): + """The JSON object that contains the properties of the domain to create. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param certificate_source: Required. Defines the source of the SSL certificate.Constant filled - by server. Possible values include: "AzureKeyVault", "Cdn". - :type certificate_source: str or ~azure.mgmt.cdn.models.CertificateSource - :param protocol_type: Required. Defines the TLS extension protocol that is used for secure - delivery. Possible values include: "ServerNameIndication", "IPBased". - :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType - :param minimum_tls_version: TLS protocol version that will be used for Https. Possible values - include: "None", "TLS10", "TLS12". - :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion - :param certificate_source_parameters: Required. Defines the certificate source parameters using - CDN managed certificate for enabling SSL. - :type certificate_source_parameters: ~azure.mgmt.cdn.models.CdnCertificateSourceParameters + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :param tls_settings: The configuration specifying how to enable HTTPS for the domain - using + AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl + uses AzureFrontDoor managed certificate by default. + :type tls_settings: ~azure.mgmt.cdn.models.AFDDomainHttpsParameters + :param azure_dns_zone: Resource reference to the Azure DNS zone. + :type azure_dns_zone: ~azure.mgmt.cdn.models.ResourceReference + :ivar domain_validation_state: Provisioning substate shows the progress of custom HTTPS + enabling/disabling process step by step. DCV stands for DomainControlValidation. Possible + values include: "Unknown", "Submitting", "Pending", "TimedOut", "PendingRevalidation", + "Approved". + :vartype domain_validation_state: str or ~azure.mgmt.cdn.models.DomainValidationState + :param host_name: Required. The host name of the domain. Must be a domain name. + :type host_name: str + :ivar validation_properties: Values the customer needs to validate domain ownership. + :vartype validation_properties: ~azure.mgmt.cdn.models.DomainValidationProperties """ _validation = { - 'certificate_source': {'required': True}, - 'protocol_type': {'required': True}, - 'certificate_source_parameters': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + 'domain_validation_state': {'readonly': True}, + 'host_name': {'required': True}, + 'validation_properties': {'readonly': True}, } _attribute_map = { - 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, - 'protocol_type': {'key': 'protocolType', 'type': 'str'}, - 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, - 'certificate_source_parameters': {'key': 'certificateSourceParameters', 'type': 'CdnCertificateSourceParameters'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, + 'tls_settings': {'key': 'tlsSettings', 'type': 'AFDDomainHttpsParameters'}, + 'azure_dns_zone': {'key': 'azureDnsZone', 'type': 'ResourceReference'}, + 'domain_validation_state': {'key': 'domainValidationState', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'validation_properties': {'key': 'validationProperties', 'type': 'DomainValidationProperties'}, } def __init__( self, **kwargs ): - super(CdnManagedHttpsParameters, self).__init__(**kwargs) - self.certificate_source = 'Cdn' # type: str - self.certificate_source_parameters = kwargs['certificate_source_parameters'] - + super(AFDDomainProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_status = None + self.domain_validation_state = None + self.host_name = kwargs['host_name'] + self.validation_properties = None + self.tls_settings = kwargs.get('tls_settings', None) + self.azure_dns_zone = kwargs.get('azure_dns_zone', None) + self.domain_validation_state = None + self.host_name = kwargs['host_name'] + self.validation_properties = None -class Resource(msrest.serialization.Model): - """The core properties of ARM resources. - Variables are only populated by the server, and will be ignored when sending a request. +class AFDDomainUpdateParameters(msrest.serialization.Model): + """The domain JSON object required for domain creation or update. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str + :param tls_settings: The configuration specifying how to enable HTTPS for the domain - using + AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl + uses AzureFrontDoor managed certificate by default. + :type tls_settings: ~azure.mgmt.cdn.models.AFDDomainHttpsParameters + :param azure_dns_zone: Resource reference to the Azure DNS zone. + :type azure_dns_zone: ~azure.mgmt.cdn.models.ResourceReference """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'tls_settings': {'key': 'properties.tlsSettings', 'type': 'AFDDomainHttpsParameters'}, + 'azure_dns_zone': {'key': 'properties.azureDnsZone', 'type': 'ResourceReference'}, } def __init__( self, **kwargs ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(AFDDomainUpdateParameters, self).__init__(**kwargs) + self.tls_settings = kwargs.get('tls_settings', None) + self.azure_dns_zone = kwargs.get('azure_dns_zone', None) class TrackedResource(Resource): @@ -286,6 +385,8 @@ class TrackedResource(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData """ _validation = { @@ -293,6 +394,7 @@ class TrackedResource(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -301,6 +403,7 @@ class TrackedResource(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -310,10 +413,11 @@ def __init__( super(TrackedResource, self).__init__(**kwargs) self.location = kwargs['location'] self.tags = kwargs.get('tags', None) + self.system_data = None -class CdnWebApplicationFirewallPolicy(TrackedResource): - """Defines web application firewall policy for Azure CDN. +class AFDEndpoint(TrackedResource): + """CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content caching and delivery behavior. The AzureFrontDoor endpoint uses the URL format :code:``.azureedge.net. Variables are only populated by the server, and will be ignored when sending a request. @@ -329,28 +433,23 @@ class CdnWebApplicationFirewallPolicy(TrackedResource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param sku: Required. The pricing tier (defines a CDN provider, feature list and rate) of the - CdnWebApplicationFirewallPolicy. - :type sku: ~azure.mgmt.cdn.models.Sku - :param policy_settings: Describes policySettings for policy. - :type policy_settings: ~azure.mgmt.cdn.models.PolicySettings - :param rate_limit_rules: Describes rate limit rules inside the policy. - :type rate_limit_rules: ~azure.mgmt.cdn.models.RateLimitRuleList - :param custom_rules: Describes custom rules inside the policy. - :type custom_rules: ~azure.mgmt.cdn.models.CustomRuleList - :param managed_rules: Describes managed rules inside the policy. - :type managed_rules: ~azure.mgmt.cdn.models.ManagedRuleSetList - :ivar endpoint_links: Describes Azure CDN endpoints associated with this Web Application - Firewall policy. - :vartype endpoint_links: list[~azure.mgmt.cdn.models.CdnEndpoint] - :ivar provisioning_state: Provisioning state of the WebApplicationFirewallPolicy. Possible - values include: "Creating", "Succeeded", "Failed". - :vartype provisioning_state: str or ~azure.mgmt.cdn.models.ProvisioningState - :ivar resource_state: Resource status of the policy. Possible values include: "Creating", - "Enabling", "Enabled", "Disabling", "Disabled", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.PolicyResourceState + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param origin_response_timeout_seconds: Send and receive timeout on forwarding request to the + origin. When timeout is reached, the request fails and returns. + :type origin_response_timeout_seconds: int + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + contoso.azureedge.net. + :vartype host_name: str """ _validation = { @@ -358,10 +457,11 @@ class CdnWebApplicationFirewallPolicy(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'sku': {'required': True}, - 'endpoint_links': {'readonly': True}, + 'system_data': {'readonly': True}, + 'origin_response_timeout_seconds': {'minimum': 16}, 'provisioning_state': {'readonly': True}, - 'resource_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + 'host_name': {'readonly': True}, } _attribute_map = { @@ -370,42 +470,34 @@ class CdnWebApplicationFirewallPolicy(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'policy_settings': {'key': 'properties.policySettings', 'type': 'PolicySettings'}, - 'rate_limit_rules': {'key': 'properties.rateLimitRules', 'type': 'RateLimitRuleList'}, - 'custom_rules': {'key': 'properties.customRules', 'type': 'CustomRuleList'}, - 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRuleSetList'}, - 'endpoint_links': {'key': 'properties.endpointLinks', 'type': '[CdnEndpoint]'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'origin_response_timeout_seconds': {'key': 'properties.originResponseTimeoutSeconds', 'type': 'int'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CdnWebApplicationFirewallPolicy, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.sku = kwargs['sku'] - self.policy_settings = kwargs.get('policy_settings', None) - self.rate_limit_rules = kwargs.get('rate_limit_rules', None) - self.custom_rules = kwargs.get('custom_rules', None) - self.managed_rules = kwargs.get('managed_rules', None) - self.endpoint_links = None + super(AFDEndpoint, self).__init__(**kwargs) + self.origin_response_timeout_seconds = kwargs.get('origin_response_timeout_seconds', None) + self.enabled_state = kwargs.get('enabled_state', None) self.provisioning_state = None - self.resource_state = None + self.deployment_status = None + self.host_name = None -class CdnWebApplicationFirewallPolicyList(msrest.serialization.Model): - """Defines a list of WebApplicationFirewallPolicies for Azure CDN. It contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. +class AFDEndpointListResult(msrest.serialization.Model): + """Result of the request to list endpoints. It contains a list of endpoint objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Azure CDN WebApplicationFirewallPolicies within a resource group. - :vartype value: list[~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicy] - :param next_link: URL to get the next set of WebApplicationFirewallPolicy objects if there are - any. + :ivar value: List of AzureFrontDoor endpoints within a profile. + :vartype value: list[~azure.mgmt.cdn.models.AFDEndpoint] + :param next_link: URL to get the next set of endpoint objects if there is any. :type next_link: str """ @@ -414,7 +506,7 @@ class CdnWebApplicationFirewallPolicyList(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[CdnWebApplicationFirewallPolicy]'}, + 'value': {'key': 'value', 'type': '[AFDEndpoint]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -422,176 +514,144 @@ def __init__( self, **kwargs ): - super(CdnWebApplicationFirewallPolicyList, self).__init__(**kwargs) + super(AFDEndpointListResult, self).__init__(**kwargs) self.value = None self.next_link = kwargs.get('next_link', None) -class CdnWebApplicationFirewallPolicyPatchParameters(msrest.serialization.Model): - """Properties required to update a CdnWebApplicationFirewallPolicy. - - :param tags: A set of tags. CdnWebApplicationFirewallPolicy tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(CdnWebApplicationFirewallPolicyPatchParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class CheckNameAvailabilityInput(msrest.serialization.Model): - """Input of CheckNameAvailability API. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. +class AFDEndpointPropertiesUpdateParameters(msrest.serialization.Model): + """The JSON object containing endpoint update parameters. - :param name: Required. The resource name to validate. - :type name: str - :ivar type: Required. The type of the resource whose name is to be validated. Default value: - "Microsoft.Cdn/Profiles/Endpoints". - :vartype type: str + :param origin_response_timeout_seconds: Send and receive timeout on forwarding request to the + origin. When timeout is reached, the request fails and returns. + :type origin_response_timeout_seconds: int + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, + 'origin_response_timeout_seconds': {'minimum': 16}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'origin_response_timeout_seconds': {'key': 'originResponseTimeoutSeconds', 'type': 'int'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, } - type = "Microsoft.Cdn/Profiles/Endpoints" - def __init__( self, **kwargs ): - super(CheckNameAvailabilityInput, self).__init__(**kwargs) - self.name = kwargs['name'] + super(AFDEndpointPropertiesUpdateParameters, self).__init__(**kwargs) + self.origin_response_timeout_seconds = kwargs.get('origin_response_timeout_seconds', None) + self.enabled_state = kwargs.get('enabled_state', None) -class CheckNameAvailabilityOutput(msrest.serialization.Model): - """Output of check name availability API. +class AFDEndpointProperties(AFDStateProperties, AFDEndpointPropertiesUpdateParameters): + """The JSON object that contains the properties required to create an endpoint. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name_available: Indicates whether the name is available. - :vartype name_available: bool - :ivar reason: The reason why the name is not available. - :vartype reason: str - :ivar message: The detailed error message describing why the name is not available. - :vartype message: str + :param origin_response_timeout_seconds: Send and receive timeout on forwarding request to the + origin. When timeout is reached, the request fails and returns. + :type origin_response_timeout_seconds: int + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + contoso.azureedge.net. + :vartype host_name: str """ _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, + 'origin_response_timeout_seconds': {'minimum': 16}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + 'host_name': {'readonly': True}, } _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'origin_response_timeout_seconds': {'key': 'originResponseTimeoutSeconds', 'type': 'int'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CheckNameAvailabilityOutput, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None + super(AFDEndpointProperties, self).__init__(**kwargs) + self.origin_response_timeout_seconds = kwargs.get('origin_response_timeout_seconds', None) + self.enabled_state = kwargs.get('enabled_state', None) + self.host_name = None + self.provisioning_state = None + self.deployment_status = None + self.host_name = None -class CidrIpAddress(msrest.serialization.Model): - """CIDR Ip address. +class AFDEndpointUpdateParameters(msrest.serialization.Model): + """Properties required to create or update an endpoint. - :param base_ip_address: Ip address itself. - :type base_ip_address: str - :param prefix_length: The length of the prefix of the ip address. - :type prefix_length: int + :param tags: A set of tags. Endpoint tags. + :type tags: dict[str, str] + :param origin_response_timeout_seconds: Send and receive timeout on forwarding request to the + origin. When timeout is reached, the request fails and returns. + :type origin_response_timeout_seconds: int + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ + _validation = { + 'origin_response_timeout_seconds': {'minimum': 16}, + } + _attribute_map = { - 'base_ip_address': {'key': 'baseIpAddress', 'type': 'str'}, - 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'origin_response_timeout_seconds': {'key': 'properties.originResponseTimeoutSeconds', 'type': 'int'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CidrIpAddress, self).__init__(**kwargs) - self.base_ip_address = kwargs.get('base_ip_address', None) - self.prefix_length = kwargs.get('prefix_length', None) - - -class CookiesMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for Cookies match conditions. + super(AFDEndpointUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.origin_response_timeout_seconds = kwargs.get('origin_response_timeout_seconds', None) + self.enabled_state = kwargs.get('enabled_state', None) - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. +class AfdErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters". - :vartype odata_type: str - :param selector: Name of Cookies to be matched. - :type selector: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.CookiesOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :param error: The error object. + :type error: ~azure.mgmt.cdn.models.ErrorResponse """ - _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'selector': {'key': 'selector', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters" - def __init__( self, **kwargs ): - super(CookiesMatchConditionParameters, self).__init__(**kwargs) - self.selector = kwargs.get('selector', None) - self.operator = kwargs['operator'] - self.negate_condition = kwargs.get('negate_condition', None) - self.match_values = kwargs.get('match_values', None) - self.transforms = kwargs.get('transforms', None) + super(AfdErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) -class CustomDomain(Resource): - """Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. +class AFDOrigin(ProxyResource): + """CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the configured origins. Variables are only populated by the server, and will be ignored when sending a request. @@ -601,74 +661,177 @@ class CustomDomain(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param host_name: The host name of the custom domain. Must be a domain name. + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param azure_origin: Resource reference to the Azure origin resource. + :type azure_origin: ~azure.mgmt.cdn.models.ResourceReference + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. :type host_name: str - :ivar resource_state: Resource status of the custom domain. Possible values include: - "Creating", "Active", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.CustomDomainResourceState - :ivar custom_https_provisioning_state: Provisioning status of Custom Https of the custom - domain. Possible values include: "Enabling", "Enabled", "Disabling", "Disabled", "Failed". - :vartype custom_https_provisioning_state: str or - ~azure.mgmt.cdn.models.CustomHttpsProvisioningState - :ivar custom_https_provisioning_substate: Provisioning substate shows the progress of custom - HTTPS enabling/disabling process step by step. Possible values include: - "SubmittingDomainControlValidationRequest", "PendingDomainControlValidationREquestApproval", - "DomainControlValidationRequestApproved", "DomainControlValidationRequestRejected", - "DomainControlValidationRequestTimedOut", "IssuingCertificate", "DeployingCertificate", - "CertificateDeployed", "DeletingCertificate", "CertificateDeleted". - :vartype custom_https_provisioning_substate: str or - ~azure.mgmt.cdn.models.CustomHttpsProvisioningSubstate - :param validation_data: Special validation or data may be required when delivering CDN to some - regions due to local compliance reasons. E.g. ICP license number of a custom domain is required - to deliver content in China. - :type validation_data: str - :ivar provisioning_state: Provisioning status of the custom domain. - :vartype provisioning_state: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param shared_private_link_resource: The properties of the private link resource for private + origin. + :type shared_private_link_resource: object + :param enabled_state: Whether to enable health probes to be made against backends defined under + backendPools. Health probes can only be disabled if there is a single enabled backend in single + enabled backend pool. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'resource_state': {'readonly': True}, - 'custom_https_provisioning_state': {'readonly': True}, - 'custom_https_provisioning_substate': {'readonly': True}, + 'system_data': {'readonly': True}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'azure_origin': {'key': 'properties.azureOrigin', 'type': 'ResourceReference'}, 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, - 'custom_https_provisioning_state': {'key': 'properties.customHttpsProvisioningState', 'type': 'str'}, - 'custom_https_provisioning_substate': {'key': 'properties.customHttpsProvisioningSubstate', 'type': 'str'}, - 'validation_data': {'key': 'properties.validationData', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'weight': {'key': 'properties.weight', 'type': 'int'}, + 'shared_private_link_resource': {'key': 'properties.sharedPrivateLinkResource', 'type': 'object'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CustomDomain, self).__init__(**kwargs) + super(AFDOrigin, self).__init__(**kwargs) + self.azure_origin = kwargs.get('azure_origin', None) self.host_name = kwargs.get('host_name', None) - self.resource_state = None - self.custom_https_provisioning_state = None - self.custom_https_provisioning_substate = None - self.validation_data = kwargs.get('validation_data', None) + self.http_port = kwargs.get('http_port', None) + self.https_port = kwargs.get('https_port', None) + self.origin_host_header = kwargs.get('origin_host_header', None) + self.priority = kwargs.get('priority', None) + self.weight = kwargs.get('weight', None) + self.shared_private_link_resource = kwargs.get('shared_private_link_resource', None) + self.enabled_state = kwargs.get('enabled_state', None) self.provisioning_state = None + self.deployment_status = None -class CustomDomainListResult(msrest.serialization.Model): - """Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the next set of results. +class AFDOriginGroup(ProxyResource): + """AFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of CDN CustomDomains within an endpoint. - :vartype value: list[~azure.mgmt.cdn.models.CustomDomain] - :param next_link: URL to get the next set of custom domain objects if there are any. + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param load_balancing_settings: Load balancing settings for a backend pool. + :type load_balancing_settings: ~azure.mgmt.cdn.models.LoadBalancingSettingsParameters + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_afd_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_afd_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param session_affinity_state: Whether to allow session affinity on this host. Valid options + are 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". + :type session_affinity_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'load_balancing_settings': {'key': 'properties.loadBalancingSettings', 'type': 'LoadBalancingSettingsParameters'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_afd_origin_error_detection_settings': {'key': 'properties.responseBasedAfdOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'session_affinity_state': {'key': 'properties.sessionAffinityState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AFDOriginGroup, self).__init__(**kwargs) + self.load_balancing_settings = kwargs.get('load_balancing_settings', None) + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) + self.response_based_afd_origin_error_detection_settings = kwargs.get('response_based_afd_origin_error_detection_settings', None) + self.session_affinity_state = kwargs.get('session_affinity_state', None) + self.provisioning_state = None + self.deployment_status = None + + +class AFDOriginGroupListResult(msrest.serialization.Model): + """Result of the request to list origin groups. It contains a list of origin groups objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of CDN origin groups within an endpoint. + :vartype value: list[~azure.mgmt.cdn.models.AFDOriginGroup] + :param next_link: URL to get the next set of origin objects if there are any. :type next_link: str """ @@ -677,7 +840,7 @@ class CustomDomainListResult(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[CustomDomain]'}, + 'value': {'key': 'value', 'type': '[AFDOriginGroup]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -685,105 +848,199 @@ def __init__( self, **kwargs ): - super(CustomDomainListResult, self).__init__(**kwargs) + super(AFDOriginGroupListResult, self).__init__(**kwargs) self.value = None self.next_link = kwargs.get('next_link', None) -class CustomDomainParameters(msrest.serialization.Model): - """The customDomain JSON object required for custom domain creation or update. +class AFDOriginGroupUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the origin group. - :param host_name: The host name of the custom domain. Must be a domain name. - :type host_name: str + :param load_balancing_settings: Load balancing settings for a backend pool. + :type load_balancing_settings: ~azure.mgmt.cdn.models.LoadBalancingSettingsParameters + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_afd_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_afd_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param session_affinity_state: Whether to allow session affinity on this host. Valid options + are 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". + :type session_affinity_state: str or ~azure.mgmt.cdn.models.EnabledState """ + _validation = { + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + } + _attribute_map = { - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'load_balancing_settings': {'key': 'loadBalancingSettings', 'type': 'LoadBalancingSettingsParameters'}, + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_afd_origin_error_detection_settings': {'key': 'responseBasedAfdOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'session_affinity_state': {'key': 'sessionAffinityState', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CustomDomainParameters, self).__init__(**kwargs) - self.host_name = kwargs.get('host_name', None) + super(AFDOriginGroupUpdatePropertiesParameters, self).__init__(**kwargs) + self.load_balancing_settings = kwargs.get('load_balancing_settings', None) + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) + self.response_based_afd_origin_error_detection_settings = kwargs.get('response_based_afd_origin_error_detection_settings', None) + self.session_affinity_state = kwargs.get('session_affinity_state', None) -class CustomRule(msrest.serialization.Model): - """Defines the common attributes for a custom rule that can be included in a waf policy. +class AFDOriginGroupProperties(AFDStateProperties, AFDOriginGroupUpdatePropertiesParameters): + """The JSON object that contains the properties of the origin group. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. Defines the name of the custom rule. - :type name: str - :param enabled_state: Describes if the custom rule is in enabled or disabled state. Defaults to - Enabled if not specified. Possible values include: "Disabled", "Enabled". - :type enabled_state: str or ~azure.mgmt.cdn.models.CustomRuleEnabledState - :param priority: Required. Defines in what order this rule be evaluated in the overall list of - custom rules. - :type priority: int - :param match_conditions: Required. List of match conditions. - :type match_conditions: list[~azure.mgmt.cdn.models.MatchCondition] - :param action: Required. Describes what action to be applied when rule matches. Possible values - include: "Allow", "Block", "Log", "Redirect". - :type action: str or ~azure.mgmt.cdn.models.ActionType + :param load_balancing_settings: Load balancing settings for a backend pool. + :type load_balancing_settings: ~azure.mgmt.cdn.models.LoadBalancingSettingsParameters + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_afd_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_afd_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param session_affinity_state: Whether to allow session affinity on this host. Valid options + are 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". + :type session_affinity_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'name': {'required': True}, - 'priority': {'required': True, 'maximum': 1000, 'minimum': 0}, - 'match_conditions': {'required': True}, - 'action': {'required': True}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'enabled_state': {'key': 'enabledState', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, - 'action': {'key': 'action', 'type': 'str'}, + 'load_balancing_settings': {'key': 'loadBalancingSettings', 'type': 'LoadBalancingSettingsParameters'}, + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_afd_origin_error_detection_settings': {'key': 'responseBasedAfdOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'session_affinity_state': {'key': 'sessionAffinityState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CustomRule, self).__init__(**kwargs) - self.name = kwargs['name'] - self.enabled_state = kwargs.get('enabled_state', None) - self.priority = kwargs['priority'] - self.match_conditions = kwargs['match_conditions'] - self.action = kwargs['action'] + super(AFDOriginGroupProperties, self).__init__(**kwargs) + self.load_balancing_settings = kwargs.get('load_balancing_settings', None) + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) + self.response_based_afd_origin_error_detection_settings = kwargs.get('response_based_afd_origin_error_detection_settings', None) + self.session_affinity_state = kwargs.get('session_affinity_state', None) + self.provisioning_state = None + self.deployment_status = None -class CustomRuleList(msrest.serialization.Model): - """Defines contents of custom rules. +class AFDOriginGroupUpdateParameters(msrest.serialization.Model): + """AFDOrigin group properties needed for origin group creation or update. - :param rules: List of rules. - :type rules: list[~azure.mgmt.cdn.models.CustomRule] + :param load_balancing_settings: Load balancing settings for a backend pool. + :type load_balancing_settings: ~azure.mgmt.cdn.models.LoadBalancingSettingsParameters + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_afd_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_afd_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param session_affinity_state: Whether to allow session affinity on this host. Valid options + are 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". + :type session_affinity_state: str or ~azure.mgmt.cdn.models.EnabledState """ + _validation = { + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + } + _attribute_map = { - 'rules': {'key': 'rules', 'type': '[CustomRule]'}, + 'load_balancing_settings': {'key': 'properties.loadBalancingSettings', 'type': 'LoadBalancingSettingsParameters'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_afd_origin_error_detection_settings': {'key': 'properties.responseBasedAfdOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'session_affinity_state': {'key': 'properties.sessionAffinityState', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CustomRuleList, self).__init__(**kwargs) - self.rules = kwargs.get('rules', None) + super(AFDOriginGroupUpdateParameters, self).__init__(**kwargs) + self.load_balancing_settings = kwargs.get('load_balancing_settings', None) + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) + self.response_based_afd_origin_error_detection_settings = kwargs.get('response_based_afd_origin_error_detection_settings', None) + self.session_affinity_state = kwargs.get('session_affinity_state', None) -class DeepCreatedOrigin(msrest.serialization.Model): - """The main origin of CDN content which is added when creating a CDN endpoint. +class AFDOriginListResult(msrest.serialization.Model): + """Result of the request to list origins. It contains a list of origin objects and a URL link to get the next set of results. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. Origin name which must be unique within the endpoint. - :type name: str - :param host_name: The address of the origin. It can be a domain name, IPv4 address, or IPv6 - address. This should be unique across all origins in an endpoint. + :ivar value: List of CDN origins within an endpoint. + :vartype value: list[~azure.mgmt.cdn.models.AFDOrigin] + :param next_link: URL to get the next set of origin objects if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AFDOrigin]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AFDOriginListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class AFDOriginUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the origin. + + :param azure_origin: Resource reference to the Azure origin resource. + :type azure_origin: ~azure.mgmt.cdn.models.ResourceReference + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. :type host_name: str :param http_port: The value of the HTTP port. Must be between 1 and 65535. :type http_port: int @@ -792,7 +1049,7 @@ class DeepCreatedOrigin(msrest.serialization.Model): :param origin_host_header: The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin - hostname by default. + hostname by default. This overrides the host header defined at Endpoint. :type origin_host_header: str :param priority: Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 @@ -801,25 +1058,16 @@ class DeepCreatedOrigin(msrest.serialization.Model): :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. :type weight: int - :param enabled: Origin is enabled for load balancing or not. By default, origin is always - enabled. - :type enabled: bool - :param private_link_alias: The Alias of the Private Link resource. Populating this optional - field indicates that this origin 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 - :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 shared_private_link_resource: The properties of the private link resource for private + origin. + :type shared_private_link_resource: object + :param enabled_state: Whether to enable health probes to be made against backends defined under + backendPools. Health probes can only be disabled if there is a single enabled backend in single + enabled backend pool. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ _validation = { - 'name': {'required': True}, 'http_port': {'maximum': 65535, 'minimum': 1}, 'https_port': {'maximum': 65535, 'minimum': 1}, 'priority': {'maximum': 5, 'minimum': 1}, @@ -827,933 +1075,946 @@ class DeepCreatedOrigin(msrest.serialization.Model): } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, - 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, - 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, - 'priority': {'key': 'properties.priority', 'type': 'int'}, - 'weight': {'key': 'properties.weight', 'type': 'int'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, - 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, + 'azure_origin': {'key': 'azureOrigin', 'type': 'ResourceReference'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'http_port': {'key': 'httpPort', 'type': 'int'}, + 'https_port': {'key': 'httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'shared_private_link_resource': {'key': 'sharedPrivateLinkResource', 'type': 'object'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DeepCreatedOrigin, self).__init__(**kwargs) - self.name = kwargs['name'] + super(AFDOriginUpdatePropertiesParameters, self).__init__(**kwargs) + self.azure_origin = kwargs.get('azure_origin', None) self.host_name = kwargs.get('host_name', None) self.http_port = kwargs.get('http_port', None) self.https_port = kwargs.get('https_port', None) self.origin_host_header = kwargs.get('origin_host_header', None) self.priority = kwargs.get('priority', None) self.weight = kwargs.get('weight', None) - self.enabled = kwargs.get('enabled', 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_link_approval_message = kwargs.get('private_link_approval_message', None) + self.shared_private_link_resource = kwargs.get('shared_private_link_resource', None) + self.enabled_state = kwargs.get('enabled_state', None) -class DeepCreatedOriginGroup(msrest.serialization.Model): - """The origin group for CDN content which is added when creating a CDN endpoint. Traffic is sent to the origins within the origin group based on origin health. +class AFDOriginProperties(AFDStateProperties, AFDOriginUpdatePropertiesParameters): + """The JSON object that contains the properties of the origin. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. Origin group name which must be unique within the endpoint. - :type name: str - :param health_probe_settings: Health probe settings to the origin that is used to determine the - health of the origin. - :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters - :param origins: The source of the content being delivered via CDN within given origin group. - :type origins: list[~azure.mgmt.cdn.models.ResourceReference] - :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift - the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new - endpoint is added. Default is 10 mins. This property is currently not supported. - :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int - :param response_based_origin_error_detection_settings: The JSON object that contains the - properties to determine origin health using real requests/responses.This property is currently - not supported. - :type response_based_origin_error_detection_settings: - ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param azure_origin: Resource reference to the Azure origin resource. + :type azure_origin: ~azure.mgmt.cdn.models.ResourceReference + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param shared_private_link_resource: The properties of the private link resource for private + origin. + :type shared_private_link_resource: object + :param enabled_state: Whether to enable health probes to be made against backends defined under + backendPools. Health probes can only be disabled if there is a single enabled backend in single + enabled backend pool. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'name': {'required': True}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, - 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, - 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'azure_origin': {'key': 'azureOrigin', 'type': 'ResourceReference'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'http_port': {'key': 'httpPort', 'type': 'int'}, + 'https_port': {'key': 'httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'shared_private_link_resource': {'key': 'sharedPrivateLinkResource', 'type': 'object'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DeepCreatedOriginGroup, self).__init__(**kwargs) - self.name = kwargs['name'] - self.health_probe_settings = kwargs.get('health_probe_settings', None) - self.origins = kwargs.get('origins', None) - self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) - self.response_based_origin_error_detection_settings = kwargs.get('response_based_origin_error_detection_settings', None) - + super(AFDOriginProperties, self).__init__(**kwargs) + self.azure_origin = kwargs.get('azure_origin', None) + self.host_name = kwargs.get('host_name', None) + self.http_port = kwargs.get('http_port', None) + self.https_port = kwargs.get('https_port', None) + self.origin_host_header = kwargs.get('origin_host_header', None) + self.priority = kwargs.get('priority', None) + self.weight = kwargs.get('weight', None) + self.shared_private_link_resource = kwargs.get('shared_private_link_resource', None) + self.enabled_state = kwargs.get('enabled_state', None) + self.provisioning_state = None + self.deployment_status = None -class DeliveryRule(msrest.serialization.Model): - """A rule that specifies a set of actions and conditions. - All required parameters must be populated in order to send to Azure. +class AFDOriginUpdateParameters(msrest.serialization.Model): + """AFDOrigin properties needed for origin update. - :param name: Name of the rule. - :type name: str - :param order: Required. The order in which the rules are applied for the endpoint. Possible - values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater - order. Rule with order 0 is a special rule. It does not require any condition and actions - listed in it will always be applied. - :type order: int - :param conditions: A list of conditions that must be matched for the actions to be executed. - :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] - :param actions: Required. A list of actions that are executed when all the conditions of a rule - are satisfied. - :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :param azure_origin: Resource reference to the Azure origin resource. + :type azure_origin: ~azure.mgmt.cdn.models.ResourceReference + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param shared_private_link_resource: The properties of the private link resource for private + origin. + :type shared_private_link_resource: object + :param enabled_state: Whether to enable health probes to be made against backends defined under + backendPools. Health probes can only be disabled if there is a single enabled backend in single + enabled backend pool. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ _validation = { - 'order': {'required': True}, - 'actions': {'required': True}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'int'}, - 'conditions': {'key': 'conditions', 'type': '[DeliveryRuleCondition]'}, - 'actions': {'key': 'actions', 'type': '[DeliveryRuleAction]'}, + 'azure_origin': {'key': 'properties.azureOrigin', 'type': 'ResourceReference'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'weight': {'key': 'properties.weight', 'type': 'int'}, + 'shared_private_link_resource': {'key': 'properties.sharedPrivateLinkResource', 'type': 'object'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DeliveryRule, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.order = kwargs['order'] - self.conditions = kwargs.get('conditions', None) - self.actions = kwargs['actions'] - + super(AFDOriginUpdateParameters, self).__init__(**kwargs) + self.azure_origin = kwargs.get('azure_origin', None) + self.host_name = kwargs.get('host_name', None) + self.http_port = kwargs.get('http_port', None) + self.https_port = kwargs.get('https_port', None) + self.origin_host_header = kwargs.get('origin_host_header', None) + self.priority = kwargs.get('priority', None) + self.weight = kwargs.get('weight', None) + self.shared_private_link_resource = kwargs.get('shared_private_link_resource', None) + self.enabled_state = kwargs.get('enabled_state', None) -class DeliveryRuleAction(msrest.serialization.Model): - """An action for the delivery rule. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DeliveryRuleCacheExpirationAction, DeliveryRuleCacheKeyQueryStringAction, DeliveryRuleRequestHeaderAction, DeliveryRuleResponseHeaderAction, UrlRedirectAction, UrlRewriteAction, UrlSigningAction. +class AfdPurgeParameters(msrest.serialization.Model): + """Parameters required for content purge. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the action for the delivery rule.Constant filled by server. - Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName + :param content_paths: Required. The path to the content to be purged. Can describe a file path + or a wild card directory. + :type content_paths: list[str] + :param domains: List of domains. + :type domains: list[str] """ _validation = { - 'name': {'required': True}, + 'content_paths': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - _subtype_map = { - 'name': {'CacheExpiration': 'DeliveryRuleCacheExpirationAction', 'CacheKeyQueryString': 'DeliveryRuleCacheKeyQueryStringAction', 'ModifyRequestHeader': 'DeliveryRuleRequestHeaderAction', 'ModifyResponseHeader': 'DeliveryRuleResponseHeaderAction', 'UrlRedirect': 'UrlRedirectAction', 'UrlRewrite': 'UrlRewriteAction', 'UrlSigning': 'UrlSigningAction'} + 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + 'domains': {'key': 'domains', 'type': '[str]'}, } def __init__( self, **kwargs ): - super(DeliveryRuleAction, self).__init__(**kwargs) - self.name = None # type: Optional[str] + super(AfdPurgeParameters, self).__init__(**kwargs) + self.content_paths = kwargs['content_paths'] + self.domains = kwargs.get('domains', None) -class DeliveryRuleCacheExpirationAction(DeliveryRuleAction): - """Defines the cache expiration action for the delivery rule. +class CacheExpirationActionParameters(msrest.serialization.Model): + """Defines the parameters for the cache expiration action. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the action for the delivery rule.Constant filled by server. - Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName - :param parameters: Required. Defines the parameters for the action. - :type parameters: ~azure.mgmt.cdn.models.CacheExpirationActionParameters + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters". + :vartype odata_type: str + :param cache_behavior: Required. Caching behavior for the requests. Possible values include: + "BypassCache", "Override", "SetIfMissing". + :type cache_behavior: str or ~azure.mgmt.cdn.models.CacheBehavior + :param cache_type: Required. The level at which the content needs to be cached. Possible values + include: "All". + :type cache_type: str or ~azure.mgmt.cdn.models.CacheType + :param cache_duration: The duration for which the content needs to be cached. Allowed format is + [d.]hh:mm:ss. + :type cache_duration: str """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'odata_type': {'required': True, 'constant': True}, + 'cache_behavior': {'required': True}, + 'cache_type': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'CacheExpirationActionParameters'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'cache_behavior': {'key': 'cacheBehavior', 'type': 'str'}, + 'cache_type': {'key': 'cacheType', 'type': 'str'}, + 'cache_duration': {'key': 'cacheDuration', 'type': 'str'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" + def __init__( self, **kwargs ): - super(DeliveryRuleCacheExpirationAction, self).__init__(**kwargs) - self.name = 'CacheExpiration' # type: str - self.parameters = kwargs['parameters'] + super(CacheExpirationActionParameters, self).__init__(**kwargs) + self.cache_behavior = kwargs['cache_behavior'] + self.cache_type = kwargs['cache_type'] + self.cache_duration = kwargs.get('cache_duration', None) -class DeliveryRuleCacheKeyQueryStringAction(DeliveryRuleAction): - """Defines the cache-key query string action for the delivery rule. +class CacheKeyQueryStringActionParameters(msrest.serialization.Model): + """Defines the parameters for the cache-key query string action. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the action for the delivery rule.Constant filled by server. - Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName - :param parameters: Required. Defines the parameters for the action. - :type parameters: ~azure.mgmt.cdn.models.CacheKeyQueryStringActionParameters + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters". + :vartype odata_type: str + :param query_string_behavior: Required. Caching behavior for the requests. Possible values + include: "Include", "IncludeAll", "Exclude", "ExcludeAll". + :type query_string_behavior: str or ~azure.mgmt.cdn.models.QueryStringBehavior + :param query_parameters: query parameters to include or exclude (comma separated). + :type query_parameters: str """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'odata_type': {'required': True, 'constant': True}, + 'query_string_behavior': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'CacheKeyQueryStringActionParameters'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'query_string_behavior': {'key': 'queryStringBehavior', 'type': 'str'}, + 'query_parameters': {'key': 'queryParameters', 'type': 'str'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters" + def __init__( self, **kwargs ): - super(DeliveryRuleCacheKeyQueryStringAction, self).__init__(**kwargs) - self.name = 'CacheKeyQueryString' # type: str - self.parameters = kwargs['parameters'] + super(CacheKeyQueryStringActionParameters, self).__init__(**kwargs) + self.query_string_behavior = kwargs['query_string_behavior'] + self.query_parameters = kwargs.get('query_parameters', None) -class DeliveryRuleCondition(msrest.serialization.Model): - """A condition for the delivery rule. +class CdnCertificateSourceParameters(msrest.serialization.Model): + """Defines the parameters for using CDN managed certificate for securing custom domain. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DeliveryRuleCookiesCondition, DeliveryRuleHttpVersionCondition, DeliveryRuleIsDeviceCondition, DeliveryRulePostArgsCondition, DeliveryRuleQueryStringCondition, DeliveryRuleRemoteAddressCondition, DeliveryRuleRequestBodyCondition, DeliveryRuleRequestHeaderCondition, DeliveryRuleRequestMethodCondition, DeliveryRuleRequestSchemeCondition, DeliveryRuleRequestUriCondition, DeliveryRuleUrlFileExtensionCondition, DeliveryRuleUrlFileNameCondition, DeliveryRuleUrlPathCondition. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters". + :vartype odata_type: str + :param certificate_type: Required. Type of certificate used. Possible values include: "Shared", + "Dedicated". + :type certificate_type: str or ~azure.mgmt.cdn.models.CertificateType """ _validation = { - 'name': {'required': True}, + 'odata_type': {'required': True, 'constant': True}, + 'certificate_type': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'certificate_type': {'key': 'certificateType', 'type': 'str'}, } - _subtype_map = { - 'name': {'Cookies': 'DeliveryRuleCookiesCondition', 'HttpVersion': 'DeliveryRuleHttpVersionCondition', 'IsDevice': 'DeliveryRuleIsDeviceCondition', 'PostArgs': 'DeliveryRulePostArgsCondition', 'QueryString': 'DeliveryRuleQueryStringCondition', 'RemoteAddress': 'DeliveryRuleRemoteAddressCondition', 'RequestBody': 'DeliveryRuleRequestBodyCondition', 'RequestHeader': 'DeliveryRuleRequestHeaderCondition', 'RequestMethod': 'DeliveryRuleRequestMethodCondition', 'RequestScheme': 'DeliveryRuleRequestSchemeCondition', 'RequestUri': 'DeliveryRuleRequestUriCondition', 'UrlFileExtension': 'DeliveryRuleUrlFileExtensionCondition', 'UrlFileName': 'DeliveryRuleUrlFileNameCondition', 'UrlPath': 'DeliveryRuleUrlPathCondition'} - } + odata_type = "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters" def __init__( self, **kwargs ): - super(DeliveryRuleCondition, self).__init__(**kwargs) - self.name = None # type: Optional[str] - + super(CdnCertificateSourceParameters, self).__init__(**kwargs) + self.certificate_type = kwargs['certificate_type'] -class DeliveryRuleCookiesCondition(DeliveryRuleCondition): - """Defines the Cookies condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class CdnEndpoint(msrest.serialization.Model): + """Defines the ARM Resource ID for the linked endpoints. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.CookiesMatchConditionParameters + :param id: ARM Resource ID string. + :type id: str """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'CookiesMatchConditionParameters'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DeliveryRuleCookiesCondition, self).__init__(**kwargs) - self.name = 'Cookies' # type: str - self.parameters = kwargs['parameters'] + super(CdnEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) -class DeliveryRuleHttpVersionCondition(DeliveryRuleCondition): - """Defines the HttpVersion condition for the delivery rule. +class CustomDomainHttpsParameters(msrest.serialization.Model): + """The JSON object that contains the properties to secure a custom domain. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: UserManagedHttpsParameters, CdnManagedHttpsParameters. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.HttpVersionMatchConditionParameters + :param certificate_source: Required. Defines the source of the SSL certificate.Constant filled + by server. Possible values include: "AzureKeyVault", "Cdn". + :type certificate_source: str or ~azure.mgmt.cdn.models.CertificateSource + :param protocol_type: Required. Defines the TLS extension protocol that is used for secure + delivery. Possible values include: "ServerNameIndication", "IPBased". + :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType + :param minimum_tls_version: TLS protocol version that will be used for Https. Possible values + include: "None", "TLS10", "TLS12". + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'certificate_source': {'required': True}, + 'protocol_type': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'HttpVersionMatchConditionParameters'}, + 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + } + + _subtype_map = { + 'certificate_source': {'AzureKeyVault': 'UserManagedHttpsParameters', 'Cdn': 'CdnManagedHttpsParameters'} } def __init__( self, **kwargs ): - super(DeliveryRuleHttpVersionCondition, self).__init__(**kwargs) - self.name = 'HttpVersion' # type: str - self.parameters = kwargs['parameters'] + super(CustomDomainHttpsParameters, self).__init__(**kwargs) + self.certificate_source = None # type: Optional[str] + self.protocol_type = kwargs['protocol_type'] + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) -class DeliveryRuleIsDeviceCondition(DeliveryRuleCondition): - """Defines the IsDevice condition for the delivery rule. +class CdnManagedHttpsParameters(CustomDomainHttpsParameters): + """Defines the certificate source parameters using CDN managed certificate for enabling SSL. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.IsDeviceMatchConditionParameters + :param certificate_source: Required. Defines the source of the SSL certificate.Constant filled + by server. Possible values include: "AzureKeyVault", "Cdn". + :type certificate_source: str or ~azure.mgmt.cdn.models.CertificateSource + :param protocol_type: Required. Defines the TLS extension protocol that is used for secure + delivery. Possible values include: "ServerNameIndication", "IPBased". + :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType + :param minimum_tls_version: TLS protocol version that will be used for Https. Possible values + include: "None", "TLS10", "TLS12". + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion + :param certificate_source_parameters: Required. Defines the certificate source parameters using + CDN managed certificate for enabling SSL. + :type certificate_source_parameters: ~azure.mgmt.cdn.models.CdnCertificateSourceParameters """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'certificate_source': {'required': True}, + 'protocol_type': {'required': True}, + 'certificate_source_parameters': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'IsDeviceMatchConditionParameters'}, + 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + 'certificate_source_parameters': {'key': 'certificateSourceParameters', 'type': 'CdnCertificateSourceParameters'}, } def __init__( self, **kwargs ): - super(DeliveryRuleIsDeviceCondition, self).__init__(**kwargs) - self.name = 'IsDevice' # type: str - self.parameters = kwargs['parameters'] + super(CdnManagedHttpsParameters, self).__init__(**kwargs) + self.certificate_source = 'Cdn' # type: str + self.certificate_source_parameters = kwargs['certificate_source_parameters'] -class DeliveryRulePostArgsCondition(DeliveryRuleCondition): - """Defines the PostArgs condition for the delivery rule. +class CdnWebApplicationFirewallPolicy(TrackedResource): + """Defines web application firewall policy for Azure CDN. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.PostArgsMatchConditionParameters + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param etag: Gets a unique read-only string that changes whenever the resource is updated. + :type etag: str + :param sku: Required. The pricing tier (defines a CDN provider, feature list and rate) of the + CdnWebApplicationFirewallPolicy. + :type sku: ~azure.mgmt.cdn.models.Sku + :param policy_settings: Describes policySettings for policy. + :type policy_settings: ~azure.mgmt.cdn.models.PolicySettings + :param rate_limit_rules: Describes rate limit rules inside the policy. + :type rate_limit_rules: ~azure.mgmt.cdn.models.RateLimitRuleList + :param custom_rules: Describes custom rules inside the policy. + :type custom_rules: ~azure.mgmt.cdn.models.CustomRuleList + :param managed_rules: Describes managed rules inside the policy. + :type managed_rules: ~azure.mgmt.cdn.models.ManagedRuleSetList + :ivar endpoint_links: Describes Azure CDN endpoints associated with this Web Application + Firewall policy. + :vartype endpoint_links: list[~azure.mgmt.cdn.models.CdnEndpoint] + :ivar provisioning_state: Provisioning state of the WebApplicationFirewallPolicy. Possible + values include: "Creating", "Succeeded", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.ProvisioningState + :ivar resource_state: Resource status of the policy. Possible values include: "Creating", + "Enabling", "Enabled", "Disabling", "Disabled", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.PolicyResourceState """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'sku': {'required': True}, + 'endpoint_links': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_state': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'PostArgsMatchConditionParameters'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'policy_settings': {'key': 'properties.policySettings', 'type': 'PolicySettings'}, + 'rate_limit_rules': {'key': 'properties.rateLimitRules', 'type': 'RateLimitRuleList'}, + 'custom_rules': {'key': 'properties.customRules', 'type': 'CustomRuleList'}, + 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRuleSetList'}, + 'endpoint_links': {'key': 'properties.endpointLinks', 'type': '[CdnEndpoint]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DeliveryRulePostArgsCondition, self).__init__(**kwargs) - self.name = 'PostArgs' # type: str - self.parameters = kwargs['parameters'] + super(CdnWebApplicationFirewallPolicy, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.sku = kwargs['sku'] + self.policy_settings = kwargs.get('policy_settings', None) + self.rate_limit_rules = kwargs.get('rate_limit_rules', None) + self.custom_rules = kwargs.get('custom_rules', None) + self.managed_rules = kwargs.get('managed_rules', None) + self.endpoint_links = None + self.provisioning_state = None + self.resource_state = None -class DeliveryRuleQueryStringCondition(DeliveryRuleCondition): - """Defines the QueryString condition for the delivery rule. +class CdnWebApplicationFirewallPolicyList(msrest.serialization.Model): + """Defines a list of WebApplicationFirewallPolicies for Azure CDN. It contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.QueryStringMatchConditionParameters + :ivar value: List of Azure CDN WebApplicationFirewallPolicies within a resource group. + :vartype value: list[~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicy] + :param next_link: URL to get the next set of WebApplicationFirewallPolicy objects if there are + any. + :type next_link: str """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'QueryStringMatchConditionParameters'}, + 'value': {'key': 'value', 'type': '[CdnWebApplicationFirewallPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DeliveryRuleQueryStringCondition, self).__init__(**kwargs) - self.name = 'QueryString' # type: str - self.parameters = kwargs['parameters'] - + super(CdnWebApplicationFirewallPolicyList, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) -class DeliveryRuleRemoteAddressCondition(DeliveryRuleCondition): - """Defines the RemoteAddress condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class CdnWebApplicationFirewallPolicyPatchParameters(msrest.serialization.Model): + """Properties required to update a CdnWebApplicationFirewallPolicy. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RemoteAddressMatchConditionParameters + :param tags: A set of tags. CdnWebApplicationFirewallPolicy tags. + :type tags: dict[str, str] """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RemoteAddressMatchConditionParameters'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__( self, **kwargs ): - super(DeliveryRuleRemoteAddressCondition, self).__init__(**kwargs) - self.name = 'RemoteAddress' # type: str - self.parameters = kwargs['parameters'] - + super(CdnWebApplicationFirewallPolicyPatchParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) -class DeliveryRuleRequestBodyCondition(DeliveryRuleCondition): - """Defines the RequestBody condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class Certificate(msrest.serialization.Model): + """Certificate used for https. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RequestBodyMatchConditionParameters + :param subject: Subject name in the certificate. + :type subject: str + :param expiration_date: Certificate expiration date. + :type expiration_date: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RequestBodyMatchConditionParameters'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DeliveryRuleRequestBodyCondition, self).__init__(**kwargs) - self.name = 'RequestBody' # type: str - self.parameters = kwargs['parameters'] + super(Certificate, self).__init__(**kwargs) + self.subject = kwargs.get('subject', None) + self.expiration_date = kwargs.get('expiration_date', None) + self.thumbprint = kwargs.get('thumbprint', None) -class DeliveryRuleRequestHeaderAction(DeliveryRuleAction): - """Defines the request header action for the delivery rule. +class CheckNameAvailabilityInput(msrest.serialization.Model): + """Input of CheckNameAvailability API. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the action for the delivery rule.Constant filled by server. - Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName - :param parameters: Required. Defines the parameters for the action. - :type parameters: ~azure.mgmt.cdn.models.HeaderActionParameters + :param name: Required. The resource name to validate. + :type name: str + :ivar type: Required. The type of the resource whose name is to be validated. Default value: + "Microsoft.Cdn/Profiles/Endpoints". + :vartype type: str """ _validation = { 'name': {'required': True}, - 'parameters': {'required': True}, + 'type': {'required': True, 'constant': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'HeaderActionParameters'}, + 'type': {'key': 'type', 'type': 'str'}, } + type = "Microsoft.Cdn/Profiles/Endpoints" + def __init__( self, **kwargs ): - super(DeliveryRuleRequestHeaderAction, self).__init__(**kwargs) - self.name = 'ModifyRequestHeader' # type: str - self.parameters = kwargs['parameters'] + super(CheckNameAvailabilityInput, self).__init__(**kwargs) + self.name = kwargs['name'] -class DeliveryRuleRequestHeaderCondition(DeliveryRuleCondition): - """Defines the RequestHeader condition for the delivery rule. +class CheckNameAvailabilityOutput(msrest.serialization.Model): + """Output of check name availability API. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RequestHeaderMatchConditionParameters + :ivar name_available: Indicates whether the name is available. + :vartype name_available: bool + :ivar reason: The reason why the name is not available. + :vartype reason: str + :ivar message: The detailed error message describing why the name is not available. + :vartype message: str """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RequestHeaderMatchConditionParameters'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DeliveryRuleRequestHeaderCondition, self).__init__(**kwargs) - self.name = 'RequestHeader' # type: str - self.parameters = kwargs['parameters'] - + super(CheckNameAvailabilityOutput, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None -class DeliveryRuleRequestMethodCondition(DeliveryRuleCondition): - """Defines the RequestMethod condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class CidrIpAddress(msrest.serialization.Model): + """CIDR Ip address. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RequestMethodMatchConditionParameters + :param base_ip_address: Ip address itself. + :type base_ip_address: str + :param prefix_length: The length of the prefix of the ip address. + :type prefix_length: int """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RequestMethodMatchConditionParameters'}, + 'base_ip_address': {'key': 'baseIpAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, } def __init__( self, **kwargs ): - super(DeliveryRuleRequestMethodCondition, self).__init__(**kwargs) - self.name = 'RequestMethod' # type: str - self.parameters = kwargs['parameters'] - + super(CidrIpAddress, self).__init__(**kwargs) + self.base_ip_address = kwargs.get('base_ip_address', None) + self.prefix_length = kwargs.get('prefix_length', None) -class DeliveryRuleRequestSchemeCondition(DeliveryRuleCondition): - """Defines the RequestScheme condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems(msrest.serialization.Model): + """Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParameters + :param date_time: + :type date_time: ~datetime.datetime + :param value: + :type value: float """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RequestSchemeMatchConditionParameters'}, + 'date_time': {'key': 'dateTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': 'float'}, } def __init__( self, **kwargs ): - super(DeliveryRuleRequestSchemeCondition, self).__init__(**kwargs) - self.name = 'RequestScheme' # type: str - self.parameters = kwargs['parameters'] - + super(Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems, self).__init__(**kwargs) + self.date_time = kwargs.get('date_time', None) + self.value = kwargs.get('value', None) -class DeliveryRuleRequestUriCondition(DeliveryRuleCondition): - """Defines the RequestUri condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems(msrest.serialization.Model): + """Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RequestUriMatchConditionParameters + :param date_time: + :type date_time: ~datetime.datetime + :param value: + :type value: float """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RequestUriMatchConditionParameters'}, + 'date_time': {'key': 'dateTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': 'float'}, } def __init__( self, **kwargs ): - super(DeliveryRuleRequestUriCondition, self).__init__(**kwargs) - self.name = 'RequestUri' # type: str - self.parameters = kwargs['parameters'] - + super(Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems, self).__init__(**kwargs) + self.date_time = kwargs.get('date_time', None) + self.value = kwargs.get('value', None) -class DeliveryRuleResponseHeaderAction(DeliveryRuleAction): - """Defines the response header action for the delivery rule. - All required parameters must be populated in order to send to Azure. +class ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems(msrest.serialization.Model): + """ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems. - :param name: Required. The name of the action for the delivery rule.Constant filled by server. - Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName - :param parameters: Required. Defines the parameters for the action. - :type parameters: ~azure.mgmt.cdn.models.HeaderActionParameters + :param metric: + :type metric: str + :param value: + :type value: long + :param percentage: + :type percentage: float """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'HeaderActionParameters'}, + 'metric': {'key': 'metric', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'long'}, + 'percentage': {'key': 'percentage', 'type': 'float'}, } def __init__( self, **kwargs ): - super(DeliveryRuleResponseHeaderAction, self).__init__(**kwargs) - self.name = 'ModifyResponseHeader' # type: str - self.parameters = kwargs['parameters'] - + super(ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems, self).__init__(**kwargs) + self.metric = kwargs.get('metric', None) + self.value = kwargs.get('value', None) + self.percentage = kwargs.get('percentage', None) -class DeliveryRuleUrlFileExtensionCondition(DeliveryRuleCondition): - """Defines the UrlFileExtension condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class CompressionSettings(msrest.serialization.Model): + """settings for compression. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.UrlFileExtensionMatchConditionParameters + :param content_types_to_compress: List of content types on which compression applies. The value + should be a valid MIME type. + :type content_types_to_compress: list[str] + :param is_compression_enabled: Indicates whether content compression is enabled on + AzureFrontDoor. Default value is false. If compression is enabled, content will be served as + compressed if user requests for a compressed version. Content won't be compressed on + AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. + :type is_compression_enabled: bool """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'UrlFileExtensionMatchConditionParameters'}, + 'content_types_to_compress': {'key': 'contentTypesToCompress', 'type': '[str]'}, + 'is_compression_enabled': {'key': 'isCompressionEnabled', 'type': 'bool'}, } def __init__( self, **kwargs ): - super(DeliveryRuleUrlFileExtensionCondition, self).__init__(**kwargs) - self.name = 'UrlFileExtension' # type: str - self.parameters = kwargs['parameters'] - + super(CompressionSettings, self).__init__(**kwargs) + self.content_types_to_compress = kwargs.get('content_types_to_compress', None) + self.is_compression_enabled = kwargs.get('is_compression_enabled', None) -class DeliveryRuleUrlFileNameCondition(DeliveryRuleCondition): - """Defines the UrlFileName condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class ContinentsResponse(msrest.serialization.Model): + """Continents Response. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.UrlFileNameMatchConditionParameters + :param continents: + :type continents: list[~azure.mgmt.cdn.models.ContinentsResponseContinentsItem] + :param country_or_regions: + :type country_or_regions: list[~azure.mgmt.cdn.models.ContinentsResponseCountryOrRegionsItem] """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'UrlFileNameMatchConditionParameters'}, + 'continents': {'key': 'continents', 'type': '[ContinentsResponseContinentsItem]'}, + 'country_or_regions': {'key': 'countryOrRegions', 'type': '[ContinentsResponseCountryOrRegionsItem]'}, } def __init__( self, **kwargs ): - super(DeliveryRuleUrlFileNameCondition, self).__init__(**kwargs) - self.name = 'UrlFileName' # type: str - self.parameters = kwargs['parameters'] - + super(ContinentsResponse, self).__init__(**kwargs) + self.continents = kwargs.get('continents', None) + self.country_or_regions = kwargs.get('country_or_regions', None) -class DeliveryRuleUrlPathCondition(DeliveryRuleCondition): - """Defines the UrlPath condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class ContinentsResponseContinentsItem(msrest.serialization.Model): + """ContinentsResponseContinentsItem. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.UrlPathMatchConditionParameters + :param id: + :type id: str """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, } + def __init__( + self, + **kwargs + ): + super(ContinentsResponseContinentsItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ContinentsResponseCountryOrRegionsItem(msrest.serialization.Model): + """ContinentsResponseCountryOrRegionsItem. + + :param id: + :type id: str + :param continent_id: + :type continent_id: str + """ + _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'UrlPathMatchConditionParameters'}, + 'id': {'key': 'id', 'type': 'str'}, + 'continent_id': {'key': 'continentId', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DeliveryRuleUrlPathCondition, self).__init__(**kwargs) - self.name = 'UrlPath' # type: str - self.parameters = kwargs['parameters'] + super(ContinentsResponseCountryOrRegionsItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.continent_id = kwargs.get('continent_id', None) -class EdgeNode(Resource): - """Edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. +class CookiesMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for Cookies match conditions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param ip_address_groups: List of ip address groups. - :type ip_address_groups: list[~azure.mgmt.cdn.models.IpAddressGroup] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'ip_address_groups': {'key': 'properties.ipAddressGroups', 'type': '[IpAddressGroup]'}, - } - - def __init__( - self, - **kwargs - ): - super(EdgeNode, self).__init__(**kwargs) - self.ip_address_groups = kwargs.get('ip_address_groups', None) - - -class EdgenodeResult(msrest.serialization.Model): - """Result of the request to list CDN edgenodes. It contains a list of ip address group and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: Edge node of CDN service. - :vartype value: list[~azure.mgmt.cdn.models.EdgeNode] - :param next_link: URL to get the next set of edgenode list results if there are any. - :type next_link: str + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters". + :vartype odata_type: str + :param selector: Name of Cookies to be matched. + :type selector: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.CookiesOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] """ _validation = { - 'value': {'readonly': True}, + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[EdgeNode]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters" + def __init__( self, **kwargs ): - super(EdgenodeResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) + super(CookiesMatchConditionParameters, self).__init__(**kwargs) + self.selector = kwargs.get('selector', None) + self.operator = kwargs['operator'] + self.negate_condition = kwargs.get('negate_condition', None) + self.match_values = kwargs.get('match_values', None) + self.transforms = kwargs.get('transforms', None) -class Endpoint(TrackedResource): - """CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format :code:``.azureedge.net. +class CustomDomain(ProxyResource): + """Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param origin_path: A directory path on the origin that CDN can use to retrieve content from, - e.g. contoso.cloudapp.net/originpath. - :type origin_path: str - :param content_types_to_compress: List of content types on which compression applies. The value - should be a valid MIME type. - :type content_types_to_compress: list[str] - :param origin_host_header: The host header value sent to the origin with each request. This - property at Endpoint is only allowed when endpoint uses single origin and can be overridden by - the same property specified at origin.If you leave this blank, the request hostname determines - this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this - host header value to match the origin hostname by default. - :type origin_host_header: str - :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default - value is false. If compression is enabled, content will be served as compressed if user - requests for a compressed version. Content won't be compressed on CDN when requested content is - smaller than 1 byte or larger than 1 MB. - :type is_compression_enabled: bool - :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_http_allowed: bool - :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_https_allowed: bool - :param query_string_caching_behavior: Defines how CDN caches requests that include query - strings. You can ignore any query strings when caching, bypass caching to prevent requests that - contain query strings from being cached, or cache every request with a unique URL. Possible - values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". - :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior - :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to - optimize for, e.g. Download, Media services. With this information, CDN can apply scenario - driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", - "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". - :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType - :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the - dynamic content and calculate the most optimal routes for the CDN. This is relative to the - origin path. This property is only relevant when using a single origin. - :type probe_path: str - :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each - geo filter defines an access rule to a specified path or content, e.g. block APAC for path - /pictures/. - :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] - :param default_origin_group: A reference to the origin group. - :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference - :param url_signing_keys: List of keys used to validate the signed URL hashes. - :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] - :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. - :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy - :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for - the endpoint (if applicable). - :type web_application_firewall_policy_link: - ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink - :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. - contoso.azureedge.net. - :vartype host_name: str - :param origins: The source of the content being delivered via CDN. - :type origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin] - :param origin_groups: The origin groups comprising of origins that are used for load balancing - the traffic based on availability. - :type origin_groups: list[~azure.mgmt.cdn.models.DeepCreatedOriginGroup] - :ivar resource_state: Resource status of the endpoint. Possible values include: "Creating", - "Deleting", "Running", "Starting", "Stopped", "Stopping". - :vartype resource_state: str or ~azure.mgmt.cdn.models.EndpointResourceState - :ivar provisioning_state: Provisioning status of the endpoint. + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param host_name: The host name of the custom domain. Must be a domain name. + :type host_name: str + :ivar resource_state: Resource status of the custom domain. Possible values include: + "Creating", "Active", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.CustomDomainResourceState + :ivar custom_https_provisioning_state: Provisioning status of Custom Https of the custom + domain. Possible values include: "Enabling", "Enabled", "Disabling", "Disabled", "Failed". + :vartype custom_https_provisioning_state: str or + ~azure.mgmt.cdn.models.CustomHttpsProvisioningState + :ivar custom_https_provisioning_substate: Provisioning substate shows the progress of custom + HTTPS enabling/disabling process step by step. Possible values include: + "SubmittingDomainControlValidationRequest", "PendingDomainControlValidationREquestApproval", + "DomainControlValidationRequestApproved", "DomainControlValidationRequestRejected", + "DomainControlValidationRequestTimedOut", "IssuingCertificate", "DeployingCertificate", + "CertificateDeployed", "DeletingCertificate", "CertificateDeleted". + :vartype custom_https_provisioning_substate: str or + ~azure.mgmt.cdn.models.CustomHttpsProvisioningSubstate + :param validation_data: Special validation or data may be required when delivering CDN to some + regions due to local compliance reasons. E.g. ICP license number of a custom domain is required + to deliver content in China. + :type validation_data: str + :ivar provisioning_state: Provisioning status of the custom domain. :vartype provisioning_state: str """ @@ -1761,9 +2022,10 @@ class Endpoint(TrackedResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, - 'host_name': {'readonly': True}, + 'system_data': {'readonly': True}, 'resource_state': {'readonly': True}, + 'custom_https_provisioning_state': {'readonly': True}, + 'custom_https_provisioning_substate': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -1771,26 +2033,12 @@ class Endpoint(TrackedResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, - 'content_types_to_compress': {'key': 'properties.contentTypesToCompress', 'type': '[str]'}, - 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, - 'is_compression_enabled': {'key': 'properties.isCompressionEnabled', 'type': 'bool'}, - 'is_http_allowed': {'key': 'properties.isHttpAllowed', 'type': 'bool'}, - 'is_https_allowed': {'key': 'properties.isHttpsAllowed', 'type': 'bool'}, - 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, - 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, - 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, - 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, - 'default_origin_group': {'key': 'properties.defaultOriginGroup', 'type': 'ResourceReference'}, - 'url_signing_keys': {'key': 'properties.urlSigningKeys', 'type': '[UrlSigningKey]'}, - 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, - 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'origins': {'key': 'properties.origins', 'type': '[DeepCreatedOrigin]'}, - 'origin_groups': {'key': 'properties.originGroups', 'type': '[DeepCreatedOriginGroup]'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'custom_https_provisioning_state': {'key': 'properties.customHttpsProvisioningState', 'type': 'str'}, + 'custom_https_provisioning_substate': {'key': 'properties.customHttpsProvisioningSubstate', 'type': 'str'}, + 'validation_data': {'key': 'properties.validationData', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -1798,36 +2046,23 @@ def __init__( self, **kwargs ): - super(Endpoint, self).__init__(**kwargs) - self.origin_path = kwargs.get('origin_path', None) - self.content_types_to_compress = kwargs.get('content_types_to_compress', None) - self.origin_host_header = kwargs.get('origin_host_header', None) - self.is_compression_enabled = kwargs.get('is_compression_enabled', None) - self.is_http_allowed = kwargs.get('is_http_allowed', None) - self.is_https_allowed = kwargs.get('is_https_allowed', None) - self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) - self.optimization_type = kwargs.get('optimization_type', None) - self.probe_path = kwargs.get('probe_path', None) - self.geo_filters = kwargs.get('geo_filters', None) - self.default_origin_group = kwargs.get('default_origin_group', None) - self.url_signing_keys = kwargs.get('url_signing_keys', None) - self.delivery_policy = kwargs.get('delivery_policy', None) - self.web_application_firewall_policy_link = kwargs.get('web_application_firewall_policy_link', None) - self.host_name = None - self.origins = kwargs.get('origins', None) - self.origin_groups = kwargs.get('origin_groups', None) + super(CustomDomain, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) self.resource_state = None + self.custom_https_provisioning_state = None + self.custom_https_provisioning_substate = None + self.validation_data = kwargs.get('validation_data', None) self.provisioning_state = None -class EndpointListResult(msrest.serialization.Model): - """Result of the request to list endpoints. It contains a list of endpoint objects and a URL link to get the next set of results. +class CustomDomainListResult(msrest.serialization.Model): + """Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of CDN endpoints within a profile. - :vartype value: list[~azure.mgmt.cdn.models.Endpoint] - :param next_link: URL to get the next set of endpoint objects if there is any. + :ivar value: List of CDN CustomDomains within an endpoint. + :vartype value: list[~azure.mgmt.cdn.models.CustomDomain] + :param next_link: URL to get the next set of custom domain objects if there are any. :type next_link: str """ @@ -1836,7 +2071,7 @@ class EndpointListResult(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[Endpoint]'}, + 'value': {'key': 'value', 'type': '[CustomDomain]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -1844,560 +2079,3500 @@ def __init__( self, **kwargs ): - super(EndpointListResult, self).__init__(**kwargs) + super(CustomDomainListResult, self).__init__(**kwargs) self.value = None self.next_link = kwargs.get('next_link', None) -class EndpointPropertiesUpdateParameters(msrest.serialization.Model): - """The JSON object containing endpoint update parameters. +class CustomDomainParameters(msrest.serialization.Model): + """The customDomain JSON object required for custom domain creation or update. - :param origin_path: A directory path on the origin that CDN can use to retrieve content from, - e.g. contoso.cloudapp.net/originpath. - :type origin_path: str - :param content_types_to_compress: List of content types on which compression applies. The value - should be a valid MIME type. - :type content_types_to_compress: list[str] - :param origin_host_header: The host header value sent to the origin with each request. This - property at Endpoint is only allowed when endpoint uses single origin and can be overridden by - the same property specified at origin.If you leave this blank, the request hostname determines - this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this - host header value to match the origin hostname by default. - :type origin_host_header: str - :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default - value is false. If compression is enabled, content will be served as compressed if user - requests for a compressed version. Content won't be compressed on CDN when requested content is - smaller than 1 byte or larger than 1 MB. - :type is_compression_enabled: bool - :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_http_allowed: bool - :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_https_allowed: bool - :param query_string_caching_behavior: Defines how CDN caches requests that include query - strings. You can ignore any query strings when caching, bypass caching to prevent requests that - contain query strings from being cached, or cache every request with a unique URL. Possible - values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". - :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior - :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to - optimize for, e.g. Download, Media services. With this information, CDN can apply scenario - driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", - "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". - :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType - :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the - dynamic content and calculate the most optimal routes for the CDN. This is relative to the - origin path. This property is only relevant when using a single origin. - :type probe_path: str - :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each - geo filter defines an access rule to a specified path or content, e.g. block APAC for path - /pictures/. - :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] - :param default_origin_group: A reference to the origin group. - :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference - :param url_signing_keys: List of keys used to validate the signed URL hashes. - :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] - :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. - :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy - :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for - the endpoint (if applicable). - :type web_application_firewall_policy_link: - ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + :param host_name: The host name of the custom domain. Must be a domain name. + :type host_name: str """ _attribute_map = { - 'origin_path': {'key': 'originPath', 'type': 'str'}, - 'content_types_to_compress': {'key': 'contentTypesToCompress', 'type': '[str]'}, - 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, - 'is_compression_enabled': {'key': 'isCompressionEnabled', 'type': 'bool'}, - 'is_http_allowed': {'key': 'isHttpAllowed', 'type': 'bool'}, - 'is_https_allowed': {'key': 'isHttpsAllowed', 'type': 'bool'}, - 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, - 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, - 'probe_path': {'key': 'probePath', 'type': 'str'}, - 'geo_filters': {'key': 'geoFilters', 'type': '[GeoFilter]'}, - 'default_origin_group': {'key': 'defaultOriginGroup', 'type': 'ResourceReference'}, - 'url_signing_keys': {'key': 'urlSigningKeys', 'type': '[UrlSigningKey]'}, - 'delivery_policy': {'key': 'deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, - 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, } def __init__( self, **kwargs ): - super(EndpointPropertiesUpdateParameters, self).__init__(**kwargs) - self.origin_path = kwargs.get('origin_path', None) - self.content_types_to_compress = kwargs.get('content_types_to_compress', None) - self.origin_host_header = kwargs.get('origin_host_header', None) - self.is_compression_enabled = kwargs.get('is_compression_enabled', None) - self.is_http_allowed = kwargs.get('is_http_allowed', None) - self.is_https_allowed = kwargs.get('is_https_allowed', None) - self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) - self.optimization_type = kwargs.get('optimization_type', None) - self.probe_path = kwargs.get('probe_path', None) - self.geo_filters = kwargs.get('geo_filters', None) - self.default_origin_group = kwargs.get('default_origin_group', None) - self.url_signing_keys = kwargs.get('url_signing_keys', None) - self.delivery_policy = kwargs.get('delivery_policy', None) - self.web_application_firewall_policy_link = kwargs.get('web_application_firewall_policy_link', None) - + super(CustomDomainParameters, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) -class EndpointProperties(EndpointPropertiesUpdateParameters): - """The JSON object that contains the properties required to create an endpoint. - Variables are only populated by the server, and will be ignored when sending a request. +class CustomerCertificate(Certificate): + """Customer Certificate used for https. All required parameters must be populated in order to send to Azure. - :param origin_path: A directory path on the origin that CDN can use to retrieve content from, - e.g. contoso.cloudapp.net/originpath. - :type origin_path: str - :param content_types_to_compress: List of content types on which compression applies. The value - should be a valid MIME type. - :type content_types_to_compress: list[str] - :param origin_host_header: The host header value sent to the origin with each request. This - property at Endpoint is only allowed when endpoint uses single origin and can be overridden by - the same property specified at origin.If you leave this blank, the request hostname determines - this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this - host header value to match the origin hostname by default. - :type origin_host_header: str - :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default - value is false. If compression is enabled, content will be served as compressed if user - requests for a compressed version. Content won't be compressed on CDN when requested content is - smaller than 1 byte or larger than 1 MB. - :type is_compression_enabled: bool - :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_http_allowed: bool - :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_https_allowed: bool - :param query_string_caching_behavior: Defines how CDN caches requests that include query - strings. You can ignore any query strings when caching, bypass caching to prevent requests that - contain query strings from being cached, or cache every request with a unique URL. Possible - values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". - :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior - :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to - optimize for, e.g. Download, Media services. With this information, CDN can apply scenario - driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", - "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". - :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType - :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the - dynamic content and calculate the most optimal routes for the CDN. This is relative to the - origin path. This property is only relevant when using a single origin. - :type probe_path: str - :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each - geo filter defines an access rule to a specified path or content, e.g. block APAC for path - /pictures/. - :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] - :param default_origin_group: A reference to the origin group. - :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference - :param url_signing_keys: List of keys used to validate the signed URL hashes. - :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] - :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. - :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy - :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for - the endpoint (if applicable). - :type web_application_firewall_policy_link: - ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink - :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. - contoso.azureedge.net. - :vartype host_name: str - :param origins: Required. The source of the content being delivered via CDN. - :type origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin] - :param origin_groups: The origin groups comprising of origins that are used for load balancing - the traffic based on availability. - :type origin_groups: list[~azure.mgmt.cdn.models.DeepCreatedOriginGroup] - :ivar resource_state: Resource status of the endpoint. Possible values include: "Creating", - "Deleting", "Running", "Starting", "Stopped", "Stopping". - :vartype resource_state: str or ~azure.mgmt.cdn.models.EndpointResourceState - :ivar provisioning_state: Provisioning status of the endpoint. - :vartype provisioning_state: str + :param subject: Subject name in the certificate. + :type subject: str + :param expiration_date: Certificate expiration date. + :type expiration_date: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str + :param version: Certificate version. + :type version: str + :param certificate_authority: Certificate issuing authority. + :type certificate_authority: str + :param certificate_url: Required. Complete Url to the certificate. + :type certificate_url: str + :param use_latest_version: Whether to use the latest version for the certificate. + :type use_latest_version: bool + :param subject_alternative_names: The list of SANs. + :type subject_alternative_names: list[str] """ _validation = { - 'host_name': {'readonly': True}, - 'origins': {'required': True}, - 'resource_state': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + 'certificate_url': {'required': True}, } _attribute_map = { - 'origin_path': {'key': 'originPath', 'type': 'str'}, - 'content_types_to_compress': {'key': 'contentTypesToCompress', 'type': '[str]'}, - 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, - 'is_compression_enabled': {'key': 'isCompressionEnabled', 'type': 'bool'}, - 'is_http_allowed': {'key': 'isHttpAllowed', 'type': 'bool'}, - 'is_https_allowed': {'key': 'isHttpsAllowed', 'type': 'bool'}, - 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, - 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, - 'probe_path': {'key': 'probePath', 'type': 'str'}, - 'geo_filters': {'key': 'geoFilters', 'type': '[GeoFilter]'}, - 'default_origin_group': {'key': 'defaultOriginGroup', 'type': 'ResourceReference'}, - 'url_signing_keys': {'key': 'urlSigningKeys', 'type': '[UrlSigningKey]'}, - 'delivery_policy': {'key': 'deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, - 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'origins': {'key': 'origins', 'type': '[DeepCreatedOrigin]'}, - 'origin_groups': {'key': 'originGroups', 'type': '[DeepCreatedOriginGroup]'}, - 'resource_state': {'key': 'resourceState', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'certificate_authority': {'key': 'certificateAuthority', 'type': 'str'}, + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + 'use_latest_version': {'key': 'useLatestVersion', 'type': 'bool'}, + 'subject_alternative_names': {'key': 'subjectAlternativeNames', 'type': '[str]'}, } def __init__( self, **kwargs ): - super(EndpointProperties, self).__init__(**kwargs) - self.host_name = None - self.origins = kwargs['origins'] - self.origin_groups = kwargs.get('origin_groups', None) - self.resource_state = None - self.provisioning_state = None + super(CustomerCertificate, self).__init__(**kwargs) + self.version = kwargs.get('version', None) + self.certificate_authority = kwargs.get('certificate_authority', None) + self.certificate_url = kwargs['certificate_url'] + self.use_latest_version = kwargs.get('use_latest_version', None) + self.subject_alternative_names = kwargs.get('subject_alternative_names', None) -class EndpointPropertiesUpdateParametersDeliveryPolicy(msrest.serialization.Model): - """A policy that specifies the delivery rules to be used for an endpoint. +class SecretParameters(msrest.serialization.Model): + """The json object containing secret parameters. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CustomerCertificateParameters, ManagedCertificateParameters, UrlSigningKeyParameters. All required parameters must be populated in order to send to Azure. - :param description: User-friendly description of the policy. - :type description: str - :param rules: Required. A list of the delivery rules. - :type rules: list[~azure.mgmt.cdn.models.DeliveryRule] + :param type: Required. The type of the Secret to create.Constant filled by server. Possible + values include: "UrlSigningKey", "CustomerCertificate", "ManagedCertificate". + :type type: str or ~azure.mgmt.cdn.models.SecretType """ _validation = { - 'rules': {'required': True}, + 'type': {'required': True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[DeliveryRule]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'CustomerCertificate': 'CustomerCertificateParameters', 'ManagedCertificate': 'ManagedCertificateParameters', 'UrlSigningKey': 'UrlSigningKeyParameters'} } def __init__( self, **kwargs ): - super(EndpointPropertiesUpdateParametersDeliveryPolicy, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.rules = kwargs['rules'] + super(SecretParameters, self).__init__(**kwargs) + self.type = None # type: Optional[str] -class EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink(msrest.serialization.Model): - """Defines the Web Application Firewall policy for the endpoint (if applicable). +class CustomerCertificateParameters(SecretParameters, Certificate): + """Customer Certificate used for https. - :param id: Resource ID. - :type id: str + All required parameters must be populated in order to send to Azure. + + :param subject: Subject name in the certificate. + :type subject: str + :param expiration_date: Certificate expiration date. + :type expiration_date: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str + :param type: Required. The type of the Secret to create.Constant filled by server. Possible + values include: "UrlSigningKey", "CustomerCertificate", "ManagedCertificate". + :type type: str or ~azure.mgmt.cdn.models.SecretType + :param secret_source: Required. Resource reference to the KV secret. + :type secret_source: ~azure.mgmt.cdn.models.ResourceReference + :param secret_version: Version of the secret to be used. + :type secret_version: str + :param certificate_authority: Certificate issuing authority. + :type certificate_authority: str + :param use_latest_version: Whether to use the latest version for the certificate. + :type use_latest_version: bool + :param subject_alternative_names: The list of SANs. + :type subject_alternative_names: list[str] """ + _validation = { + 'type': {'required': True}, + 'secret_source': {'required': True}, + } + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'secret_source': {'key': 'secretSource', 'type': 'ResourceReference'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + 'certificate_authority': {'key': 'certificateAuthority', 'type': 'str'}, + 'use_latest_version': {'key': 'useLatestVersion', 'type': 'bool'}, + 'subject_alternative_names': {'key': 'subjectAlternativeNames', 'type': '[str]'}, } def __init__( self, **kwargs ): - super(EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink, self).__init__(**kwargs) - self.id = kwargs.get('id', None) + super(CustomerCertificateParameters, self).__init__(**kwargs) + self.subject = kwargs.get('subject', None) + self.expiration_date = kwargs.get('expiration_date', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.type = 'CustomerCertificate' # type: str + self.secret_source = kwargs['secret_source'] + self.secret_version = kwargs.get('secret_version', None) + self.certificate_authority = kwargs.get('certificate_authority', None) + self.use_latest_version = kwargs.get('use_latest_version', None) + self.subject_alternative_names = kwargs.get('subject_alternative_names', None) + self.type = 'CustomerCertificate' # type: str + self.secret_source = kwargs['secret_source'] + self.secret_version = kwargs.get('secret_version', None) + self.certificate_authority = kwargs.get('certificate_authority', None) + self.use_latest_version = kwargs.get('use_latest_version', None) + self.subject_alternative_names = kwargs.get('subject_alternative_names', None) -class EndpointUpdateParameters(msrest.serialization.Model): - """Properties required to create or update an endpoint. +class CustomRule(msrest.serialization.Model): + """Defines the common attributes for a custom rule that can be included in a waf policy. - :param tags: A set of tags. Endpoint tags. - :type tags: dict[str, str] - :param origin_path: A directory path on the origin that CDN can use to retrieve content from, - e.g. contoso.cloudapp.net/originpath. - :type origin_path: str - :param content_types_to_compress: List of content types on which compression applies. The value - should be a valid MIME type. - :type content_types_to_compress: list[str] - :param origin_host_header: The host header value sent to the origin with each request. This - property at Endpoint is only allowed when endpoint uses single origin and can be overridden by - the same property specified at origin.If you leave this blank, the request hostname determines - this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this - host header value to match the origin hostname by default. - :type origin_host_header: str - :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default - value is false. If compression is enabled, content will be served as compressed if user - requests for a compressed version. Content won't be compressed on CDN when requested content is - smaller than 1 byte or larger than 1 MB. - :type is_compression_enabled: bool - :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_http_allowed: bool - :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_https_allowed: bool - :param query_string_caching_behavior: Defines how CDN caches requests that include query - strings. You can ignore any query strings when caching, bypass caching to prevent requests that - contain query strings from being cached, or cache every request with a unique URL. Possible - values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". - :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior - :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to - optimize for, e.g. Download, Media services. With this information, CDN can apply scenario - driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", - "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". - :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType - :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the - dynamic content and calculate the most optimal routes for the CDN. This is relative to the - origin path. This property is only relevant when using a single origin. - :type probe_path: str - :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each - geo filter defines an access rule to a specified path or content, e.g. block APAC for path - /pictures/. - :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] - :param default_origin_group: A reference to the origin group. - :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference - :param url_signing_keys: List of keys used to validate the signed URL hashes. - :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] - :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. - :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy - :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for - the endpoint (if applicable). - :type web_application_firewall_policy_link: - ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink - """ + All required parameters must be populated in order to send to Azure. - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, - 'content_types_to_compress': {'key': 'properties.contentTypesToCompress', 'type': '[str]'}, - 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, - 'is_compression_enabled': {'key': 'properties.isCompressionEnabled', 'type': 'bool'}, - 'is_http_allowed': {'key': 'properties.isHttpAllowed', 'type': 'bool'}, - 'is_https_allowed': {'key': 'properties.isHttpsAllowed', 'type': 'bool'}, - 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, - 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, - 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, - 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, - 'default_origin_group': {'key': 'properties.defaultOriginGroup', 'type': 'ResourceReference'}, - 'url_signing_keys': {'key': 'properties.urlSigningKeys', 'type': '[UrlSigningKey]'}, - 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, - 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + :param name: Required. Defines the name of the custom rule. + :type name: str + :param enabled_state: Describes if the custom rule is in enabled or disabled state. Defaults to + Enabled if not specified. Possible values include: "Disabled", "Enabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.CustomRuleEnabledState + :param priority: Required. Defines in what order this rule be evaluated in the overall list of + custom rules. + :type priority: int + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.cdn.models.MatchCondition] + :param action: Required. Describes what action to be applied when rule matches. Possible values + include: "Allow", "Block", "Log", "Redirect". + :type action: str or ~azure.mgmt.cdn.models.ActionType + """ + + _validation = { + 'name': {'required': True}, + 'priority': {'required': True, 'maximum': 1000, 'minimum': 0}, + 'match_conditions': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, + 'action': {'key': 'action', 'type': 'str'}, } def __init__( self, **kwargs ): - super(EndpointUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.origin_path = kwargs.get('origin_path', None) - self.content_types_to_compress = kwargs.get('content_types_to_compress', None) - self.origin_host_header = kwargs.get('origin_host_header', None) - self.is_compression_enabled = kwargs.get('is_compression_enabled', None) - self.is_http_allowed = kwargs.get('is_http_allowed', None) - self.is_https_allowed = kwargs.get('is_https_allowed', None) - self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) - self.optimization_type = kwargs.get('optimization_type', None) - self.probe_path = kwargs.get('probe_path', None) - self.geo_filters = kwargs.get('geo_filters', None) - self.default_origin_group = kwargs.get('default_origin_group', None) - self.url_signing_keys = kwargs.get('url_signing_keys', None) - self.delivery_policy = kwargs.get('delivery_policy', None) - self.web_application_firewall_policy_link = kwargs.get('web_application_firewall_policy_link', None) + super(CustomRule, self).__init__(**kwargs) + self.name = kwargs['name'] + self.enabled_state = kwargs.get('enabled_state', None) + self.priority = kwargs['priority'] + self.match_conditions = kwargs['match_conditions'] + self.action = kwargs['action'] -class ErrorResponse(msrest.serialization.Model): - """Error response indicates CDN service is not able to process the incoming request. The reason is provided in the error message. +class CustomRuleList(msrest.serialization.Model): + """Defines contents of custom rules. - Variables are only populated by the server, and will be ignored when sending a request. + :param rules: List of rules. + :type rules: list[~azure.mgmt.cdn.models.CustomRule] + """ - :ivar code: Error code. - :vartype code: str - :ivar message: Error message indicating why the operation failed. - :vartype message: str + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[CustomRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomRuleList, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + + +class DeepCreatedOrigin(msrest.serialization.Model): + """The main origin of CDN content which is added when creating a CDN endpoint. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Origin name which must be unique within the endpoint. + :type name: str + :param host_name: The address of the origin. It can be a domain name, IPv4 address, or IPv6 + address. This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param enabled: Origin is enabled for load balancing or not. By default, origin is always + enabled. + :type enabled: bool + :param private_link_alias: The Alias of the Private Link resource. Populating this optional + field indicates that this origin 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 + :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 """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + 'name': {'required': True}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'weight': {'key': 'properties.weight', 'type': 'int'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, + 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.code = None - self.message = None + super(DeepCreatedOrigin, self).__init__(**kwargs) + self.name = kwargs['name'] + self.host_name = kwargs.get('host_name', None) + self.http_port = kwargs.get('http_port', None) + self.https_port = kwargs.get('https_port', None) + self.origin_host_header = kwargs.get('origin_host_header', None) + self.priority = kwargs.get('priority', None) + self.weight = kwargs.get('weight', None) + self.enabled = kwargs.get('enabled', 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_link_approval_message = kwargs.get('private_link_approval_message', None) -class GeoFilter(msrest.serialization.Model): - """Rules defining user's geo access within a CDN endpoint. +class DeepCreatedOriginGroup(msrest.serialization.Model): + """The origin group for CDN content which is added when creating a CDN endpoint. Traffic is sent to the origins within the origin group based on origin health. All required parameters must be populated in order to send to Azure. - :param relative_path: Required. Relative path applicable to geo filter. (e.g. '/mypictures', - '/mypicture/kitty.jpg', and etc.). - :type relative_path: str - :param action: Required. Action of the geo filter, i.e. allow or block access. Possible values - include: "Block", "Allow". - :type action: str or ~azure.mgmt.cdn.models.GeoFilterActions - :param country_codes: Required. Two letter country codes defining user country access in a geo - filter, e.g. AU, MX, US. - :type country_codes: list[str] + :param name: Required. Origin group name which must be unique within the endpoint. + :type name: str + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param origins: The source of the content being delivered via CDN within given origin group. + :type origins: list[~azure.mgmt.cdn.models.ResourceReference] + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses.This property is currently + not supported. + :type response_based_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters """ _validation = { - 'relative_path': {'required': True}, - 'action': {'required': True}, - 'country_codes': {'required': True}, + 'name': {'required': True}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, } _attribute_map = { - 'relative_path': {'key': 'relativePath', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'country_codes': {'key': 'countryCodes', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, } def __init__( self, **kwargs ): - super(GeoFilter, self).__init__(**kwargs) - self.relative_path = kwargs['relative_path'] - self.action = kwargs['action'] - self.country_codes = kwargs['country_codes'] - + super(DeepCreatedOriginGroup, self).__init__(**kwargs) + self.name = kwargs['name'] + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.origins = kwargs.get('origins', None) + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) + self.response_based_origin_error_detection_settings = kwargs.get('response_based_origin_error_detection_settings', None) -class HeaderActionParameters(msrest.serialization.Model): - """Defines the parameters for the request header action. - Variables are only populated by the server, and will be ignored when sending a request. +class DeliveryRule(msrest.serialization.Model): + """A rule that specifies a set of actions and conditions. All required parameters must be populated in order to send to Azure. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters". - :vartype odata_type: str - :param header_action: Required. Action to perform. Possible values include: "Append", - "Overwrite", "Delete". - :type header_action: str or ~azure.mgmt.cdn.models.HeaderAction - :param header_name: Required. Name of the header to modify. - :type header_name: str - :param value: Value for the specified action. - :type value: str + :param name: Name of the rule. + :type name: str + :param order: Required. The order in which the rules are applied for the endpoint. Possible + values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater + order. Rule with order 0 is a special rule. It does not require any condition and actions + listed in it will always be applied. + :type order: int + :param conditions: A list of conditions that must be matched for the actions to be executed. + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + :param actions: Required. A list of actions that are executed when all the conditions of a rule + are satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'header_action': {'required': True}, - 'header_name': {'required': True}, + 'order': {'required': True}, + 'actions': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'conditions': {'key': 'conditions', 'type': '[DeliveryRuleCondition]'}, + 'actions': {'key': 'actions', 'type': '[DeliveryRuleAction]'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.order = kwargs['order'] + self.conditions = kwargs.get('conditions', None) + self.actions = kwargs['actions'] + + +class DeliveryRuleAction(msrest.serialization.Model): + """An action for the delivery rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DeliveryRuleCacheExpirationAction, DeliveryRuleCacheKeyQueryStringAction, DeliveryRuleRequestHeaderAction, DeliveryRuleResponseHeaderAction, OriginGroupOverrideAction, UrlRedirectAction, UrlRewriteAction, UrlSigningAction. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'name': {'CacheExpiration': 'DeliveryRuleCacheExpirationAction', 'CacheKeyQueryString': 'DeliveryRuleCacheKeyQueryStringAction', 'ModifyRequestHeader': 'DeliveryRuleRequestHeaderAction', 'ModifyResponseHeader': 'DeliveryRuleResponseHeaderAction', 'OriginGroupOverride': 'OriginGroupOverrideAction', 'UrlRedirect': 'UrlRedirectAction', 'UrlRewrite': 'UrlRewriteAction', 'UrlSigning': 'UrlSigningAction'} + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleAction, self).__init__(**kwargs) + self.name = None # type: Optional[str] + + +class DeliveryRuleCacheExpirationAction(DeliveryRuleAction): + """Defines the cache expiration action for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.CacheExpirationActionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'CacheExpirationActionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleCacheExpirationAction, self).__init__(**kwargs) + self.name = 'CacheExpiration' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleCacheKeyQueryStringAction(DeliveryRuleAction): + """Defines the cache-key query string action for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.CacheKeyQueryStringActionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'CacheKeyQueryStringActionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleCacheKeyQueryStringAction, self).__init__(**kwargs) + self.name = 'CacheKeyQueryString' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleCondition(msrest.serialization.Model): + """A condition for the delivery rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DeliveryRuleCookiesCondition, DeliveryRuleHttpVersionCondition, DeliveryRuleIsDeviceCondition, DeliveryRulePostArgsCondition, DeliveryRuleQueryStringCondition, DeliveryRuleRemoteAddressCondition, DeliveryRuleRequestBodyCondition, DeliveryRuleRequestHeaderCondition, DeliveryRuleRequestMethodCondition, DeliveryRuleRequestSchemeCondition, DeliveryRuleRequestUriCondition, DeliveryRuleUrlFileExtensionCondition, DeliveryRuleUrlFileNameCondition, DeliveryRuleUrlPathCondition. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'name': {'Cookies': 'DeliveryRuleCookiesCondition', 'HttpVersion': 'DeliveryRuleHttpVersionCondition', 'IsDevice': 'DeliveryRuleIsDeviceCondition', 'PostArgs': 'DeliveryRulePostArgsCondition', 'QueryString': 'DeliveryRuleQueryStringCondition', 'RemoteAddress': 'DeliveryRuleRemoteAddressCondition', 'RequestBody': 'DeliveryRuleRequestBodyCondition', 'RequestHeader': 'DeliveryRuleRequestHeaderCondition', 'RequestMethod': 'DeliveryRuleRequestMethodCondition', 'RequestScheme': 'DeliveryRuleRequestSchemeCondition', 'RequestUri': 'DeliveryRuleRequestUriCondition', 'UrlFileExtension': 'DeliveryRuleUrlFileExtensionCondition', 'UrlFileName': 'DeliveryRuleUrlFileNameCondition', 'UrlPath': 'DeliveryRuleUrlPathCondition'} + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleCondition, self).__init__(**kwargs) + self.name = None # type: Optional[str] + + +class DeliveryRuleCookiesCondition(DeliveryRuleCondition): + """Defines the Cookies condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.CookiesMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'CookiesMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleCookiesCondition, self).__init__(**kwargs) + self.name = 'Cookies' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleHttpVersionCondition(DeliveryRuleCondition): + """Defines the HttpVersion condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.HttpVersionMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'HttpVersionMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleHttpVersionCondition, self).__init__(**kwargs) + self.name = 'HttpVersion' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleIsDeviceCondition(DeliveryRuleCondition): + """Defines the IsDevice condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.IsDeviceMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'IsDeviceMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleIsDeviceCondition, self).__init__(**kwargs) + self.name = 'IsDevice' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRulePostArgsCondition(DeliveryRuleCondition): + """Defines the PostArgs condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.PostArgsMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'PostArgsMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRulePostArgsCondition, self).__init__(**kwargs) + self.name = 'PostArgs' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleQueryStringCondition(DeliveryRuleCondition): + """Defines the QueryString condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.QueryStringMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'QueryStringMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleQueryStringCondition, self).__init__(**kwargs) + self.name = 'QueryString' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleRemoteAddressCondition(DeliveryRuleCondition): + """Defines the RemoteAddress condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RemoteAddressMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RemoteAddressMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleRemoteAddressCondition, self).__init__(**kwargs) + self.name = 'RemoteAddress' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleRequestBodyCondition(DeliveryRuleCondition): + """Defines the RequestBody condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RequestBodyMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RequestBodyMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleRequestBodyCondition, self).__init__(**kwargs) + self.name = 'RequestBody' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleRequestHeaderAction(DeliveryRuleAction): + """Defines the request header action for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.HeaderActionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'HeaderActionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleRequestHeaderAction, self).__init__(**kwargs) + self.name = 'ModifyRequestHeader' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleRequestHeaderCondition(DeliveryRuleCondition): + """Defines the RequestHeader condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RequestHeaderMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RequestHeaderMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleRequestHeaderCondition, self).__init__(**kwargs) + self.name = 'RequestHeader' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleRequestMethodCondition(DeliveryRuleCondition): + """Defines the RequestMethod condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RequestMethodMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RequestMethodMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleRequestMethodCondition, self).__init__(**kwargs) + self.name = 'RequestMethod' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleRequestSchemeCondition(DeliveryRuleCondition): + """Defines the RequestScheme condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RequestSchemeMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleRequestSchemeCondition, self).__init__(**kwargs) + self.name = 'RequestScheme' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleRequestUriCondition(DeliveryRuleCondition): + """Defines the RequestUri condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RequestUriMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RequestUriMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleRequestUriCondition, self).__init__(**kwargs) + self.name = 'RequestUri' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleResponseHeaderAction(DeliveryRuleAction): + """Defines the response header action for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.HeaderActionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'HeaderActionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleResponseHeaderAction, self).__init__(**kwargs) + self.name = 'ModifyResponseHeader' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleUrlFileExtensionCondition(DeliveryRuleCondition): + """Defines the UrlFileExtension condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.UrlFileExtensionMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'UrlFileExtensionMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleUrlFileExtensionCondition, self).__init__(**kwargs) + self.name = 'UrlFileExtension' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleUrlFileNameCondition(DeliveryRuleCondition): + """Defines the UrlFileName condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.UrlFileNameMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'UrlFileNameMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleUrlFileNameCondition, self).__init__(**kwargs) + self.name = 'UrlFileName' # type: str + self.parameters = kwargs['parameters'] + + +class DeliveryRuleUrlPathCondition(DeliveryRuleCondition): + """Defines the UrlPath condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.UrlPathMatchConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'UrlPathMatchConditionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(DeliveryRuleUrlPathCondition, self).__init__(**kwargs) + self.name = 'UrlPath' # type: str + self.parameters = kwargs['parameters'] + + +class DomainValidationProperties(msrest.serialization.Model): + """The JSON object that contains the properties to validate a domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar validation_token: Challenge used for DNS TXT record or file based validation. + :vartype validation_token: str + :ivar expiration_date: The date time that the token expires. + :vartype expiration_date: str + """ + + _validation = { + 'validation_token': {'readonly': True}, + 'expiration_date': {'readonly': True}, + } + + _attribute_map = { + 'validation_token': {'key': 'validationToken', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainValidationProperties, self).__init__(**kwargs) + self.validation_token = None + self.expiration_date = None + + +class EdgeNode(ProxyResource): + """Edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param ip_address_groups: List of ip address groups. + :type ip_address_groups: list[~azure.mgmt.cdn.models.IpAddressGroup] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'ip_address_groups': {'key': 'properties.ipAddressGroups', 'type': '[IpAddressGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeNode, self).__init__(**kwargs) + self.ip_address_groups = kwargs.get('ip_address_groups', None) + + +class EdgenodeResult(msrest.serialization.Model): + """Result of the request to list CDN edgenodes. It contains a list of ip address group and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Edge node of CDN service. + :vartype value: list[~azure.mgmt.cdn.models.EdgeNode] + :param next_link: URL to get the next set of edgenode list results if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EdgeNode]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgenodeResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class Endpoint(TrackedResource): + """CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format :code:``.azureedge.net. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param origin_path: A directory path on the origin that CDN can use to retrieve content from, + e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param content_types_to_compress: List of content types on which compression applies. The value + should be a valid MIME type. + :type content_types_to_compress: list[str] + :param origin_host_header: The host header value sent to the origin with each request. This + property at Endpoint is only allowed when endpoint uses single origin and can be overridden by + the same property specified at origin.If you leave this blank, the request hostname determines + this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this + host header value to match the origin hostname by default. + :type origin_host_header: str + :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default + value is false. If compression is enabled, content will be served as compressed if user + requests for a compressed version. Content won't be compressed on CDN when requested content is + smaller than 1 byte or larger than 1 MB. + :type is_compression_enabled: bool + :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_http_allowed: bool + :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_https_allowed: bool + :param query_string_caching_behavior: Defines how CDN caches requests that include query + strings. You can ignore any query strings when caching, bypass caching to prevent requests that + contain query strings from being cached, or cache every request with a unique URL. Possible + values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to + optimize for, e.g. Download, Media services. With this information, CDN can apply scenario + driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", + "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the + dynamic content and calculate the most optimal routes for the CDN. This is relative to the + origin path. This property is only relevant when using a single origin. + :type probe_path: str + :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each + geo filter defines an access rule to a specified path or content, e.g. block APAC for path + /pictures/. + :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param default_origin_group: A reference to the origin group. + :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param url_signing_keys: List of keys used to validate the signed URL hashes. + :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] + :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. + :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy + :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for + the endpoint (if applicable). + :type web_application_firewall_policy_link: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + contoso.azureedge.net. + :vartype host_name: str + :param origins: The source of the content being delivered via CDN. + :type origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin] + :param origin_groups: The origin groups comprising of origins that are used for load balancing + the traffic based on availability. + :type origin_groups: list[~azure.mgmt.cdn.models.DeepCreatedOriginGroup] + :ivar resource_state: Resource status of the endpoint. Possible values include: "Creating", + "Deleting", "Running", "Starting", "Stopped", "Stopping". + :vartype resource_state: str or ~azure.mgmt.cdn.models.EndpointResourceState + :ivar provisioning_state: Provisioning status of the endpoint. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'host_name': {'readonly': True}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, + 'content_types_to_compress': {'key': 'properties.contentTypesToCompress', 'type': '[str]'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'is_compression_enabled': {'key': 'properties.isCompressionEnabled', 'type': 'bool'}, + 'is_http_allowed': {'key': 'properties.isHttpAllowed', 'type': 'bool'}, + 'is_https_allowed': {'key': 'properties.isHttpsAllowed', 'type': 'bool'}, + 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, + 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, + 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, + 'default_origin_group': {'key': 'properties.defaultOriginGroup', 'type': 'ResourceReference'}, + 'url_signing_keys': {'key': 'properties.urlSigningKeys', 'type': '[UrlSigningKey]'}, + 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, + 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'origins': {'key': 'properties.origins', 'type': '[DeepCreatedOrigin]'}, + 'origin_groups': {'key': 'properties.originGroups', 'type': '[DeepCreatedOriginGroup]'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Endpoint, self).__init__(**kwargs) + self.origin_path = kwargs.get('origin_path', None) + self.content_types_to_compress = kwargs.get('content_types_to_compress', None) + self.origin_host_header = kwargs.get('origin_host_header', None) + self.is_compression_enabled = kwargs.get('is_compression_enabled', None) + self.is_http_allowed = kwargs.get('is_http_allowed', None) + self.is_https_allowed = kwargs.get('is_https_allowed', None) + self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) + self.optimization_type = kwargs.get('optimization_type', None) + self.probe_path = kwargs.get('probe_path', None) + self.geo_filters = kwargs.get('geo_filters', None) + self.default_origin_group = kwargs.get('default_origin_group', None) + self.url_signing_keys = kwargs.get('url_signing_keys', None) + self.delivery_policy = kwargs.get('delivery_policy', None) + self.web_application_firewall_policy_link = kwargs.get('web_application_firewall_policy_link', None) + self.host_name = None + self.origins = kwargs.get('origins', None) + self.origin_groups = kwargs.get('origin_groups', None) + self.resource_state = None + self.provisioning_state = None + + +class EndpointListResult(msrest.serialization.Model): + """Result of the request to list endpoints. It contains a list of endpoint objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of CDN endpoints within a profile. + :vartype value: list[~azure.mgmt.cdn.models.Endpoint] + :param next_link: URL to get the next set of endpoint objects if there is any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Endpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class EndpointPropertiesUpdateParameters(msrest.serialization.Model): + """The JSON object containing endpoint update parameters. + + :param origin_path: A directory path on the origin that CDN can use to retrieve content from, + e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param content_types_to_compress: List of content types on which compression applies. The value + should be a valid MIME type. + :type content_types_to_compress: list[str] + :param origin_host_header: The host header value sent to the origin with each request. This + property at Endpoint is only allowed when endpoint uses single origin and can be overridden by + the same property specified at origin.If you leave this blank, the request hostname determines + this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this + host header value to match the origin hostname by default. + :type origin_host_header: str + :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default + value is false. If compression is enabled, content will be served as compressed if user + requests for a compressed version. Content won't be compressed on CDN when requested content is + smaller than 1 byte or larger than 1 MB. + :type is_compression_enabled: bool + :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_http_allowed: bool + :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_https_allowed: bool + :param query_string_caching_behavior: Defines how CDN caches requests that include query + strings. You can ignore any query strings when caching, bypass caching to prevent requests that + contain query strings from being cached, or cache every request with a unique URL. Possible + values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to + optimize for, e.g. Download, Media services. With this information, CDN can apply scenario + driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", + "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the + dynamic content and calculate the most optimal routes for the CDN. This is relative to the + origin path. This property is only relevant when using a single origin. + :type probe_path: str + :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each + geo filter defines an access rule to a specified path or content, e.g. block APAC for path + /pictures/. + :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param default_origin_group: A reference to the origin group. + :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param url_signing_keys: List of keys used to validate the signed URL hashes. + :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] + :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. + :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy + :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for + the endpoint (if applicable). + :type web_application_firewall_policy_link: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + """ + + _attribute_map = { + 'origin_path': {'key': 'originPath', 'type': 'str'}, + 'content_types_to_compress': {'key': 'contentTypesToCompress', 'type': '[str]'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'is_compression_enabled': {'key': 'isCompressionEnabled', 'type': 'bool'}, + 'is_http_allowed': {'key': 'isHttpAllowed', 'type': 'bool'}, + 'is_https_allowed': {'key': 'isHttpsAllowed', 'type': 'bool'}, + 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, + 'probe_path': {'key': 'probePath', 'type': 'str'}, + 'geo_filters': {'key': 'geoFilters', 'type': '[GeoFilter]'}, + 'default_origin_group': {'key': 'defaultOriginGroup', 'type': 'ResourceReference'}, + 'url_signing_keys': {'key': 'urlSigningKeys', 'type': '[UrlSigningKey]'}, + 'delivery_policy': {'key': 'deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, + 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointPropertiesUpdateParameters, self).__init__(**kwargs) + self.origin_path = kwargs.get('origin_path', None) + self.content_types_to_compress = kwargs.get('content_types_to_compress', None) + self.origin_host_header = kwargs.get('origin_host_header', None) + self.is_compression_enabled = kwargs.get('is_compression_enabled', None) + self.is_http_allowed = kwargs.get('is_http_allowed', None) + self.is_https_allowed = kwargs.get('is_https_allowed', None) + self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) + self.optimization_type = kwargs.get('optimization_type', None) + self.probe_path = kwargs.get('probe_path', None) + self.geo_filters = kwargs.get('geo_filters', None) + self.default_origin_group = kwargs.get('default_origin_group', None) + self.url_signing_keys = kwargs.get('url_signing_keys', None) + self.delivery_policy = kwargs.get('delivery_policy', None) + self.web_application_firewall_policy_link = kwargs.get('web_application_firewall_policy_link', None) + + +class EndpointProperties(EndpointPropertiesUpdateParameters): + """The JSON object that contains the properties required to create an endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param origin_path: A directory path on the origin that CDN can use to retrieve content from, + e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param content_types_to_compress: List of content types on which compression applies. The value + should be a valid MIME type. + :type content_types_to_compress: list[str] + :param origin_host_header: The host header value sent to the origin with each request. This + property at Endpoint is only allowed when endpoint uses single origin and can be overridden by + the same property specified at origin.If you leave this blank, the request hostname determines + this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this + host header value to match the origin hostname by default. + :type origin_host_header: str + :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default + value is false. If compression is enabled, content will be served as compressed if user + requests for a compressed version. Content won't be compressed on CDN when requested content is + smaller than 1 byte or larger than 1 MB. + :type is_compression_enabled: bool + :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_http_allowed: bool + :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_https_allowed: bool + :param query_string_caching_behavior: Defines how CDN caches requests that include query + strings. You can ignore any query strings when caching, bypass caching to prevent requests that + contain query strings from being cached, or cache every request with a unique URL. Possible + values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to + optimize for, e.g. Download, Media services. With this information, CDN can apply scenario + driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", + "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the + dynamic content and calculate the most optimal routes for the CDN. This is relative to the + origin path. This property is only relevant when using a single origin. + :type probe_path: str + :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each + geo filter defines an access rule to a specified path or content, e.g. block APAC for path + /pictures/. + :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param default_origin_group: A reference to the origin group. + :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param url_signing_keys: List of keys used to validate the signed URL hashes. + :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] + :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. + :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy + :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for + the endpoint (if applicable). + :type web_application_firewall_policy_link: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + contoso.azureedge.net. + :vartype host_name: str + :param origins: Required. The source of the content being delivered via CDN. + :type origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin] + :param origin_groups: The origin groups comprising of origins that are used for load balancing + the traffic based on availability. + :type origin_groups: list[~azure.mgmt.cdn.models.DeepCreatedOriginGroup] + :ivar resource_state: Resource status of the endpoint. Possible values include: "Creating", + "Deleting", "Running", "Starting", "Stopped", "Stopping". + :vartype resource_state: str or ~azure.mgmt.cdn.models.EndpointResourceState + :ivar provisioning_state: Provisioning status of the endpoint. + :vartype provisioning_state: str + """ + + _validation = { + 'host_name': {'readonly': True}, + 'origins': {'required': True}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'origin_path': {'key': 'originPath', 'type': 'str'}, + 'content_types_to_compress': {'key': 'contentTypesToCompress', 'type': '[str]'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'is_compression_enabled': {'key': 'isCompressionEnabled', 'type': 'bool'}, + 'is_http_allowed': {'key': 'isHttpAllowed', 'type': 'bool'}, + 'is_https_allowed': {'key': 'isHttpsAllowed', 'type': 'bool'}, + 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, + 'probe_path': {'key': 'probePath', 'type': 'str'}, + 'geo_filters': {'key': 'geoFilters', 'type': '[GeoFilter]'}, + 'default_origin_group': {'key': 'defaultOriginGroup', 'type': 'ResourceReference'}, + 'url_signing_keys': {'key': 'urlSigningKeys', 'type': '[UrlSigningKey]'}, + 'delivery_policy': {'key': 'deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, + 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'origins': {'key': 'origins', 'type': '[DeepCreatedOrigin]'}, + 'origin_groups': {'key': 'originGroups', 'type': '[DeepCreatedOriginGroup]'}, + 'resource_state': {'key': 'resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointProperties, self).__init__(**kwargs) + self.host_name = None + self.origins = kwargs['origins'] + self.origin_groups = kwargs.get('origin_groups', None) + self.resource_state = None + self.provisioning_state = None + + +class EndpointPropertiesUpdateParametersDeliveryPolicy(msrest.serialization.Model): + """A policy that specifies the delivery rules to be used for an endpoint. + + All required parameters must be populated in order to send to Azure. + + :param description: User-friendly description of the policy. + :type description: str + :param rules: Required. A list of the delivery rules. + :type rules: list[~azure.mgmt.cdn.models.DeliveryRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[DeliveryRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointPropertiesUpdateParametersDeliveryPolicy, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.rules = kwargs['rules'] + + +class EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink(msrest.serialization.Model): + """Defines the Web Application Firewall policy for the endpoint (if applicable). + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class EndpointUpdateParameters(msrest.serialization.Model): + """Properties required to create or update an endpoint. + + :param tags: A set of tags. Endpoint tags. + :type tags: dict[str, str] + :param origin_path: A directory path on the origin that CDN can use to retrieve content from, + e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param content_types_to_compress: List of content types on which compression applies. The value + should be a valid MIME type. + :type content_types_to_compress: list[str] + :param origin_host_header: The host header value sent to the origin with each request. This + property at Endpoint is only allowed when endpoint uses single origin and can be overridden by + the same property specified at origin.If you leave this blank, the request hostname determines + this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this + host header value to match the origin hostname by default. + :type origin_host_header: str + :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default + value is false. If compression is enabled, content will be served as compressed if user + requests for a compressed version. Content won't be compressed on CDN when requested content is + smaller than 1 byte or larger than 1 MB. + :type is_compression_enabled: bool + :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_http_allowed: bool + :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_https_allowed: bool + :param query_string_caching_behavior: Defines how CDN caches requests that include query + strings. You can ignore any query strings when caching, bypass caching to prevent requests that + contain query strings from being cached, or cache every request with a unique URL. Possible + values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to + optimize for, e.g. Download, Media services. With this information, CDN can apply scenario + driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", + "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the + dynamic content and calculate the most optimal routes for the CDN. This is relative to the + origin path. This property is only relevant when using a single origin. + :type probe_path: str + :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each + geo filter defines an access rule to a specified path or content, e.g. block APAC for path + /pictures/. + :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param default_origin_group: A reference to the origin group. + :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param url_signing_keys: List of keys used to validate the signed URL hashes. + :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] + :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. + :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy + :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for + the endpoint (if applicable). + :type web_application_firewall_policy_link: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, + 'content_types_to_compress': {'key': 'properties.contentTypesToCompress', 'type': '[str]'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'is_compression_enabled': {'key': 'properties.isCompressionEnabled', 'type': 'bool'}, + 'is_http_allowed': {'key': 'properties.isHttpAllowed', 'type': 'bool'}, + 'is_https_allowed': {'key': 'properties.isHttpsAllowed', 'type': 'bool'}, + 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, + 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, + 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, + 'default_origin_group': {'key': 'properties.defaultOriginGroup', 'type': 'ResourceReference'}, + 'url_signing_keys': {'key': 'properties.urlSigningKeys', 'type': '[UrlSigningKey]'}, + 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, + 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.origin_path = kwargs.get('origin_path', None) + self.content_types_to_compress = kwargs.get('content_types_to_compress', None) + self.origin_host_header = kwargs.get('origin_host_header', None) + self.is_compression_enabled = kwargs.get('is_compression_enabled', None) + self.is_http_allowed = kwargs.get('is_http_allowed', None) + self.is_https_allowed = kwargs.get('is_https_allowed', None) + self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) + self.optimization_type = kwargs.get('optimization_type', None) + self.probe_path = kwargs.get('probe_path', None) + self.geo_filters = kwargs.get('geo_filters', None) + self.default_origin_group = kwargs.get('default_origin_group', None) + self.url_signing_keys = kwargs.get('url_signing_keys', None) + self.delivery_policy = kwargs.get('delivery_policy', None) + self.web_application_firewall_policy_link = kwargs.get('web_application_firewall_policy_link', None) + + +class ErrorResponse(msrest.serialization.Model): + """Error response indicates CDN service is not able to process the incoming request. The reason is provided in the error message. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + + +class GeoFilter(msrest.serialization.Model): + """Rules defining user's geo access within a CDN endpoint. + + All required parameters must be populated in order to send to Azure. + + :param relative_path: Required. Relative path applicable to geo filter. (e.g. '/mypictures', + '/mypicture/kitty.jpg', and etc.). + :type relative_path: str + :param action: Required. Action of the geo filter, i.e. allow or block access. Possible values + include: "Block", "Allow". + :type action: str or ~azure.mgmt.cdn.models.GeoFilterActions + :param country_codes: Required. Two letter country codes defining user country access in a geo + filter, e.g. AU, MX, US. + :type country_codes: list[str] + """ + + _validation = { + 'relative_path': {'required': True}, + 'action': {'required': True}, + 'country_codes': {'required': True}, + } + + _attribute_map = { + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'country_codes': {'key': 'countryCodes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoFilter, self).__init__(**kwargs) + self.relative_path = kwargs['relative_path'] + self.action = kwargs['action'] + self.country_codes = kwargs['country_codes'] + + +class HeaderActionParameters(msrest.serialization.Model): + """Defines the parameters for the request header action. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters". + :vartype odata_type: str + :param header_action: Required. Action to perform. Possible values include: "Append", + "Overwrite", "Delete". + :type header_action: str or ~azure.mgmt.cdn.models.HeaderAction + :param header_name: Required. Name of the header to modify. + :type header_name: str + :param value: Value for the specified action. + :type value: str + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'header_action': {'required': True}, + 'header_name': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'header_action': {'key': 'headerAction', 'type': 'str'}, + 'header_name': {'key': 'headerName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters" + + def __init__( + self, + **kwargs + ): + super(HeaderActionParameters, self).__init__(**kwargs) + self.header_action = kwargs['header_action'] + self.header_name = kwargs['header_name'] + self.value = kwargs.get('value', None) + + +class HealthProbeParameters(msrest.serialization.Model): + """The JSON object that contains the properties to send health probes to origin. + + :param probe_path: The path relative to the origin that is used to determine the health of the + origin. + :type probe_path: str + :param probe_request_type: The type of health probe request that is made. Possible values + include: "NotSet", "GET", "HEAD". + :type probe_request_type: str or ~azure.mgmt.cdn.models.HealthProbeRequestType + :param probe_protocol: Protocol to use for health probe. Possible values include: "NotSet", + "Http", "Https". + :type probe_protocol: str or ~azure.mgmt.cdn.models.ProbeProtocol + :param probe_interval_in_seconds: The number of seconds between health probes.Default is + 240sec. + :type probe_interval_in_seconds: int + """ + + _validation = { + 'probe_interval_in_seconds': {'maximum': 255, 'minimum': 1}, + } + + _attribute_map = { + 'probe_path': {'key': 'probePath', 'type': 'str'}, + 'probe_request_type': {'key': 'probeRequestType', 'type': 'str'}, + 'probe_protocol': {'key': 'probeProtocol', 'type': 'str'}, + 'probe_interval_in_seconds': {'key': 'probeIntervalInSeconds', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(HealthProbeParameters, self).__init__(**kwargs) + self.probe_path = kwargs.get('probe_path', None) + self.probe_request_type = kwargs.get('probe_request_type', None) + self.probe_protocol = kwargs.get('probe_protocol', None) + self.probe_interval_in_seconds = kwargs.get('probe_interval_in_seconds', None) + + +class HttpErrorRangeParameters(msrest.serialization.Model): + """The JSON object that represents the range for http status codes. + + :param begin: The inclusive start of the http status code range. + :type begin: int + :param end: The inclusive end of the http status code range. + :type end: int + """ + + _validation = { + 'begin': {'maximum': 999, 'minimum': 100}, + 'end': {'maximum': 999, 'minimum': 100}, + } + + _attribute_map = { + 'begin': {'key': 'begin', 'type': 'int'}, + 'end': {'key': 'end', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(HttpErrorRangeParameters, self).__init__(**kwargs) + self.begin = kwargs.get('begin', None) + self.end = kwargs.get('end', None) + + +class HttpVersionMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for HttpVersion match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Equal". + :type operator: str or ~azure.mgmt.cdn.models.HttpVersionOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters" + + def __init__( + self, + **kwargs + ): + super(HttpVersionMatchConditionParameters, self).__init__(**kwargs) + self.operator = kwargs['operator'] + self.negate_condition = kwargs.get('negate_condition', None) + self.match_values = kwargs.get('match_values', None) + + +class IpAddressGroup(msrest.serialization.Model): + """CDN Ip address group. + + :param delivery_region: The delivery region of the ip address group. + :type delivery_region: str + :param ipv4_addresses: The list of ip v4 addresses. + :type ipv4_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress] + :param ipv6_addresses: The list of ip v6 addresses. + :type ipv6_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress] + """ + + _attribute_map = { + 'delivery_region': {'key': 'deliveryRegion', 'type': 'str'}, + 'ipv4_addresses': {'key': 'ipv4Addresses', 'type': '[CidrIpAddress]'}, + 'ipv6_addresses': {'key': 'ipv6Addresses', 'type': '[CidrIpAddress]'}, + } + + def __init__( + self, + **kwargs + ): + super(IpAddressGroup, self).__init__(**kwargs) + self.delivery_region = kwargs.get('delivery_region', None) + self.ipv4_addresses = kwargs.get('ipv4_addresses', None) + self.ipv6_addresses = kwargs.get('ipv6_addresses', None) + + +class IsDeviceMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for IsDevice match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Equal". + :type operator: str or ~azure.mgmt.cdn.models.IsDeviceOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str or + ~azure.mgmt.cdn.models.IsDeviceMatchConditionParametersMatchValuesItem] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters" + + def __init__( + self, + **kwargs + ): + super(IsDeviceMatchConditionParameters, self).__init__(**kwargs) + self.operator = kwargs['operator'] + self.negate_condition = kwargs.get('negate_condition', None) + self.match_values = kwargs.get('match_values', None) + self.transforms = kwargs.get('transforms', None) + + +class KeyVaultCertificateSourceParameters(msrest.serialization.Model): + """Describes the parameters for using a user's KeyVault certificate for securing custom domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters". + :vartype odata_type: str + :param subscription_id: Required. Subscription Id of the user's Key Vault containing the SSL + certificate. + :type subscription_id: str + :param resource_group_name: Required. Resource group of the user's Key Vault containing the SSL + certificate. + :type resource_group_name: str + :param vault_name: Required. The name of the user's Key Vault containing the SSL certificate. + :type vault_name: str + :param secret_name: Required. The name of Key Vault Secret (representing the full certificate + PFX) in Key Vault. + :type secret_name: str + :param secret_version: The version(GUID) of Key Vault Secret in Key Vault. + :type secret_version: str + :param update_rule: Required. Describes the action that shall be taken when the certificate is + updated in Key Vault. Possible values include: "NoAction". + :type update_rule: str or ~azure.mgmt.cdn.models.UpdateRule + :param delete_rule: Required. Describes the action that shall be taken when the certificate is + removed from Key Vault. Possible values include: "NoAction". + :type delete_rule: str or ~azure.mgmt.cdn.models.DeleteRule + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'vault_name': {'required': True}, + 'secret_name': {'required': True}, + 'update_rule': {'required': True}, + 'delete_rule': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'vault_name': {'key': 'vaultName', 'type': 'str'}, + 'secret_name': {'key': 'secretName', 'type': 'str'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + 'update_rule': {'key': 'updateRule', 'type': 'str'}, + 'delete_rule': {'key': 'deleteRule', 'type': 'str'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters" + + def __init__( + self, + **kwargs + ): + super(KeyVaultCertificateSourceParameters, self).__init__(**kwargs) + self.subscription_id = kwargs['subscription_id'] + self.resource_group_name = kwargs['resource_group_name'] + self.vault_name = kwargs['vault_name'] + self.secret_name = kwargs['secret_name'] + self.secret_version = kwargs.get('secret_version', None) + self.update_rule = kwargs['update_rule'] + self.delete_rule = kwargs['delete_rule'] + + +class KeyVaultSigningKeyParameters(msrest.serialization.Model): + """Describes the parameters for using a user's KeyVault for URL Signing Key. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters". + :vartype odata_type: str + :param subscription_id: Required. Subscription Id of the user's Key Vault containing the + secret. + :type subscription_id: str + :param resource_group_name: Required. Resource group of the user's Key Vault containing the + secret. + :type resource_group_name: str + :param vault_name: Required. The name of the user's Key Vault containing the secret. + :type vault_name: str + :param secret_name: Required. The name of secret in Key Vault. + :type secret_name: str + :param secret_version: Required. The version(GUID) of secret in Key Vault. + :type secret_version: str + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'vault_name': {'required': True}, + 'secret_name': {'required': True}, + 'secret_version': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'vault_name': {'key': 'vaultName', 'type': 'str'}, + 'secret_name': {'key': 'secretName', 'type': 'str'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters" + + def __init__( + self, + **kwargs + ): + super(KeyVaultSigningKeyParameters, self).__init__(**kwargs) + self.subscription_id = kwargs['subscription_id'] + self.resource_group_name = kwargs['resource_group_name'] + self.vault_name = kwargs['vault_name'] + self.secret_name = kwargs['secret_name'] + self.secret_version = kwargs['secret_version'] + + +class LoadBalancingSettingsParameters(msrest.serialization.Model): + """Round-Robin load balancing settings for a backend pool. + + :param sample_size: The number of samples to consider for load balancing decisions. + :type sample_size: int + :param successful_samples_required: The number of samples within the sample period that must + succeed. + :type successful_samples_required: int + :param additional_latency_in_milliseconds: The additional latency in milliseconds for probes to + fall into the lowest latency bucket. + :type additional_latency_in_milliseconds: int + """ + + _attribute_map = { + 'sample_size': {'key': 'sampleSize', 'type': 'int'}, + 'successful_samples_required': {'key': 'successfulSamplesRequired', 'type': 'int'}, + 'additional_latency_in_milliseconds': {'key': 'additionalLatencyInMilliseconds', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancingSettingsParameters, self).__init__(**kwargs) + self.sample_size = kwargs.get('sample_size', None) + self.successful_samples_required = kwargs.get('successful_samples_required', None) + self.additional_latency_in_milliseconds = kwargs.get('additional_latency_in_milliseconds', None) + + +class LoadParameters(msrest.serialization.Model): + """Parameters required for content load. + + All required parameters must be populated in order to send to Azure. + + :param content_paths: Required. The path to the content to be loaded. Path should be a relative + file URL of the origin. + :type content_paths: list[str] + """ + + _validation = { + 'content_paths': {'required': True}, + } + + _attribute_map = { + 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadParameters, self).__init__(**kwargs) + self.content_paths = kwargs['content_paths'] + + +class ManagedCertificate(Certificate): + """Managed Certificate used for https. + + :param subject: Subject name in the certificate. + :type subject: str + :param expiration_date: Certificate expiration date. + :type expiration_date: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str + """ + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedCertificate, self).__init__(**kwargs) + + +class ManagedCertificateParameters(SecretParameters, Certificate): + """Managed Certificate used for https. + + All required parameters must be populated in order to send to Azure. + + :param subject: Subject name in the certificate. + :type subject: str + :param expiration_date: Certificate expiration date. + :type expiration_date: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str + :param type: Required. The type of the Secret to create.Constant filled by server. Possible + values include: "UrlSigningKey", "CustomerCertificate", "ManagedCertificate". + :type type: str or ~azure.mgmt.cdn.models.SecretType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedCertificateParameters, self).__init__(**kwargs) + self.subject = kwargs.get('subject', None) + self.expiration_date = kwargs.get('expiration_date', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.type = 'ManagedCertificate' # type: str + self.type = 'ManagedCertificate' # type: str + + +class ManagedRuleDefinition(msrest.serialization.Model): + """Describes a managed rule definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar rule_id: Identifier for the managed rule. + :vartype rule_id: str + :ivar description: Describes the functionality of the managed rule. + :vartype description: str + """ + + _validation = { + 'rule_id': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleDefinition, self).__init__(**kwargs) + self.rule_id = None + self.description = None + + +class ManagedRuleGroupDefinition(msrest.serialization.Model): + """Describes a managed rule group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar rule_group_name: Name of the managed rule group. + :vartype rule_group_name: str + :ivar description: Description of the managed rule group. + :vartype description: str + :ivar rules: List of rules within the managed rule group. + :vartype rules: list[~azure.mgmt.cdn.models.ManagedRuleDefinition] + """ + + _validation = { + 'rule_group_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rules': {'readonly': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ManagedRuleDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleGroupDefinition, self).__init__(**kwargs) + self.rule_group_name = None + self.description = None + self.rules = None + + +class ManagedRuleGroupOverride(msrest.serialization.Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. Describes the managed rule group within the rule set to + override. + :type rule_group_name: str + :param rules: List of rules that will be disabled. If none specified, all rules in the group + will be disabled. + :type rules: list[~azure.mgmt.cdn.models.ManagedRuleOverride] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ManagedRuleOverride]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleGroupOverride, self).__init__(**kwargs) + self.rule_group_name = kwargs['rule_group_name'] + self.rules = kwargs.get('rules', None) + + +class ManagedRuleOverride(msrest.serialization.Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. Identifier for the managed rule. + :type rule_id: str + :param enabled_state: Describes if the managed rule is in enabled or disabled state. Defaults + to Disabled if not specified. Possible values include: "Disabled", "Enabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.ManagedRuleEnabledState + :param action: Describes the override action to be applied when rule matches. Possible values + include: "Allow", "Block", "Log", "Redirect". + :type action: str or ~azure.mgmt.cdn.models.ActionType + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleOverride, self).__init__(**kwargs) + self.rule_id = kwargs['rule_id'] + self.enabled_state = kwargs.get('enabled_state', None) + self.action = kwargs.get('action', None) + + +class ManagedRuleSet(msrest.serialization.Model): + """Defines a managed rule set. + + All required parameters must be populated in order to send to Azure. + + :param rule_set_type: Required. Defines the rule set type to use. + :type rule_set_type: str + :param rule_set_version: Required. Defines the version of the rule set to use. + :type rule_set_version: str + :param anomaly_score: Verizon only : If the rule set supports anomaly detection mode, this + describes the threshold for blocking requests. + :type anomaly_score: int + :param rule_group_overrides: Defines the rule overrides to apply to the rule set. + :type rule_group_overrides: list[~azure.mgmt.cdn.models.ManagedRuleGroupOverride] + """ + + _validation = { + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'anomaly_score': {'maximum': 20, 'minimum': 0}, + } + + _attribute_map = { + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'anomaly_score': {'key': 'anomalyScore', 'type': 'int'}, + 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[ManagedRuleGroupOverride]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleSet, self).__init__(**kwargs) + self.rule_set_type = kwargs['rule_set_type'] + self.rule_set_version = kwargs['rule_set_version'] + self.anomaly_score = kwargs.get('anomaly_score', None) + self.rule_group_overrides = kwargs.get('rule_group_overrides', None) + + +class ManagedRuleSetDefinition(Resource): + """Describes a managed rule set definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param sku: The pricing tier (defines a CDN provider, feature list and rate) of the + CdnWebApplicationFirewallPolicy. + :type sku: ~azure.mgmt.cdn.models.Sku + :ivar provisioning_state: Provisioning state of the managed rule set. + :vartype provisioning_state: str + :ivar rule_set_type: Type of the managed rule set. + :vartype rule_set_type: str + :ivar rule_set_version: Version of the managed rule set type. + :vartype rule_set_version: str + :ivar rule_groups: Rule groups of the managed rule set. + :vartype rule_groups: list[~azure.mgmt.cdn.models.ManagedRuleGroupDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'rule_set_type': {'readonly': True}, + 'rule_set_version': {'readonly': True}, + 'rule_groups': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ManagedRuleGroupDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleSetDefinition, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.provisioning_state = None + self.rule_set_type = None + self.rule_set_version = None + self.rule_groups = None + + +class ManagedRuleSetDefinitionList(msrest.serialization.Model): + """List of managed rule set definitions available for use in a policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of managed rule set definitions. + :vartype value: list[~azure.mgmt.cdn.models.ManagedRuleSetDefinition] + :param next_link: URL to retrieve next set of managed rule set definitions. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagedRuleSetDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleSetDefinitionList, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class ManagedRuleSetList(msrest.serialization.Model): + """Defines the list of managed rule sets for the policy. + + :param managed_rule_sets: List of rule sets. + :type managed_rule_sets: list[~azure.mgmt.cdn.models.ManagedRuleSet] + """ + + _attribute_map = { + 'managed_rule_sets': {'key': 'managedRuleSets', 'type': '[ManagedRuleSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleSetList, self).__init__(**kwargs) + self.managed_rule_sets = kwargs.get('managed_rule_sets', None) + + +class MatchCondition(msrest.serialization.Model): + """Define match conditions. + + All required parameters must be populated in order to send to Azure. + + :param match_variable: Required. Match variable to compare against. Possible values include: + "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", "RequestUri", "RequestHeader", + "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", "UrlFileName", "HttpVersion", + "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type match_variable: str or ~azure.mgmt.cdn.models.MatchVariable + :param selector: Selector can used to match a specific key for QueryString, Cookies, + RequestHeader or PostArgs. + :type selector: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "IPMatch", "GeoMatch", "Equal", "Contains", "LessThan", "GreaterThan", "LessThanOrEqual", + "GreaterThanOrEqual", "BeginsWith", "EndsWith", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.Operator + :param negate_condition: Describes if the result of this condition should be negated. + :type negate_condition: bool + :param match_value: Required. List of possible match values. + :type match_value: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.TransformType] + """ + + _validation = { + 'match_variable': {'required': True}, + 'operator': {'required': True}, + 'match_value': {'required': True}, + } + + _attribute_map = { + 'match_variable': {'key': 'matchVariable', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_value': {'key': 'matchValue', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MatchCondition, self).__init__(**kwargs) + self.match_variable = kwargs['match_variable'] + self.selector = kwargs.get('selector', None) + self.operator = kwargs['operator'] + self.negate_condition = kwargs.get('negate_condition', None) + self.match_value = kwargs['match_value'] + self.transforms = kwargs.get('transforms', None) + + +class MetricsResponse(msrest.serialization.Model): + """Metrics Response. + + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param granularity: Possible values include: "PT5M", "PT1H", "P1D". + :type granularity: str or ~azure.mgmt.cdn.models.MetricsResponseGranularity + :param series: + :type series: list[~azure.mgmt.cdn.models.MetricsResponseSeriesItem] + """ + + _attribute_map = { + 'date_time_begin': {'key': 'dateTimeBegin', 'type': 'iso-8601'}, + 'date_time_end': {'key': 'dateTimeEnd', 'type': 'iso-8601'}, + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'series': {'key': 'series', 'type': '[MetricsResponseSeriesItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricsResponse, self).__init__(**kwargs) + self.date_time_begin = kwargs.get('date_time_begin', None) + self.date_time_end = kwargs.get('date_time_end', None) + self.granularity = kwargs.get('granularity', None) + self.series = kwargs.get('series', None) + + +class MetricsResponseSeriesItem(msrest.serialization.Model): + """MetricsResponseSeriesItem. + + :param metric: + :type metric: str + :param unit: Possible values include: "count", "bytes", "bitsPerSecond". + :type unit: str or ~azure.mgmt.cdn.models.MetricsResponseSeriesItemUnit + :param groups: + :type groups: list[~azure.mgmt.cdn.models.MetricsResponseSeriesPropertiesItemsItem] + :param data: + :type data: + list[~azure.mgmt.cdn.models.Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems] + """ + + _attribute_map = { + 'metric': {'key': 'metric', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[MetricsResponseSeriesPropertiesItemsItem]'}, + 'data': {'key': 'data', 'type': '[Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricsResponseSeriesItem, self).__init__(**kwargs) + self.metric = kwargs.get('metric', None) + self.unit = kwargs.get('unit', None) + self.groups = kwargs.get('groups', None) + self.data = kwargs.get('data', None) + + +class MetricsResponseSeriesPropertiesItemsItem(msrest.serialization.Model): + """MetricsResponseSeriesPropertiesItemsItem. + + :param name: + :type name: str + :param value: + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricsResponseSeriesPropertiesItemsItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class Operation(msrest.serialization.Model): + """CDN REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.cdn.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Service provider: Microsoft.Cdn. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Profile, endpoint, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class OperationsListResult(msrest.serialization.Model): + """Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of CDN operations supported by the CDN resource provider. + :vartype value: list[~azure.mgmt.cdn.models.Operation] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class Origin(ProxyResource): + """CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the configured origins. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param enabled: Origin is enabled for load balancing or not. + :type enabled: bool + :param private_link_alias: The Alias of the Private Link resource. Populating this optional + field indicates that this origin 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 + :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 + :ivar resource_state: Resource status of the origin. Possible values include: "Creating", + "Active", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState + :ivar provisioning_state: Provisioning status of the origin. + :vartype provisioning_state: 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.cdn.models.PrivateEndpointStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'weight': {'key': 'properties.weight', 'type': 'int'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, + 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_status': {'key': 'properties.privateEndpointStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Origin, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) + self.http_port = kwargs.get('http_port', None) + self.https_port = kwargs.get('https_port', None) + self.origin_host_header = kwargs.get('origin_host_header', None) + self.priority = kwargs.get('priority', None) + self.weight = kwargs.get('weight', None) + self.enabled = kwargs.get('enabled', 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_link_approval_message = kwargs.get('private_link_approval_message', None) + self.resource_state = None + self.provisioning_state = None + self.private_endpoint_status = None + + +class OriginGroup(ProxyResource): + """Origin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param origins: The source of the content being delivered via CDN within given origin group. + :type origins: list[~azure.mgmt.cdn.models.ResourceReference] + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :ivar resource_state: Resource status of the origin group. Possible values include: "Creating", + "Active", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginGroupResourceState + :ivar provisioning_state: Provisioning status of the origin group. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OriginGroup, self).__init__(**kwargs) + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.origins = kwargs.get('origins', None) + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) + self.response_based_origin_error_detection_settings = kwargs.get('response_based_origin_error_detection_settings', None) + self.resource_state = None + self.provisioning_state = None + + +class OriginGroupListResult(msrest.serialization.Model): + """Result of the request to list origin groups. It contains a list of origin groups objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of CDN origin groups within an endpoint. + :vartype value: list[~azure.mgmt.cdn.models.OriginGroup] + :param next_link: URL to get the next set of origin objects if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OriginGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OriginGroupListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class OriginGroupOverrideAction(DeliveryRuleAction): + """Defines the origin group override action for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.OriginGroupOverrideActionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'OriginGroupOverrideActionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(OriginGroupOverrideAction, self).__init__(**kwargs) + self.name = 'OriginGroupOverride' # type: str + self.parameters = kwargs['parameters'] + + +class OriginGroupOverrideActionParameters(msrest.serialization.Model): + """Defines the parameters for the origin group override action. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleOriginGroupOverrideActionParameters". + :vartype odata_type: str + :param origin_group: Required. defines the OriginGroup that would override the + DefaultOriginGroup. + :type origin_group: ~azure.mgmt.cdn.models.ResourceReference + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'origin_group': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'origin_group': {'key': 'originGroup', 'type': 'ResourceReference'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleOriginGroupOverrideActionParameters" + + def __init__( + self, + **kwargs + ): + super(OriginGroupOverrideActionParameters, self).__init__(**kwargs) + self.origin_group = kwargs['origin_group'] + + +class OriginGroupUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the origin group. + + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param origins: The source of the content being delivered via CDN within given origin group. + :type origins: list[~azure.mgmt.cdn.models.ResourceReference] + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + """ + + _validation = { + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + } + + _attribute_map = { + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'origins': {'key': 'origins', 'type': '[ResourceReference]'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_origin_error_detection_settings': {'key': 'responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(OriginGroupUpdatePropertiesParameters, self).__init__(**kwargs) + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.origins = kwargs.get('origins', None) + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) + self.response_based_origin_error_detection_settings = kwargs.get('response_based_origin_error_detection_settings', None) + + +class OriginGroupProperties(OriginGroupUpdatePropertiesParameters): + """The JSON object that contains the properties of the origin group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param origins: The source of the content being delivered via CDN within given origin group. + :type origins: list[~azure.mgmt.cdn.models.ResourceReference] + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :ivar resource_state: Resource status of the origin group. Possible values include: "Creating", + "Active", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginGroupResourceState + :ivar provisioning_state: Provisioning status of the origin group. + :vartype provisioning_state: str + """ + + _validation = { + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'origins': {'key': 'origins', 'type': '[ResourceReference]'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_origin_error_detection_settings': {'key': 'responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'resource_state': {'key': 'resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OriginGroupProperties, self).__init__(**kwargs) + self.resource_state = None + self.provisioning_state = None + + +class OriginGroupUpdateParameters(msrest.serialization.Model): + """Origin group properties needed for origin group creation or update. + + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param origins: The source of the content being delivered via CDN within given origin group. + :type origins: list[~azure.mgmt.cdn.models.ResourceReference] + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + """ + + _validation = { + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + } + + _attribute_map = { + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(OriginGroupUpdateParameters, self).__init__(**kwargs) + self.health_probe_settings = kwargs.get('health_probe_settings', None) + self.origins = kwargs.get('origins', None) + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) + self.response_based_origin_error_detection_settings = kwargs.get('response_based_origin_error_detection_settings', None) + + +class OriginListResult(msrest.serialization.Model): + """Result of the request to list origins. It contains a list of origin objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of CDN origins within an endpoint. + :vartype value: list[~azure.mgmt.cdn.models.Origin] + :param next_link: URL to get the next set of origin objects if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Origin]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OriginListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class OriginUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the origin. + + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param enabled: Origin is enabled for load balancing or not. + :type enabled: bool + :param private_link_alias: The Alias of the Private Link resource. Populating this optional + field indicates that this origin 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 + :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 + """ + + _validation = { + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + } + + _attribute_map = { + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'http_port': {'key': 'httpPort', 'type': 'int'}, + 'https_port': {'key': 'httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, + 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OriginUpdatePropertiesParameters, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) + self.http_port = kwargs.get('http_port', None) + self.https_port = kwargs.get('https_port', None) + self.origin_host_header = kwargs.get('origin_host_header', None) + self.priority = kwargs.get('priority', None) + self.weight = kwargs.get('weight', None) + self.enabled = kwargs.get('enabled', 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_link_approval_message = kwargs.get('private_link_approval_message', None) + + +class OriginProperties(OriginUpdatePropertiesParameters): + """The JSON object that contains the properties of the origin. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param enabled: Origin is enabled for load balancing or not. + :type enabled: bool + :param private_link_alias: The Alias of the Private Link resource. Populating this optional + field indicates that this origin 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 + :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 + :ivar resource_state: Resource status of the origin. Possible values include: "Creating", + "Active", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState + :ivar provisioning_state: Provisioning status of the origin. + :vartype provisioning_state: 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.cdn.models.PrivateEndpointStatus + """ + + _validation = { + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_status': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'header_action': {'key': 'headerAction', 'type': 'str'}, - 'header_name': {'key': 'headerName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'http_port': {'key': 'httpPort', 'type': 'int'}, + 'https_port': {'key': 'httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, + 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, + 'resource_state': {'key': 'resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint_status': {'key': 'privateEndpointStatus', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters" - def __init__( self, **kwargs ): - super(HeaderActionParameters, self).__init__(**kwargs) - self.header_action = kwargs['header_action'] - self.header_name = kwargs['header_name'] - self.value = kwargs.get('value', None) + super(OriginProperties, self).__init__(**kwargs) + self.resource_state = None + self.provisioning_state = None + self.private_endpoint_status = None -class HealthProbeParameters(msrest.serialization.Model): - """The JSON object that contains the properties to send health probes to origin. +class OriginUpdateParameters(msrest.serialization.Model): + """Origin properties needed for origin update. - :param probe_path: The path relative to the origin that is used to determine the health of the - origin. - :type probe_path: str - :param probe_request_type: The type of health probe request that is made. Possible values - include: "NotSet", "GET", "HEAD". - :type probe_request_type: str or ~azure.mgmt.cdn.models.HealthProbeRequestType - :param probe_protocol: Protocol to use for health probe. Possible values include: "NotSet", - "Http", "Https". - :type probe_protocol: str or ~azure.mgmt.cdn.models.ProbeProtocol - :param probe_interval_in_seconds: The number of seconds between health probes.Default is - 240sec. - :type probe_interval_in_seconds: int + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param enabled: Origin is enabled for load balancing or not. + :type enabled: bool + :param private_link_alias: The Alias of the Private Link resource. Populating this optional + field indicates that this origin 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 + :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 """ _validation = { - 'probe_interval_in_seconds': {'maximum': 255, 'minimum': 1}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, } _attribute_map = { - 'probe_path': {'key': 'probePath', 'type': 'str'}, - 'probe_request_type': {'key': 'probeRequestType', 'type': 'str'}, - 'probe_protocol': {'key': 'probeProtocol', 'type': 'str'}, - 'probe_interval_in_seconds': {'key': 'probeIntervalInSeconds', 'type': 'int'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'weight': {'key': 'properties.weight', 'type': 'int'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, + 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, } def __init__( self, **kwargs ): - super(HealthProbeParameters, self).__init__(**kwargs) - self.probe_path = kwargs.get('probe_path', None) - self.probe_request_type = kwargs.get('probe_request_type', None) - self.probe_protocol = kwargs.get('probe_protocol', None) - self.probe_interval_in_seconds = kwargs.get('probe_interval_in_seconds', None) + super(OriginUpdateParameters, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) + self.http_port = kwargs.get('http_port', None) + self.https_port = kwargs.get('https_port', None) + self.origin_host_header = kwargs.get('origin_host_header', None) + self.priority = kwargs.get('priority', None) + self.weight = kwargs.get('weight', None) + self.enabled = kwargs.get('enabled', 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_link_approval_message = kwargs.get('private_link_approval_message', None) -class HttpErrorRangeParameters(msrest.serialization.Model): - """The JSON object that represents the range for http status codes. +class PolicySettings(msrest.serialization.Model): + """Defines contents of a web application firewall global configuration. - :param begin: The inclusive start of the http status code range. - :type begin: int - :param end: The inclusive end of the http status code range. - :type end: int + :param enabled_state: describes if the policy is in enabled state or disabled state. Possible + values include: "Disabled", "Enabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.PolicyEnabledState + :param mode: Describes if it is in detection mode or prevention mode at policy level. Possible + values include: "Prevention", "Detection". + :type mode: str or ~azure.mgmt.cdn.models.PolicyMode + :param default_redirect_url: If action type is redirect, this field represents the default + redirect URL for the client. + :type default_redirect_url: str + :param default_custom_block_response_status_code: If the action type is block, this field + defines the default customer overridable http response status code. Possible values include: + 200, 403, 405, 406, 429. + :type default_custom_block_response_status_code: str or ~azure.mgmt.cdn.models.Enum47 + :param default_custom_block_response_body: If the action type is block, customer can override + the response body. The body must be specified in base64 encoding. + :type default_custom_block_response_body: str """ _validation = { - 'begin': {'maximum': 999, 'minimum': 100}, - 'end': {'maximum': 999, 'minimum': 100}, + 'default_custom_block_response_body': {'pattern': r'^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$'}, } _attribute_map = { - 'begin': {'key': 'begin', 'type': 'int'}, - 'end': {'key': 'end', 'type': 'int'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'default_redirect_url': {'key': 'defaultRedirectUrl', 'type': 'str'}, + 'default_custom_block_response_status_code': {'key': 'defaultCustomBlockResponseStatusCode', 'type': 'int'}, + 'default_custom_block_response_body': {'key': 'defaultCustomBlockResponseBody', 'type': 'str'}, } def __init__( self, **kwargs ): - super(HttpErrorRangeParameters, self).__init__(**kwargs) - self.begin = kwargs.get('begin', None) - self.end = kwargs.get('end', None) + super(PolicySettings, self).__init__(**kwargs) + self.enabled_state = kwargs.get('enabled_state', None) + self.mode = kwargs.get('mode', None) + self.default_redirect_url = kwargs.get('default_redirect_url', None) + self.default_custom_block_response_status_code = kwargs.get('default_custom_block_response_status_code', None) + self.default_custom_block_response_body = kwargs.get('default_custom_block_response_body', None) -class HttpVersionMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for HttpVersion match conditions. +class PostArgsMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for PostArgs match conditions. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters". + "#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters". :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Equal". - :type operator: str or ~azure.mgmt.cdn.models.HttpVersionOperator + :param selector: Name of PostArg to be matched. + :type selector: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.PostArgsOperator :param negate_condition: Describes if this is negate condition or not. :type negate_condition: bool :param match_values: The match value for the condition of the delivery rule. :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] """ _validation = { @@ -2407,228 +5582,149 @@ class HttpVersionMatchConditionParameters(msrest.serialization.Model): _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, 'operator': {'key': 'operator', 'type': 'str'}, 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters" + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters" def __init__( self, **kwargs ): - super(HttpVersionMatchConditionParameters, self).__init__(**kwargs) + super(PostArgsMatchConditionParameters, self).__init__(**kwargs) + self.selector = kwargs.get('selector', None) self.operator = kwargs['operator'] self.negate_condition = kwargs.get('negate_condition', None) self.match_values = kwargs.get('match_values', None) + self.transforms = kwargs.get('transforms', None) -class IpAddressGroup(msrest.serialization.Model): - """CDN Ip address group. - - :param delivery_region: The delivery region of the ip address group. - :type delivery_region: str - :param ipv4_addresses: The list of ip v4 addresses. - :type ipv4_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress] - :param ipv6_addresses: The list of ip v6 addresses. - :type ipv6_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress] - """ - - _attribute_map = { - 'delivery_region': {'key': 'deliveryRegion', 'type': 'str'}, - 'ipv4_addresses': {'key': 'ipv4Addresses', 'type': '[CidrIpAddress]'}, - 'ipv6_addresses': {'key': 'ipv6Addresses', 'type': '[CidrIpAddress]'}, - } - - def __init__( - self, - **kwargs - ): - super(IpAddressGroup, self).__init__(**kwargs) - self.delivery_region = kwargs.get('delivery_region', None) - self.ipv4_addresses = kwargs.get('ipv4_addresses', None) - self.ipv6_addresses = kwargs.get('ipv6_addresses', None) - - -class IsDeviceMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for IsDevice match conditions. +class Profile(TrackedResource): + """CDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and pricing tier. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Equal". - :type operator: str or ~azure.mgmt.cdn.models.IsDeviceOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str or - ~azure.mgmt.cdn.models.IsDeviceMatchConditionParametersMatchValuesItem] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param sku: Required. The pricing tier (defines a CDN provider, feature list and rate) of the + CDN profile. + :type sku: ~azure.mgmt.cdn.models.Sku + :ivar resource_state: Resource status of the profile. Possible values include: "Creating", + "Active", "Deleting", "Disabled". + :vartype resource_state: str or ~azure.mgmt.cdn.models.ProfileResourceState + :ivar provisioning_state: Provisioning status of the profile. + :vartype provisioning_state: str + :ivar frontdoor_id: The Id of the frontdoor. + :vartype frontdoor_id: str """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'sku': {'required': True}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'frontdoor_id': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'frontdoor_id': {'key': 'properties.frontdoorId', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters" - def __init__( self, **kwargs ): - super(IsDeviceMatchConditionParameters, self).__init__(**kwargs) - self.operator = kwargs['operator'] - self.negate_condition = kwargs.get('negate_condition', None) - self.match_values = kwargs.get('match_values', None) - self.transforms = kwargs.get('transforms', None) + super(Profile, self).__init__(**kwargs) + self.sku = kwargs['sku'] + self.resource_state = None + self.provisioning_state = None + self.frontdoor_id = None -class KeyVaultCertificateSourceParameters(msrest.serialization.Model): - """Describes the parameters for using a user's KeyVault certificate for securing custom domain. +class ProfileListResult(msrest.serialization.Model): + """Result of the request to list profiles. It contains a list of profile objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters". - :vartype odata_type: str - :param subscription_id: Required. Subscription Id of the user's Key Vault containing the SSL - certificate. - :type subscription_id: str - :param resource_group_name: Required. Resource group of the user's Key Vault containing the SSL - certificate. - :type resource_group_name: str - :param vault_name: Required. The name of the user's Key Vault containing the SSL certificate. - :type vault_name: str - :param secret_name: Required. The name of Key Vault Secret (representing the full certificate - PFX) in Key Vault. - :type secret_name: str - :param secret_version: The version(GUID) of Key Vault Secret in Key Vault. - :type secret_version: str - :param update_rule: Required. Describes the action that shall be taken when the certificate is - updated in Key Vault. Possible values include: "NoAction". - :type update_rule: str or ~azure.mgmt.cdn.models.UpdateRule - :param delete_rule: Required. Describes the action that shall be taken when the certificate is - removed from Key Vault. Possible values include: "NoAction". - :type delete_rule: str or ~azure.mgmt.cdn.models.DeleteRule + :ivar value: List of CDN profiles within a resource group. + :vartype value: list[~azure.mgmt.cdn.models.Profile] + :param next_link: URL to get the next set of profile objects if there are any. + :type next_link: str """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'subscription_id': {'required': True}, - 'resource_group_name': {'required': True}, - 'vault_name': {'required': True}, - 'secret_name': {'required': True}, - 'update_rule': {'required': True}, - 'delete_rule': {'required': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, - 'vault_name': {'key': 'vaultName', 'type': 'str'}, - 'secret_name': {'key': 'secretName', 'type': 'str'}, - 'secret_version': {'key': 'secretVersion', 'type': 'str'}, - 'update_rule': {'key': 'updateRule', 'type': 'str'}, - 'delete_rule': {'key': 'deleteRule', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Profile]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters" - def __init__( self, **kwargs ): - super(KeyVaultCertificateSourceParameters, self).__init__(**kwargs) - self.subscription_id = kwargs['subscription_id'] - self.resource_group_name = kwargs['resource_group_name'] - self.vault_name = kwargs['vault_name'] - self.secret_name = kwargs['secret_name'] - self.secret_version = kwargs.get('secret_version', None) - self.update_rule = kwargs['update_rule'] - self.delete_rule = kwargs['delete_rule'] - - -class KeyVaultSigningKeyParameters(msrest.serialization.Model): - """Describes the parameters for using a user's KeyVault for URL Signing Key. + super(ProfileListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. +class ProfileUpdateParameters(msrest.serialization.Model): + """Properties required to update a profile. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters". - :vartype odata_type: str - :param subscription_id: Required. Subscription Id of the user's Key Vault containing the - secret. - :type subscription_id: str - :param resource_group_name: Required. Resource group of the user's Key Vault containing the - secret. - :type resource_group_name: str - :param vault_name: Required. The name of the user's Key Vault containing the secret. - :type vault_name: str - :param secret_name: Required. The name of secret in Key Vault. - :type secret_name: str - :param secret_version: Required. The version(GUID) of secret in Key Vault. - :type secret_version: str + :param tags: A set of tags. Profile tags. + :type tags: dict[str, str] """ - _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'subscription_id': {'required': True}, - 'resource_group_name': {'required': True}, - 'vault_name': {'required': True}, - 'secret_name': {'required': True}, - 'secret_version': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, - 'vault_name': {'key': 'vaultName', 'type': 'str'}, - 'secret_name': {'key': 'secretName', 'type': 'str'}, - 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters" - def __init__( self, **kwargs ): - super(KeyVaultSigningKeyParameters, self).__init__(**kwargs) - self.subscription_id = kwargs['subscription_id'] - self.resource_group_name = kwargs['resource_group_name'] - self.vault_name = kwargs['vault_name'] - self.secret_name = kwargs['secret_name'] - self.secret_version = kwargs['secret_version'] + super(ProfileUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) -class LoadParameters(msrest.serialization.Model): - """Parameters required for content load. +class PurgeParameters(msrest.serialization.Model): + """Parameters required for content purge. All required parameters must be populated in order to send to Azure. - :param content_paths: Required. The path to the content to be loaded. Path should be a relative - file URL of the origin. + :param content_paths: Required. The path to the content to be purged. Can describe a file path + or a wild card directory. :type content_paths: list[str] """ @@ -2644,775 +5740,697 @@ def __init__( self, **kwargs ): - super(LoadParameters, self).__init__(**kwargs) + super(PurgeParameters, self).__init__(**kwargs) self.content_paths = kwargs['content_paths'] -class ManagedRuleDefinition(msrest.serialization.Model): - """Describes a managed rule definition. +class QueryStringMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for QueryString match conditions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar rule_id: Identifier for the managed rule. - :vartype rule_id: str - :ivar description: Describes the functionality of the managed rule. - :vartype description: str + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.QueryStringOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] """ _validation = { - 'rule_id': {'readonly': True}, - 'description': {'readonly': True}, + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, } _attribute_map = { - 'rule_id': {'key': 'ruleId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters" + def __init__( self, **kwargs ): - super(ManagedRuleDefinition, self).__init__(**kwargs) - self.rule_id = None - self.description = None - + super(QueryStringMatchConditionParameters, self).__init__(**kwargs) + self.operator = kwargs['operator'] + self.negate_condition = kwargs.get('negate_condition', None) + self.match_values = kwargs.get('match_values', None) + self.transforms = kwargs.get('transforms', None) -class ManagedRuleGroupDefinition(msrest.serialization.Model): - """Describes a managed rule group. - Variables are only populated by the server, and will be ignored when sending a request. +class RankingsResponse(msrest.serialization.Model): + """Rankings Response. - :ivar rule_group_name: Name of the managed rule group. - :vartype rule_group_name: str - :ivar description: Description of the managed rule group. - :vartype description: str - :ivar rules: List of rules within the managed rule group. - :vartype rules: list[~azure.mgmt.cdn.models.ManagedRuleDefinition] + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param tables: + :type tables: list[~azure.mgmt.cdn.models.RankingsResponseTablesItem] """ - _validation = { - 'rule_group_name': {'readonly': True}, - 'description': {'readonly': True}, - 'rules': {'readonly': True}, - } - _attribute_map = { - 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[ManagedRuleDefinition]'}, + 'date_time_begin': {'key': 'dateTimeBegin', 'type': 'iso-8601'}, + 'date_time_end': {'key': 'dateTimeEnd', 'type': 'iso-8601'}, + 'tables': {'key': 'tables', 'type': '[RankingsResponseTablesItem]'}, } def __init__( self, **kwargs ): - super(ManagedRuleGroupDefinition, self).__init__(**kwargs) - self.rule_group_name = None - self.description = None - self.rules = None - + super(RankingsResponse, self).__init__(**kwargs) + self.date_time_begin = kwargs.get('date_time_begin', None) + self.date_time_end = kwargs.get('date_time_end', None) + self.tables = kwargs.get('tables', None) -class ManagedRuleGroupOverride(msrest.serialization.Model): - """Defines a managed rule group override setting. - All required parameters must be populated in order to send to Azure. +class RankingsResponseTablesItem(msrest.serialization.Model): + """RankingsResponseTablesItem. - :param rule_group_name: Required. Describes the managed rule group within the rule set to - override. - :type rule_group_name: str - :param rules: List of rules that will be disabled. If none specified, all rules in the group - will be disabled. - :type rules: list[~azure.mgmt.cdn.models.ManagedRuleOverride] + :param ranking: + :type ranking: str + :param data: + :type data: list[~azure.mgmt.cdn.models.RankingsResponseTablesPropertiesItemsItem] """ - _validation = { - 'rule_group_name': {'required': True}, - } - _attribute_map = { - 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[ManagedRuleOverride]'}, + 'ranking': {'key': 'ranking', 'type': 'str'}, + 'data': {'key': 'data', 'type': '[RankingsResponseTablesPropertiesItemsItem]'}, } def __init__( self, **kwargs ): - super(ManagedRuleGroupOverride, self).__init__(**kwargs) - self.rule_group_name = kwargs['rule_group_name'] - self.rules = kwargs.get('rules', None) + super(RankingsResponseTablesItem, self).__init__(**kwargs) + self.ranking = kwargs.get('ranking', None) + self.data = kwargs.get('data', None) -class ManagedRuleOverride(msrest.serialization.Model): - """Defines a managed rule group override setting. - - All required parameters must be populated in order to send to Azure. +class RankingsResponseTablesPropertiesItemsItem(msrest.serialization.Model): + """RankingsResponseTablesPropertiesItemsItem. - :param rule_id: Required. Identifier for the managed rule. - :type rule_id: str - :param enabled_state: Describes if the managed rule is in enabled or disabled state. Defaults - to Disabled if not specified. Possible values include: "Disabled", "Enabled". - :type enabled_state: str or ~azure.mgmt.cdn.models.ManagedRuleEnabledState - :param action: Describes the override action to be applied when rule matches. Possible values - include: "Allow", "Block", "Log", "Redirect". - :type action: str or ~azure.mgmt.cdn.models.ActionType + :param name: + :type name: str + :param metrics: + :type metrics: list[~azure.mgmt.cdn.models.RankingsResponseTablesPropertiesItemsMetricsItem] """ - _validation = { - 'rule_id': {'required': True}, - } - _attribute_map = { - 'rule_id': {'key': 'ruleId', 'type': 'str'}, - 'enabled_state': {'key': 'enabledState', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'metrics': {'key': 'metrics', 'type': '[RankingsResponseTablesPropertiesItemsMetricsItem]'}, } - def __init__( - self, - **kwargs - ): - super(ManagedRuleOverride, self).__init__(**kwargs) - self.rule_id = kwargs['rule_id'] - self.enabled_state = kwargs.get('enabled_state', None) - self.action = kwargs.get('action', None) - + def __init__( + self, + **kwargs + ): + super(RankingsResponseTablesPropertiesItemsItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.metrics = kwargs.get('metrics', None) -class ManagedRuleSet(msrest.serialization.Model): - """Defines a managed rule set. - All required parameters must be populated in order to send to Azure. +class RankingsResponseTablesPropertiesItemsMetricsItem(msrest.serialization.Model): + """RankingsResponseTablesPropertiesItemsMetricsItem. - :param rule_set_type: Required. Defines the rule set type to use. - :type rule_set_type: str - :param rule_set_version: Required. Defines the version of the rule set to use. - :type rule_set_version: str - :param anomaly_score: Verizon only : If the rule set supports anomaly detection mode, this - describes the threshold for blocking requests. - :type anomaly_score: int - :param rule_group_overrides: Defines the rule overrides to apply to the rule set. - :type rule_group_overrides: list[~azure.mgmt.cdn.models.ManagedRuleGroupOverride] + :param metric: + :type metric: str + :param value: + :type value: long + :param percentage: + :type percentage: float """ - _validation = { - 'rule_set_type': {'required': True}, - 'rule_set_version': {'required': True}, - 'anomaly_score': {'maximum': 20, 'minimum': 0}, - } - _attribute_map = { - 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, - 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, - 'anomaly_score': {'key': 'anomalyScore', 'type': 'int'}, - 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[ManagedRuleGroupOverride]'}, + 'metric': {'key': 'metric', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'long'}, + 'percentage': {'key': 'percentage', 'type': 'float'}, } def __init__( self, **kwargs ): - super(ManagedRuleSet, self).__init__(**kwargs) - self.rule_set_type = kwargs['rule_set_type'] - self.rule_set_version = kwargs['rule_set_version'] - self.anomaly_score = kwargs.get('anomaly_score', None) - self.rule_group_overrides = kwargs.get('rule_group_overrides', None) + super(RankingsResponseTablesPropertiesItemsMetricsItem, self).__init__(**kwargs) + self.metric = kwargs.get('metric', None) + self.value = kwargs.get('value', None) + self.percentage = kwargs.get('percentage', None) -class ManagedRuleSetDefinition(Resource): - """Describes a managed rule set definition. +class RateLimitRule(CustomRule): + """Defines a rate limiting rule that can be included in a waf policy. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param sku: The pricing tier (defines a CDN provider, feature list and rate) of the - CdnWebApplicationFirewallPolicy. - :type sku: ~azure.mgmt.cdn.models.Sku - :ivar provisioning_state: Provisioning state of the managed rule set. - :vartype provisioning_state: str - :ivar rule_set_type: Type of the managed rule set. - :vartype rule_set_type: str - :ivar rule_set_version: Version of the managed rule set type. - :vartype rule_set_version: str - :ivar rule_groups: Rule groups of the managed rule set. - :vartype rule_groups: list[~azure.mgmt.cdn.models.ManagedRuleGroupDefinition] + :param name: Required. Defines the name of the custom rule. + :type name: str + :param enabled_state: Describes if the custom rule is in enabled or disabled state. Defaults to + Enabled if not specified. Possible values include: "Disabled", "Enabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.CustomRuleEnabledState + :param priority: Required. Defines in what order this rule be evaluated in the overall list of + custom rules. + :type priority: int + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.cdn.models.MatchCondition] + :param action: Required. Describes what action to be applied when rule matches. Possible values + include: "Allow", "Block", "Log", "Redirect". + :type action: str or ~azure.mgmt.cdn.models.ActionType + :param rate_limit_threshold: Required. Defines rate limit threshold. + :type rate_limit_threshold: int + :param rate_limit_duration_in_minutes: Required. Defines rate limit duration. Default is 1 + minute. + :type rate_limit_duration_in_minutes: int """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'rule_set_type': {'readonly': True}, - 'rule_set_version': {'readonly': True}, - 'rule_groups': {'readonly': True}, + 'name': {'required': True}, + 'priority': {'required': True, 'maximum': 1000, 'minimum': 0}, + 'match_conditions': {'required': True}, + 'action': {'required': True}, + 'rate_limit_threshold': {'required': True, 'minimum': 0}, + 'rate_limit_duration_in_minutes': {'required': True, 'maximum': 60, 'minimum': 0}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, - 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, - 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ManagedRuleGroupDefinition]'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, + 'action': {'key': 'action', 'type': 'str'}, + 'rate_limit_threshold': {'key': 'rateLimitThreshold', 'type': 'int'}, + 'rate_limit_duration_in_minutes': {'key': 'rateLimitDurationInMinutes', 'type': 'int'}, } def __init__( self, **kwargs ): - super(ManagedRuleSetDefinition, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.provisioning_state = None - self.rule_set_type = None - self.rule_set_version = None - self.rule_groups = None - + super(RateLimitRule, self).__init__(**kwargs) + self.rate_limit_threshold = kwargs['rate_limit_threshold'] + self.rate_limit_duration_in_minutes = kwargs['rate_limit_duration_in_minutes'] -class ManagedRuleSetDefinitionList(msrest.serialization.Model): - """List of managed rule set definitions available for use in a policy. - Variables are only populated by the server, and will be ignored when sending a request. +class RateLimitRuleList(msrest.serialization.Model): + """Defines contents of rate limit rules. - :ivar value: List of managed rule set definitions. - :vartype value: list[~azure.mgmt.cdn.models.ManagedRuleSetDefinition] - :param next_link: URL to retrieve next set of managed rule set definitions. - :type next_link: str + :param rules: List of rules. + :type rules: list[~azure.mgmt.cdn.models.RateLimitRule] """ - _validation = { - 'value': {'readonly': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedRuleSetDefinition]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[RateLimitRule]'}, } def __init__( self, **kwargs ): - super(ManagedRuleSetDefinitionList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) + super(RateLimitRuleList, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) -class ManagedRuleSetList(msrest.serialization.Model): - """Defines the list of managed rule sets for the policy. +class RemoteAddressMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RemoteAddress match conditions. - :param managed_rule_sets: List of rule sets. - :type managed_rule_sets: list[~azure.mgmt.cdn.models.ManagedRuleSet] + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "IPMatch", "GeoMatch". + :type operator: str or ~azure.mgmt.cdn.models.RemoteAddressOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: 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 match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] """ + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + _attribute_map = { - 'managed_rule_sets': {'key': 'managedRuleSets', 'type': '[ManagedRuleSet]'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters" + def __init__( self, **kwargs ): - super(ManagedRuleSetList, self).__init__(**kwargs) - self.managed_rule_sets = kwargs.get('managed_rule_sets', None) + super(RemoteAddressMatchConditionParameters, self).__init__(**kwargs) + self.operator = kwargs['operator'] + self.negate_condition = kwargs.get('negate_condition', None) + self.match_values = kwargs.get('match_values', None) + self.transforms = kwargs.get('transforms', None) -class MatchCondition(msrest.serialization.Model): - """Define match conditions. +class RequestBodyMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RequestBody match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param match_variable: Required. Match variable to compare against. Possible values include: - "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", "RequestUri", "RequestHeader", - "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", "UrlFileName", "HttpVersion", - "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type match_variable: str or ~azure.mgmt.cdn.models.MatchVariable - :param selector: Selector can used to match a specific key for QueryString, Cookies, - RequestHeader or PostArgs. - :type selector: str + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters". + :vartype odata_type: str :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "IPMatch", "GeoMatch", "Equal", "Contains", "LessThan", "GreaterThan", "LessThanOrEqual", - "GreaterThanOrEqual", "BeginsWith", "EndsWith", "RegEx". - :type operator: str or ~azure.mgmt.cdn.models.Operator - :param negate_condition: Describes if the result of this condition should be negated. + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.RequestBodyOperator + :param negate_condition: Describes if this is negate condition or not. :type negate_condition: bool - :param match_value: Required. List of possible match values. - :type match_value: list[str] + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.TransformType] + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] """ _validation = { - 'match_variable': {'required': True}, + 'odata_type': {'required': True, 'constant': True}, 'operator': {'required': True}, - 'match_value': {'required': True}, } _attribute_map = { - 'match_variable': {'key': 'matchVariable', 'type': 'str'}, - 'selector': {'key': 'selector', 'type': 'str'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, 'operator': {'key': 'operator', 'type': 'str'}, 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_value': {'key': 'matchValue', 'type': '[str]'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, 'transforms': {'key': 'transforms', 'type': '[str]'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters" + def __init__( self, **kwargs ): - super(MatchCondition, self).__init__(**kwargs) - self.match_variable = kwargs['match_variable'] - self.selector = kwargs.get('selector', None) + super(RequestBodyMatchConditionParameters, self).__init__(**kwargs) self.operator = kwargs['operator'] self.negate_condition = kwargs.get('negate_condition', None) - self.match_value = kwargs['match_value'] + self.match_values = kwargs.get('match_values', None) self.transforms = kwargs.get('transforms', None) -class Operation(msrest.serialization.Model): - """CDN REST API operation. +class RequestHeaderMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RequestHeader match conditions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.cdn.models.OperationDisplay + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters". + :vartype odata_type: str + :param selector: Name of Header to be matched. + :type selector: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.RequestHeaderOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] """ _validation = { - 'name': {'readonly': True}, + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters" + def __init__( self, **kwargs ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = kwargs.get('display', None) + super(RequestHeaderMatchConditionParameters, self).__init__(**kwargs) + self.selector = kwargs.get('selector', None) + self.operator = kwargs['operator'] + self.negate_condition = kwargs.get('negate_condition', None) + self.match_values = kwargs.get('match_values', None) + self.transforms = kwargs.get('transforms', None) -class OperationDisplay(msrest.serialization.Model): - """The object that represents the operation. +class RequestMethodMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RequestMethod match conditions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar provider: Service provider: Microsoft.Cdn. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: Profile, endpoint, etc. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Equal". + :type operator: str or ~azure.mgmt.cdn.models.RequestMethodOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str or + ~azure.mgmt.cdn.models.RequestMethodMatchConditionParametersMatchValuesItem] """ _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, } _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters" + def __init__( self, **kwargs ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None + super(RequestMethodMatchConditionParameters, self).__init__(**kwargs) + self.operator = kwargs['operator'] + self.negate_condition = kwargs.get('negate_condition', None) + self.match_values = kwargs.get('match_values', None) -class OperationsListResult(msrest.serialization.Model): - """Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. +class RequestSchemeMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RequestScheme match conditions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of CDN operations supported by the CDN resource provider. - :vartype value: list[~azure.mgmt.cdn.models.Operation] - :param next_link: URL to get the next set of operation list results if there are any. - :type next_link: str + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters". + :vartype odata_type: str + :ivar operator: Required. Describes operator to be matched. Default value: "Equal". + :vartype operator: str + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str or + ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParametersMatchValuesItem] """ _validation = { - 'value': {'readonly': True}, + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True, 'constant': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters" + operator = "Equal" + def __init__( self, **kwargs ): - super(OperationsListResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) + super(RequestSchemeMatchConditionParameters, self).__init__(**kwargs) + self.negate_condition = kwargs.get('negate_condition', None) + self.match_values = kwargs.get('match_values', None) -class Origin(Resource): - """CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the configured origins. +class RequestUriMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RequestUri match conditions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses - are supported.This should be unique across all origins in an endpoint. - :type host_name: str - :param http_port: The value of the HTTP port. Must be between 1 and 65535. - :type http_port: int - :param https_port: The value of the HTTPS port. Must be between 1 and 65535. - :type https_port: int - :param origin_host_header: The host header value sent to the origin with each request. If you - leave this blank, the request hostname determines this value. Azure CDN origins, such as Web - Apps, Blob Storage, and Cloud Services require this host header value to match the origin - hostname by default. This overrides the host header defined at Endpoint. - :type origin_host_header: str - :param priority: Priority of origin in given origin group for load balancing. Higher priorities - will not be used for load balancing if any lower priority origin is healthy.Must be between 1 - and 5. - :type priority: int - :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 - and 1000. - :type weight: int - :param enabled: Origin is enabled for load balancing or not. - :type enabled: bool - :param private_link_alias: The Alias of the Private Link resource. Populating this optional - field indicates that this origin 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 - :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 - :ivar resource_state: Resource status of the origin. Possible values include: "Creating", - "Active", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState - :ivar provisioning_state: Provisioning status of the origin. - :vartype provisioning_state: 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.cdn.models.PrivateEndpointStatus + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.RequestUriOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'http_port': {'maximum': 65535, 'minimum': 1}, - 'https_port': {'maximum': 65535, 'minimum': 1}, - 'priority': {'maximum': 5, 'minimum': 1}, - 'weight': {'maximum': 1000, 'minimum': 1}, - 'resource_state': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'private_endpoint_status': {'readonly': True}, + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, - 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, - 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, - 'priority': {'key': 'properties.priority', 'type': 'int'}, - 'weight': {'key': 'properties.weight', 'type': 'int'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, - 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, - 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint_status': {'key': 'properties.privateEndpointStatus', 'type': 'str'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters" + def __init__( self, **kwargs ): - super(Origin, self).__init__(**kwargs) - self.host_name = kwargs.get('host_name', None) - self.http_port = kwargs.get('http_port', None) - self.https_port = kwargs.get('https_port', None) - self.origin_host_header = kwargs.get('origin_host_header', None) - self.priority = kwargs.get('priority', None) - self.weight = kwargs.get('weight', None) - self.enabled = kwargs.get('enabled', 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_link_approval_message = kwargs.get('private_link_approval_message', None) - self.resource_state = None - self.provisioning_state = None - self.private_endpoint_status = None - + super(RequestUriMatchConditionParameters, self).__init__(**kwargs) + self.operator = kwargs['operator'] + self.negate_condition = kwargs.get('negate_condition', None) + self.match_values = kwargs.get('match_values', None) + self.transforms = kwargs.get('transforms', None) -class OriginGroup(Resource): - """Origin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. - Variables are only populated by the server, and will be ignored when sending a request. +class ResourceReference(msrest.serialization.Model): + """Reference to another resource. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param health_probe_settings: Health probe settings to the origin that is used to determine the - health of the origin. - :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters - :param origins: The source of the content being delivered via CDN within given origin group. - :type origins: list[~azure.mgmt.cdn.models.ResourceReference] - :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift - the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new - endpoint is added. Default is 10 mins. This property is currently not supported. - :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int - :param response_based_origin_error_detection_settings: The JSON object that contains the - properties to determine origin health using real requests/responses. This property is currently - not supported. - :type response_based_origin_error_detection_settings: - ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters - :ivar resource_state: Resource status of the origin group. Possible values include: "Creating", - "Active", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginGroupResourceState - :ivar provisioning_state: Provisioning status of the origin group. - :vartype provisioning_state: str + :param id: Resource ID. + :type id: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, - 'resource_state': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, - 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, - 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, - 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__( self, **kwargs ): - super(OriginGroup, self).__init__(**kwargs) - self.health_probe_settings = kwargs.get('health_probe_settings', None) - self.origins = kwargs.get('origins', None) - self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) - self.response_based_origin_error_detection_settings = kwargs.get('response_based_origin_error_detection_settings', None) - self.resource_state = None - self.provisioning_state = None - + super(ResourceReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) -class OriginGroupListResult(msrest.serialization.Model): - """Result of the request to list origin groups. It contains a list of origin groups objects and a URL link to get the next set of results. - Variables are only populated by the server, and will be ignored when sending a request. +class ResourcesResponse(msrest.serialization.Model): + """Resources Response. - :ivar value: List of CDN origin groups within an endpoint. - :vartype value: list[~azure.mgmt.cdn.models.OriginGroup] - :param next_link: URL to get the next set of origin objects if there are any. - :type next_link: str + :param endpoints: + :type endpoints: list[~azure.mgmt.cdn.models.ResourcesResponseEndpointsItem] + :param custom_domains: + :type custom_domains: list[~azure.mgmt.cdn.models.ResourcesResponseCustomDomainsItem] """ - _validation = { - 'value': {'readonly': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[OriginGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[ResourcesResponseEndpointsItem]'}, + 'custom_domains': {'key': 'customDomains', 'type': '[ResourcesResponseCustomDomainsItem]'}, } def __init__( self, **kwargs ): - super(OriginGroupListResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) + super(ResourcesResponse, self).__init__(**kwargs) + self.endpoints = kwargs.get('endpoints', None) + self.custom_domains = kwargs.get('custom_domains', None) -class OriginGroupUpdatePropertiesParameters(msrest.serialization.Model): - """The JSON object that contains the properties of the origin group. +class ResourcesResponseCustomDomainsItem(msrest.serialization.Model): + """ResourcesResponseCustomDomainsItem. - :param health_probe_settings: Health probe settings to the origin that is used to determine the - health of the origin. - :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters - :param origins: The source of the content being delivered via CDN within given origin group. - :type origins: list[~azure.mgmt.cdn.models.ResourceReference] - :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift - the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new - endpoint is added. Default is 10 mins. This property is currently not supported. - :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int - :param response_based_origin_error_detection_settings: The JSON object that contains the - properties to determine origin health using real requests/responses. This property is currently - not supported. - :type response_based_origin_error_detection_settings: - ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param id: + :type id: str + :param name: + :type name: str + :param endpoint_id: + :type endpoint_id: str + :param history: + :type history: bool """ - _validation = { - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, - } - _attribute_map = { - 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, - 'origins': {'key': 'origins', 'type': '[ResourceReference]'}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, - 'response_based_origin_error_detection_settings': {'key': 'responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, + 'history': {'key': 'history', 'type': 'bool'}, } def __init__( self, **kwargs ): - super(OriginGroupUpdatePropertiesParameters, self).__init__(**kwargs) - self.health_probe_settings = kwargs.get('health_probe_settings', None) - self.origins = kwargs.get('origins', None) - self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) - self.response_based_origin_error_detection_settings = kwargs.get('response_based_origin_error_detection_settings', None) - + super(ResourcesResponseCustomDomainsItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.endpoint_id = kwargs.get('endpoint_id', None) + self.history = kwargs.get('history', None) -class OriginGroupProperties(OriginGroupUpdatePropertiesParameters): - """The JSON object that contains the properties of the origin group. - Variables are only populated by the server, and will be ignored when sending a request. +class ResourcesResponseEndpointsItem(msrest.serialization.Model): + """ResourcesResponseEndpointsItem. - :param health_probe_settings: Health probe settings to the origin that is used to determine the - health of the origin. - :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters - :param origins: The source of the content being delivered via CDN within given origin group. - :type origins: list[~azure.mgmt.cdn.models.ResourceReference] - :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift - the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new - endpoint is added. Default is 10 mins. This property is currently not supported. - :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int - :param response_based_origin_error_detection_settings: The JSON object that contains the - properties to determine origin health using real requests/responses. This property is currently - not supported. - :type response_based_origin_error_detection_settings: - ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters - :ivar resource_state: Resource status of the origin group. Possible values include: "Creating", - "Active", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginGroupResourceState - :ivar provisioning_state: Provisioning status of the origin group. - :vartype provisioning_state: str + :param id: + :type id: str + :param name: + :type name: str + :param history: + :type history: bool + :param custom_domains: + :type custom_domains: + list[~azure.mgmt.cdn.models.ResourcesResponseEndpointsPropertiesItemsItem] """ - _validation = { - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, - 'resource_state': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'history': {'key': 'history', 'type': 'bool'}, + 'custom_domains': {'key': 'customDomains', 'type': '[ResourcesResponseEndpointsPropertiesItemsItem]'}, } + def __init__( + self, + **kwargs + ): + super(ResourcesResponseEndpointsItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.history = kwargs.get('history', None) + self.custom_domains = kwargs.get('custom_domains', None) + + +class ResourcesResponseEndpointsPropertiesItemsItem(msrest.serialization.Model): + """ResourcesResponseEndpointsPropertiesItemsItem. + + :param id: + :type id: str + :param name: + :type name: str + :param endpoint_id: + :type endpoint_id: str + :param history: + :type history: bool + """ + _attribute_map = { - 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, - 'origins': {'key': 'origins', 'type': '[ResourceReference]'}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, - 'response_based_origin_error_detection_settings': {'key': 'responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, - 'resource_state': {'key': 'resourceState', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, + 'history': {'key': 'history', 'type': 'bool'}, } def __init__( self, **kwargs ): - super(OriginGroupProperties, self).__init__(**kwargs) - self.resource_state = None - self.provisioning_state = None + super(ResourcesResponseEndpointsPropertiesItemsItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.endpoint_id = kwargs.get('endpoint_id', None) + self.history = kwargs.get('history', None) -class OriginGroupUpdateParameters(msrest.serialization.Model): - """Origin group properties needed for origin group creation or update. +class ResourceUsage(msrest.serialization.Model): + """Output of check resource usage API. - :param health_probe_settings: Health probe settings to the origin that is used to determine the - health of the origin. - :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters - :param origins: The source of the content being delivered via CDN within given origin group. - :type origins: list[~azure.mgmt.cdn.models.ResourceReference] - :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift - the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new - endpoint is added. Default is 10 mins. This property is currently not supported. - :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int - :param response_based_origin_error_detection_settings: The JSON object that contains the - properties to determine origin health using real requests/responses. This property is currently - not supported. - :type response_based_origin_error_detection_settings: - ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: Resource type for which the usage is provided. + :vartype resource_type: str + :ivar unit: Unit of the usage. e.g. Count. + :vartype unit: str + :ivar current_value: Actual value of usage on the specified resource type. + :vartype current_value: int + :ivar limit: Quota of the specified resource type. + :vartype limit: int """ _validation = { - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'resource_type': {'readonly': True}, + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, } _attribute_map = { - 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, - 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, - 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, } def __init__( self, **kwargs ): - super(OriginGroupUpdateParameters, self).__init__(**kwargs) - self.health_probe_settings = kwargs.get('health_probe_settings', None) - self.origins = kwargs.get('origins', None) - self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = kwargs.get('traffic_restoration_time_to_healed_or_new_endpoints_in_minutes', None) - self.response_based_origin_error_detection_settings = kwargs.get('response_based_origin_error_detection_settings', None) + super(ResourceUsage, self).__init__(**kwargs) + self.resource_type = None + self.unit = None + self.current_value = None + self.limit = None -class OriginListResult(msrest.serialization.Model): - """Result of the request to list origins. It contains a list of origin objects and a URL link to get the next set of results. +class ResourceUsageListResult(msrest.serialization.Model): + """Output of check resource usage API. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of CDN origins within an endpoint. - :vartype value: list[~azure.mgmt.cdn.models.Origin] - :param next_link: URL to get the next set of origin objects if there are any. + :ivar value: List of resource usages. + :vartype value: list[~azure.mgmt.cdn.models.ResourceUsage] + :param next_link: URL to get the next set of custom domain objects if there are any. :type next_link: str """ @@ -3421,7 +6439,7 @@ class OriginListResult(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[Origin]'}, + 'value': {'key': 'value', 'type': '[ResourceUsage]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -3429,413 +6447,524 @@ def __init__( self, **kwargs ): - super(OriginListResult, self).__init__(**kwargs) + super(ResourceUsageListResult, self).__init__(**kwargs) self.value = None self.next_link = kwargs.get('next_link', None) -class OriginUpdatePropertiesParameters(msrest.serialization.Model): - """The JSON object that contains the properties of the origin. +class ResponseBasedOriginErrorDetectionParameters(msrest.serialization.Model): + """The JSON object that contains the properties to determine origin health using real requests/responses. - :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses - are supported.This should be unique across all origins in an endpoint. - :type host_name: str - :param http_port: The value of the HTTP port. Must be between 1 and 65535. - :type http_port: int - :param https_port: The value of the HTTPS port. Must be between 1 and 65535. - :type https_port: int - :param origin_host_header: The host header value sent to the origin with each request. If you - leave this blank, the request hostname determines this value. Azure CDN origins, such as Web - Apps, Blob Storage, and Cloud Services require this host header value to match the origin - hostname by default. This overrides the host header defined at Endpoint. - :type origin_host_header: str - :param priority: Priority of origin in given origin group for load balancing. Higher priorities - will not be used for load balancing if any lower priority origin is healthy.Must be between 1 - and 5. - :type priority: int - :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 - and 1000. - :type weight: int - :param enabled: Origin is enabled for load balancing or not. - :type enabled: bool - :param private_link_alias: The Alias of the Private Link resource. Populating this optional - field indicates that this origin 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 - :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 response_based_detected_error_types: Type of response errors for real user requests for + which origin will be deemed unhealthy. Possible values include: "None", "TcpErrorsOnly", + "TcpAndHttpErrors". + :type response_based_detected_error_types: str or + ~azure.mgmt.cdn.models.ResponseBasedDetectedErrorTypes + :param response_based_failover_threshold_percentage: The percentage of failed requests in the + sample where failover should trigger. + :type response_based_failover_threshold_percentage: int + :param http_error_ranges: The list of Http status code ranges that are considered as server + errors for origin and it is marked as unhealthy. + :type http_error_ranges: list[~azure.mgmt.cdn.models.HttpErrorRangeParameters] + """ + + _validation = { + 'response_based_failover_threshold_percentage': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'response_based_detected_error_types': {'key': 'responseBasedDetectedErrorTypes', 'type': 'str'}, + 'response_based_failover_threshold_percentage': {'key': 'responseBasedFailoverThresholdPercentage', 'type': 'int'}, + 'http_error_ranges': {'key': 'httpErrorRanges', 'type': '[HttpErrorRangeParameters]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResponseBasedOriginErrorDetectionParameters, self).__init__(**kwargs) + self.response_based_detected_error_types = kwargs.get('response_based_detected_error_types', None) + self.response_based_failover_threshold_percentage = kwargs.get('response_based_failover_threshold_percentage', None) + self.http_error_ranges = kwargs.get('http_error_ranges', None) + + +class Route(ProxyResource): + """Friendly Routes name mapping to the any Routes or secret related information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param custom_domains: Domains referenced by this endpoint. + :type custom_domains: list[~azure.mgmt.cdn.models.ResourceReference] + :param origin_group: A reference to the origin group. + :type origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param origin_path: A directory path on the origin that AzureFrontDoor can use to retrieve + content from, e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param rule_sets: rule sets referenced by this endpoint. + :type rule_sets: list[~azure.mgmt.cdn.models.ResourceReference] + :param supported_protocols: List of supported protocols for this route. + :type supported_protocols: list[str or ~azure.mgmt.cdn.models.AFDEndpointProtocols] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param compression_settings: compression settings. + :type compression_settings: object + :param query_string_caching_behavior: Defines how AzureFrontDoor caches requests that include + query strings. You can ignore any query strings when caching, bypass caching to prevent + requests that contain query strings from being cached, or cache every request with a unique + URL. Possible values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this AzureFrontDoor + endpoint to optimize for, e.g. Download, Media services. With this information, AzureFrontDoor + can apply scenario driven optimization. Possible values include: "GeneralWebDelivery", + "GeneralMediaStreaming", "VideoOnDemandMediaStreaming", "LargeFileDownload", + "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param forwarding_protocol: Protocol this rule will use when forwarding traffic to backends. + Possible values include: "HttpOnly", "HttpsOnly", "MatchRequest". + :type forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol + :param link_to_default_domain: whether this route will be linked to the default endpoint + domain. Possible values include: "Enabled", "Disabled". + :type link_to_default_domain: str or ~azure.mgmt.cdn.models.LinkToDefaultDomain + :param https_redirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note + that this is a easy way to set up this rule and it will be the first rule that gets executed. + Possible values include: "Enabled", "Disabled". + :type https_redirect: str or ~azure.mgmt.cdn.models.HttpsRedirect + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'http_port': {'maximum': 65535, 'minimum': 1}, - 'https_port': {'maximum': 65535, 'minimum': 1}, - 'priority': {'maximum': 5, 'minimum': 1}, - 'weight': {'maximum': 1000, 'minimum': 1}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'http_port': {'key': 'httpPort', 'type': 'int'}, - 'https_port': {'key': 'httpsPort', 'type': 'int'}, - 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'weight': {'key': 'weight', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, - 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, - 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, - 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[ResourceReference]'}, + 'origin_group': {'key': 'properties.originGroup', 'type': 'ResourceReference'}, + 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, + 'rule_sets': {'key': 'properties.ruleSets', 'type': '[ResourceReference]'}, + 'supported_protocols': {'key': 'properties.supportedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'properties.patternsToMatch', 'type': '[str]'}, + 'compression_settings': {'key': 'properties.compressionSettings', 'type': 'object'}, + 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, + 'forwarding_protocol': {'key': 'properties.forwardingProtocol', 'type': 'str'}, + 'link_to_default_domain': {'key': 'properties.linkToDefaultDomain', 'type': 'str'}, + 'https_redirect': {'key': 'properties.httpsRedirect', 'type': 'str'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, } def __init__( self, **kwargs ): - super(OriginUpdatePropertiesParameters, self).__init__(**kwargs) - self.host_name = kwargs.get('host_name', None) - self.http_port = kwargs.get('http_port', None) - self.https_port = kwargs.get('https_port', None) - self.origin_host_header = kwargs.get('origin_host_header', None) - self.priority = kwargs.get('priority', None) - self.weight = kwargs.get('weight', None) - self.enabled = kwargs.get('enabled', 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_link_approval_message = kwargs.get('private_link_approval_message', None) + super(Route, self).__init__(**kwargs) + self.custom_domains = kwargs.get('custom_domains', None) + self.origin_group = kwargs.get('origin_group', None) + self.origin_path = kwargs.get('origin_path', None) + self.rule_sets = kwargs.get('rule_sets', None) + self.supported_protocols = kwargs.get('supported_protocols', None) + self.patterns_to_match = kwargs.get('patterns_to_match', None) + self.compression_settings = kwargs.get('compression_settings', None) + self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) + self.optimization_type = kwargs.get('optimization_type', None) + self.forwarding_protocol = kwargs.get('forwarding_protocol', None) + self.link_to_default_domain = kwargs.get('link_to_default_domain', None) + self.https_redirect = kwargs.get('https_redirect', None) + self.enabled_state = kwargs.get('enabled_state', None) + self.provisioning_state = None + self.deployment_status = None -class OriginProperties(OriginUpdatePropertiesParameters): - """The JSON object that contains the properties of the origin. +class RouteListResult(msrest.serialization.Model): + """Result of the request to list routes. It contains a list of route objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses - are supported.This should be unique across all origins in an endpoint. - :type host_name: str - :param http_port: The value of the HTTP port. Must be between 1 and 65535. - :type http_port: int - :param https_port: The value of the HTTPS port. Must be between 1 and 65535. - :type https_port: int - :param origin_host_header: The host header value sent to the origin with each request. If you - leave this blank, the request hostname determines this value. Azure CDN origins, such as Web - Apps, Blob Storage, and Cloud Services require this host header value to match the origin - hostname by default. This overrides the host header defined at Endpoint. - :type origin_host_header: str - :param priority: Priority of origin in given origin group for load balancing. Higher priorities - will not be used for load balancing if any lower priority origin is healthy.Must be between 1 - and 5. - :type priority: int - :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 - and 1000. - :type weight: int - :param enabled: Origin is enabled for load balancing or not. - :type enabled: bool - :param private_link_alias: The Alias of the Private Link resource. Populating this optional - field indicates that this origin 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 - :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 - :ivar resource_state: Resource status of the origin. Possible values include: "Creating", - "Active", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState - :ivar provisioning_state: Provisioning status of the origin. - :vartype provisioning_state: 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.cdn.models.PrivateEndpointStatus + :ivar value: List of AzureFrontDoor routes within a profile. + :vartype value: list[~azure.mgmt.cdn.models.Route] + :param next_link: URL to get the next set of route objects if there are any. + :type next_link: str """ _validation = { - 'http_port': {'maximum': 65535, 'minimum': 1}, - 'https_port': {'maximum': 65535, 'minimum': 1}, - 'priority': {'maximum': 5, 'minimum': 1}, - 'weight': {'maximum': 1000, 'minimum': 1}, - 'resource_state': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'private_endpoint_status': {'readonly': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'http_port': {'key': 'httpPort', 'type': 'int'}, - 'https_port': {'key': 'httpsPort', 'type': 'int'}, - 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'weight': {'key': 'weight', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, - 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, - 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, - 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, - 'resource_state': {'key': 'resourceState', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'private_endpoint_status': {'key': 'privateEndpointStatus', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Route]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(OriginProperties, self).__init__(**kwargs) - self.resource_state = None - self.provisioning_state = None - self.private_endpoint_status = None + super(RouteListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) -class OriginUpdateParameters(msrest.serialization.Model): - """Origin properties needed for origin update. +class RouteUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the domain to create. - :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses - are supported.This should be unique across all origins in an endpoint. - :type host_name: str - :param http_port: The value of the HTTP port. Must be between 1 and 65535. - :type http_port: int - :param https_port: The value of the HTTPS port. Must be between 1 and 65535. - :type https_port: int - :param origin_host_header: The host header value sent to the origin with each request. If you - leave this blank, the request hostname determines this value. Azure CDN origins, such as Web - Apps, Blob Storage, and Cloud Services require this host header value to match the origin - hostname by default. This overrides the host header defined at Endpoint. - :type origin_host_header: str - :param priority: Priority of origin in given origin group for load balancing. Higher priorities - will not be used for load balancing if any lower priority origin is healthy.Must be between 1 - and 5. - :type priority: int - :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 - and 1000. - :type weight: int - :param enabled: Origin is enabled for load balancing or not. - :type enabled: bool - :param private_link_alias: The Alias of the Private Link resource. Populating this optional - field indicates that this origin 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 - :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 custom_domains: Domains referenced by this endpoint. + :type custom_domains: list[~azure.mgmt.cdn.models.ResourceReference] + :param origin_group: A reference to the origin group. + :type origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param origin_path: A directory path on the origin that AzureFrontDoor can use to retrieve + content from, e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param rule_sets: rule sets referenced by this endpoint. + :type rule_sets: list[~azure.mgmt.cdn.models.ResourceReference] + :param supported_protocols: List of supported protocols for this route. + :type supported_protocols: list[str or ~azure.mgmt.cdn.models.AFDEndpointProtocols] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param compression_settings: compression settings. + :type compression_settings: object + :param query_string_caching_behavior: Defines how AzureFrontDoor caches requests that include + query strings. You can ignore any query strings when caching, bypass caching to prevent + requests that contain query strings from being cached, or cache every request with a unique + URL. Possible values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this AzureFrontDoor + endpoint to optimize for, e.g. Download, Media services. With this information, AzureFrontDoor + can apply scenario driven optimization. Possible values include: "GeneralWebDelivery", + "GeneralMediaStreaming", "VideoOnDemandMediaStreaming", "LargeFileDownload", + "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param forwarding_protocol: Protocol this rule will use when forwarding traffic to backends. + Possible values include: "HttpOnly", "HttpsOnly", "MatchRequest". + :type forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol + :param link_to_default_domain: whether this route will be linked to the default endpoint + domain. Possible values include: "Enabled", "Disabled". + :type link_to_default_domain: str or ~azure.mgmt.cdn.models.LinkToDefaultDomain + :param https_redirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note + that this is a easy way to set up this rule and it will be the first rule that gets executed. + Possible values include: "Enabled", "Disabled". + :type https_redirect: str or ~azure.mgmt.cdn.models.HttpsRedirect + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ - _validation = { - 'http_port': {'maximum': 65535, 'minimum': 1}, - 'https_port': {'maximum': 65535, 'minimum': 1}, - 'priority': {'maximum': 5, 'minimum': 1}, - 'weight': {'maximum': 1000, 'minimum': 1}, - } - _attribute_map = { - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, - 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, - 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, - 'priority': {'key': 'properties.priority', 'type': 'int'}, - 'weight': {'key': 'properties.weight', 'type': 'int'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, - 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, + 'custom_domains': {'key': 'customDomains', 'type': '[ResourceReference]'}, + 'origin_group': {'key': 'originGroup', 'type': 'ResourceReference'}, + 'origin_path': {'key': 'originPath', 'type': 'str'}, + 'rule_sets': {'key': 'ruleSets', 'type': '[ResourceReference]'}, + 'supported_protocols': {'key': 'supportedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'patternsToMatch', 'type': '[str]'}, + 'compression_settings': {'key': 'compressionSettings', 'type': 'object'}, + 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, + 'forwarding_protocol': {'key': 'forwardingProtocol', 'type': 'str'}, + 'link_to_default_domain': {'key': 'linkToDefaultDomain', 'type': 'str'}, + 'https_redirect': {'key': 'httpsRedirect', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, } def __init__( self, **kwargs ): - super(OriginUpdateParameters, self).__init__(**kwargs) - self.host_name = kwargs.get('host_name', None) - self.http_port = kwargs.get('http_port', None) - self.https_port = kwargs.get('https_port', None) - self.origin_host_header = kwargs.get('origin_host_header', None) - self.priority = kwargs.get('priority', None) - self.weight = kwargs.get('weight', None) - self.enabled = kwargs.get('enabled', 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_link_approval_message = kwargs.get('private_link_approval_message', None) + super(RouteUpdatePropertiesParameters, self).__init__(**kwargs) + self.custom_domains = kwargs.get('custom_domains', None) + self.origin_group = kwargs.get('origin_group', None) + self.origin_path = kwargs.get('origin_path', None) + self.rule_sets = kwargs.get('rule_sets', None) + self.supported_protocols = kwargs.get('supported_protocols', None) + self.patterns_to_match = kwargs.get('patterns_to_match', None) + self.compression_settings = kwargs.get('compression_settings', None) + self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) + self.optimization_type = kwargs.get('optimization_type', None) + self.forwarding_protocol = kwargs.get('forwarding_protocol', None) + self.link_to_default_domain = kwargs.get('link_to_default_domain', None) + self.https_redirect = kwargs.get('https_redirect', None) + self.enabled_state = kwargs.get('enabled_state', None) -class PolicySettings(msrest.serialization.Model): - """Defines contents of a web application firewall global configuration. +class RouteProperties(AFDStateProperties, RouteUpdatePropertiesParameters): + """The JSON object that contains the properties of the Routes to create. - :param enabled_state: describes if the policy is in enabled state or disabled state. Possible - values include: "Disabled", "Enabled". - :type enabled_state: str or ~azure.mgmt.cdn.models.PolicyEnabledState - :param mode: Describes if it is in detection mode or prevention mode at policy level. Possible - values include: "Prevention", "Detection". - :type mode: str or ~azure.mgmt.cdn.models.PolicyMode - :param default_redirect_url: If action type is redirect, this field represents the default - redirect URL for the client. - :type default_redirect_url: str - :param default_custom_block_response_status_code: If the action type is block, this field - defines the default customer overridable http response status code. Possible values include: - 200, 403, 405, 406, 429. - :type default_custom_block_response_status_code: str or ~azure.mgmt.cdn.models.Enum16 - :param default_custom_block_response_body: If the action type is block, customer can override - the response body. The body must be specified in base64 encoding. - :type default_custom_block_response_body: str + Variables are only populated by the server, and will be ignored when sending a request. + + :param custom_domains: Domains referenced by this endpoint. + :type custom_domains: list[~azure.mgmt.cdn.models.ResourceReference] + :param origin_group: A reference to the origin group. + :type origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param origin_path: A directory path on the origin that AzureFrontDoor can use to retrieve + content from, e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param rule_sets: rule sets referenced by this endpoint. + :type rule_sets: list[~azure.mgmt.cdn.models.ResourceReference] + :param supported_protocols: List of supported protocols for this route. + :type supported_protocols: list[str or ~azure.mgmt.cdn.models.AFDEndpointProtocols] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param compression_settings: compression settings. + :type compression_settings: object + :param query_string_caching_behavior: Defines how AzureFrontDoor caches requests that include + query strings. You can ignore any query strings when caching, bypass caching to prevent + requests that contain query strings from being cached, or cache every request with a unique + URL. Possible values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this AzureFrontDoor + endpoint to optimize for, e.g. Download, Media services. With this information, AzureFrontDoor + can apply scenario driven optimization. Possible values include: "GeneralWebDelivery", + "GeneralMediaStreaming", "VideoOnDemandMediaStreaming", "LargeFileDownload", + "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param forwarding_protocol: Protocol this rule will use when forwarding traffic to backends. + Possible values include: "HttpOnly", "HttpsOnly", "MatchRequest". + :type forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol + :param link_to_default_domain: whether this route will be linked to the default endpoint + domain. Possible values include: "Enabled", "Disabled". + :type link_to_default_domain: str or ~azure.mgmt.cdn.models.LinkToDefaultDomain + :param https_redirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note + that this is a easy way to set up this rule and it will be the first rule that gets executed. + Possible values include: "Enabled", "Disabled". + :type https_redirect: str or ~azure.mgmt.cdn.models.HttpsRedirect + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'default_custom_block_response_body': {'pattern': r'^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$'}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { + 'custom_domains': {'key': 'customDomains', 'type': '[ResourceReference]'}, + 'origin_group': {'key': 'originGroup', 'type': 'ResourceReference'}, + 'origin_path': {'key': 'originPath', 'type': 'str'}, + 'rule_sets': {'key': 'ruleSets', 'type': '[ResourceReference]'}, + 'supported_protocols': {'key': 'supportedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'patternsToMatch', 'type': '[str]'}, + 'compression_settings': {'key': 'compressionSettings', 'type': 'object'}, + 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, + 'forwarding_protocol': {'key': 'forwardingProtocol', 'type': 'str'}, + 'link_to_default_domain': {'key': 'linkToDefaultDomain', 'type': 'str'}, + 'https_redirect': {'key': 'httpsRedirect', 'type': 'str'}, 'enabled_state': {'key': 'enabledState', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'default_redirect_url': {'key': 'defaultRedirectUrl', 'type': 'str'}, - 'default_custom_block_response_status_code': {'key': 'defaultCustomBlockResponseStatusCode', 'type': 'int'}, - 'default_custom_block_response_body': {'key': 'defaultCustomBlockResponseBody', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } def __init__( self, **kwargs ): - super(PolicySettings, self).__init__(**kwargs) + super(RouteProperties, self).__init__(**kwargs) + self.custom_domains = kwargs.get('custom_domains', None) + self.origin_group = kwargs.get('origin_group', None) + self.origin_path = kwargs.get('origin_path', None) + self.rule_sets = kwargs.get('rule_sets', None) + self.supported_protocols = kwargs.get('supported_protocols', None) + self.patterns_to_match = kwargs.get('patterns_to_match', None) + self.compression_settings = kwargs.get('compression_settings', None) + self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) + self.optimization_type = kwargs.get('optimization_type', None) + self.forwarding_protocol = kwargs.get('forwarding_protocol', None) + self.link_to_default_domain = kwargs.get('link_to_default_domain', None) + self.https_redirect = kwargs.get('https_redirect', None) self.enabled_state = kwargs.get('enabled_state', None) - self.mode = kwargs.get('mode', None) - self.default_redirect_url = kwargs.get('default_redirect_url', None) - self.default_custom_block_response_status_code = kwargs.get('default_custom_block_response_status_code', None) - self.default_custom_block_response_body = kwargs.get('default_custom_block_response_body', None) - - -class PostArgsMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for PostArgs match conditions. + self.provisioning_state = None + self.deployment_status = None - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. +class RouteUpdateParameters(msrest.serialization.Model): + """The domain JSON object required for domain creation or update. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters". - :vartype odata_type: str - :param selector: Name of PostArg to be matched. - :type selector: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.PostArgsOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :param custom_domains: Domains referenced by this endpoint. + :type custom_domains: list[~azure.mgmt.cdn.models.ResourceReference] + :param origin_group: A reference to the origin group. + :type origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param origin_path: A directory path on the origin that AzureFrontDoor can use to retrieve + content from, e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param rule_sets: rule sets referenced by this endpoint. + :type rule_sets: list[~azure.mgmt.cdn.models.ResourceReference] + :param supported_protocols: List of supported protocols for this route. + :type supported_protocols: list[str or ~azure.mgmt.cdn.models.AFDEndpointProtocols] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param compression_settings: compression settings. + :type compression_settings: object + :param query_string_caching_behavior: Defines how AzureFrontDoor caches requests that include + query strings. You can ignore any query strings when caching, bypass caching to prevent + requests that contain query strings from being cached, or cache every request with a unique + URL. Possible values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this AzureFrontDoor + endpoint to optimize for, e.g. Download, Media services. With this information, AzureFrontDoor + can apply scenario driven optimization. Possible values include: "GeneralWebDelivery", + "GeneralMediaStreaming", "VideoOnDemandMediaStreaming", "LargeFileDownload", + "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param forwarding_protocol: Protocol this rule will use when forwarding traffic to backends. + Possible values include: "HttpOnly", "HttpsOnly", "MatchRequest". + :type forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol + :param link_to_default_domain: whether this route will be linked to the default endpoint + domain. Possible values include: "Enabled", "Disabled". + :type link_to_default_domain: str or ~azure.mgmt.cdn.models.LinkToDefaultDomain + :param https_redirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note + that this is a easy way to set up this rule and it will be the first rule that gets executed. + Possible values include: "Enabled", "Disabled". + :type https_redirect: str or ~azure.mgmt.cdn.models.HttpsRedirect + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ - _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'selector': {'key': 'selector', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[ResourceReference]'}, + 'origin_group': {'key': 'properties.originGroup', 'type': 'ResourceReference'}, + 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, + 'rule_sets': {'key': 'properties.ruleSets', 'type': '[ResourceReference]'}, + 'supported_protocols': {'key': 'properties.supportedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'properties.patternsToMatch', 'type': '[str]'}, + 'compression_settings': {'key': 'properties.compressionSettings', 'type': 'object'}, + 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, + 'forwarding_protocol': {'key': 'properties.forwardingProtocol', 'type': 'str'}, + 'link_to_default_domain': {'key': 'properties.linkToDefaultDomain', 'type': 'str'}, + 'https_redirect': {'key': 'properties.httpsRedirect', 'type': 'str'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters" - def __init__( self, **kwargs ): - super(PostArgsMatchConditionParameters, self).__init__(**kwargs) - self.selector = kwargs.get('selector', None) - self.operator = kwargs['operator'] - self.negate_condition = kwargs.get('negate_condition', None) - self.match_values = kwargs.get('match_values', None) - self.transforms = kwargs.get('transforms', None) + super(RouteUpdateParameters, self).__init__(**kwargs) + self.custom_domains = kwargs.get('custom_domains', None) + self.origin_group = kwargs.get('origin_group', None) + self.origin_path = kwargs.get('origin_path', None) + self.rule_sets = kwargs.get('rule_sets', None) + self.supported_protocols = kwargs.get('supported_protocols', None) + self.patterns_to_match = kwargs.get('patterns_to_match', None) + self.compression_settings = kwargs.get('compression_settings', None) + self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) + self.optimization_type = kwargs.get('optimization_type', None) + self.forwarding_protocol = kwargs.get('forwarding_protocol', None) + self.link_to_default_domain = kwargs.get('link_to_default_domain', None) + self.https_redirect = kwargs.get('https_redirect', None) + self.enabled_state = kwargs.get('enabled_state', None) -class Profile(TrackedResource): - """CDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and pricing tier. +class Rule(ProxyResource): + """Friendly Rules name mapping to the any Rules or secret related information. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: Required. The pricing tier (defines a CDN provider, feature list and rate) of the - CDN profile. - :type sku: ~azure.mgmt.cdn.models.Sku - :ivar resource_state: Resource status of the profile. Possible values include: "Creating", - "Active", "Deleting", "Disabled". - :vartype resource_state: str or ~azure.mgmt.cdn.models.ProfileResourceState - :ivar provisioning_state: Provisioning status of the profile. - :vartype provisioning_state: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param order: The order in which the rules are applied for the endpoint. Possible values + {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. + Rule with order 0 is a special rule. It does not require any condition and actions listed in it + will always be applied. + :type order: int + :param conditions: A list of conditions that must be matched for the actions to be executed. + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + :param actions: A list of actions that are executed when all the conditions of a rule are + satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :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.cdn.models.MatchProcessingBehavior + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'required': True}, - 'resource_state': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'order': {'key': 'properties.order', 'type': 'int'}, + 'conditions': {'key': 'properties.conditions', 'type': '[DeliveryRuleCondition]'}, + 'actions': {'key': 'properties.actions', 'type': '[DeliveryRuleAction]'}, + 'match_processing_behavior': {'key': 'properties.matchProcessingBehavior', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, } def __init__( self, **kwargs ): - super(Profile, self).__init__(**kwargs) - self.sku = kwargs['sku'] - self.resource_state = None + super(Rule, self).__init__(**kwargs) + self.order = kwargs.get('order', None) + self.conditions = kwargs.get('conditions', None) + self.actions = kwargs.get('actions', None) + self.match_processing_behavior = kwargs.get('match_processing_behavior', None) self.provisioning_state = None + self.deployment_status = None -class ProfileListResult(msrest.serialization.Model): - """Result of the request to list profiles. It contains a list of profile objects and a URL link to get the next set of results. +class RuleListResult(msrest.serialization.Model): + """Result of the request to list rules. It contains a list of rule objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of CDN profiles within a resource group. - :vartype value: list[~azure.mgmt.cdn.models.Profile] - :param next_link: URL to get the next set of profile objects if there are any. + :ivar value: List of AzureFrontDoor rules within a rule set. + :vartype value: list[~azure.mgmt.cdn.models.Rule] + :param next_link: URL to get the next set of rule objects if there are any. :type next_link: str """ @@ -3844,7 +6973,7 @@ class ProfileListResult(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[Profile]'}, + 'value': {'key': 'value', 'type': '[Rule]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -3852,613 +6981,604 @@ def __init__( self, **kwargs ): - super(ProfileListResult, self).__init__(**kwargs) + super(RuleListResult, self).__init__(**kwargs) self.value = None self.next_link = kwargs.get('next_link', None) -class ProfileUpdateParameters(msrest.serialization.Model): - """Properties required to update a profile. +class RuleUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the domain to create. - :param tags: A set of tags. Profile tags. - :type tags: dict[str, str] + :param order: The order in which the rules are applied for the endpoint. Possible values + {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. + Rule with order 0 is a special rule. It does not require any condition and actions listed in it + will always be applied. + :type order: int + :param conditions: A list of conditions that must be matched for the actions to be executed. + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + :param actions: A list of actions that are executed when all the conditions of a rule are + satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :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.cdn.models.MatchProcessingBehavior """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + 'order': {'key': 'order', 'type': 'int'}, + 'conditions': {'key': 'conditions', 'type': '[DeliveryRuleCondition]'}, + 'actions': {'key': 'actions', 'type': '[DeliveryRuleAction]'}, + 'match_processing_behavior': {'key': 'matchProcessingBehavior', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ProfileUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) + super(RuleUpdatePropertiesParameters, self).__init__(**kwargs) + self.order = kwargs.get('order', None) + self.conditions = kwargs.get('conditions', None) + self.actions = kwargs.get('actions', None) + self.match_processing_behavior = kwargs.get('match_processing_behavior', None) -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. +class RuleProperties(AFDStateProperties, RuleUpdatePropertiesParameters): + """The JSON object that contains the properties of the Rules to create. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str + :param order: The order in which the rules are applied for the endpoint. Possible values + {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. + Rule with order 0 is a special rule. It does not require any condition and actions listed in it + will always be applied. + :type order: int + :param conditions: A list of conditions that must be matched for the actions to be executed. + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + :param actions: A list of actions that are executed when all the conditions of a rule are + satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :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.cdn.models.MatchProcessingBehavior + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'conditions': {'key': 'conditions', 'type': '[DeliveryRuleCondition]'}, + 'actions': {'key': 'actions', 'type': '[DeliveryRuleAction]'}, + 'match_processing_behavior': {'key': 'matchProcessingBehavior', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ProxyResource, self).__init__(**kwargs) + super(RuleProperties, self).__init__(**kwargs) + self.order = kwargs.get('order', None) + self.conditions = kwargs.get('conditions', None) + self.actions = kwargs.get('actions', None) + self.match_processing_behavior = kwargs.get('match_processing_behavior', None) + self.provisioning_state = None + self.deployment_status = None -class PurgeParameters(msrest.serialization.Model): - """Parameters required for content purge. +class RuleSet(ProxyResource): + """Friendly RuleSet name mapping to the any RuleSet or secret related information. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param content_paths: Required. The path to the content to be purged. Can describe a file path - or a wild card directory. - :type content_paths: list[str] + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'content_paths': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, } def __init__( self, **kwargs ): - super(PurgeParameters, self).__init__(**kwargs) - self.content_paths = kwargs['content_paths'] + super(RuleSet, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_status = None -class QueryStringMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for QueryString match conditions. +class RuleSetListResult(msrest.serialization.Model): + """Result of the request to list rule sets. It contains a list of rule set objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.QueryStringOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :ivar value: List of AzureFrontDoor rule sets within a profile. + :vartype value: list[~azure.mgmt.cdn.models.RuleSet] + :param next_link: URL to get the next set of rule set objects if there are any. + :type next_link: str """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'value': {'key': 'value', 'type': '[RuleSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters" - def __init__( self, **kwargs ): - super(QueryStringMatchConditionParameters, self).__init__(**kwargs) - self.operator = kwargs['operator'] - self.negate_condition = kwargs.get('negate_condition', None) - self.match_values = kwargs.get('match_values', None) - self.transforms = kwargs.get('transforms', None) + super(RuleSetListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) -class RateLimitRule(CustomRule): - """Defines a rate limiting rule that can be included in a waf policy. +class RuleSetProperties(AFDStateProperties): + """The JSON object that contains the properties of the Rule Set to create. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. Defines the name of the custom rule. - :type name: str - :param enabled_state: Describes if the custom rule is in enabled or disabled state. Defaults to - Enabled if not specified. Possible values include: "Disabled", "Enabled". - :type enabled_state: str or ~azure.mgmt.cdn.models.CustomRuleEnabledState - :param priority: Required. Defines in what order this rule be evaluated in the overall list of - custom rules. - :type priority: int - :param match_conditions: Required. List of match conditions. - :type match_conditions: list[~azure.mgmt.cdn.models.MatchCondition] - :param action: Required. Describes what action to be applied when rule matches. Possible values - include: "Allow", "Block", "Log", "Redirect". - :type action: str or ~azure.mgmt.cdn.models.ActionType - :param rate_limit_threshold: Required. Defines rate limit threshold. - :type rate_limit_threshold: int - :param rate_limit_duration_in_minutes: Required. Defines rate limit duration. Default is 1 - minute. - :type rate_limit_duration_in_minutes: int + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'name': {'required': True}, - 'priority': {'required': True, 'maximum': 1000, 'minimum': 0}, - 'match_conditions': {'required': True}, - 'action': {'required': True}, - 'rate_limit_threshold': {'required': True, 'minimum': 0}, - 'rate_limit_duration_in_minutes': {'required': True, 'maximum': 60, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'enabled_state': {'key': 'enabledState', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, - 'action': {'key': 'action', 'type': 'str'}, - 'rate_limit_threshold': {'key': 'rateLimitThreshold', 'type': 'int'}, - 'rate_limit_duration_in_minutes': {'key': 'rateLimitDurationInMinutes', 'type': 'int'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } def __init__( self, **kwargs ): - super(RateLimitRule, self).__init__(**kwargs) - self.rate_limit_threshold = kwargs['rate_limit_threshold'] - self.rate_limit_duration_in_minutes = kwargs['rate_limit_duration_in_minutes'] + super(RuleSetProperties, self).__init__(**kwargs) -class RateLimitRuleList(msrest.serialization.Model): - """Defines contents of rate limit rules. +class RuleUpdateParameters(msrest.serialization.Model): + """The domain JSON object required for domain creation or update. - :param rules: List of rules. - :type rules: list[~azure.mgmt.cdn.models.RateLimitRule] + :param order: The order in which the rules are applied for the endpoint. Possible values + {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. + Rule with order 0 is a special rule. It does not require any condition and actions listed in it + will always be applied. + :type order: int + :param conditions: A list of conditions that must be matched for the actions to be executed. + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + :param actions: A list of actions that are executed when all the conditions of a rule are + satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :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.cdn.models.MatchProcessingBehavior """ _attribute_map = { - 'rules': {'key': 'rules', 'type': '[RateLimitRule]'}, + 'order': {'key': 'properties.order', 'type': 'int'}, + 'conditions': {'key': 'properties.conditions', 'type': '[DeliveryRuleCondition]'}, + 'actions': {'key': 'properties.actions', 'type': '[DeliveryRuleAction]'}, + 'match_processing_behavior': {'key': 'properties.matchProcessingBehavior', 'type': 'str'}, } def __init__( self, **kwargs ): - super(RateLimitRuleList, self).__init__(**kwargs) - self.rules = kwargs.get('rules', None) - - -class RemoteAddressMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RemoteAddress match conditions. + super(RuleUpdateParameters, self).__init__(**kwargs) + self.order = kwargs.get('order', None) + self.conditions = kwargs.get('conditions', None) + self.actions = kwargs.get('actions', None) + self.match_processing_behavior = kwargs.get('match_processing_behavior', None) - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. +class Secret(ProxyResource): + """Friendly Secret name mapping to the any Secret or secret related information. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "IPMatch", "GeoMatch". - :type operator: str or ~azure.mgmt.cdn.models.RemoteAddressOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: 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 match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :param parameters: object which contains secret parameters. + :type parameters: ~azure.mgmt.cdn.models.SecretParameters """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': 'SecretParameters'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters" - def __init__( self, **kwargs ): - super(RemoteAddressMatchConditionParameters, self).__init__(**kwargs) - self.operator = kwargs['operator'] - self.negate_condition = kwargs.get('negate_condition', None) - self.match_values = kwargs.get('match_values', None) - self.transforms = kwargs.get('transforms', None) + super(Secret, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_status = None + self.parameters = kwargs.get('parameters', None) -class RequestBodyMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RequestBody match conditions. +class SecretListResult(msrest.serialization.Model): + """Result of the request to list secrets. It contains a list of Secret objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.RequestBodyOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :ivar value: List of AzureFrontDoor secrets within a profile. + :vartype value: list[~azure.mgmt.cdn.models.Secret] + :param next_link: URL to get the next set of Secret objects if there are any. + :type next_link: str """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'value': {'key': 'value', 'type': '[Secret]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters" - def __init__( self, **kwargs ): - super(RequestBodyMatchConditionParameters, self).__init__(**kwargs) - self.operator = kwargs['operator'] - self.negate_condition = kwargs.get('negate_condition', None) - self.match_values = kwargs.get('match_values', None) - self.transforms = kwargs.get('transforms', None) + super(SecretListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) -class RequestHeaderMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RequestHeader match conditions. +class SecretProperties(AFDStateProperties): + """The JSON object that contains the properties of the Secret to create. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters". - :vartype odata_type: str - :param selector: Name of Header to be matched. - :type selector: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.RequestHeaderOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :param parameters: object which contains secret parameters. + :type parameters: ~azure.mgmt.cdn.models.SecretParameters """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'selector': {'key': 'selector', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'SecretParameters'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters" - def __init__( self, **kwargs ): - super(RequestHeaderMatchConditionParameters, self).__init__(**kwargs) - self.selector = kwargs.get('selector', None) - self.operator = kwargs['operator'] - self.negate_condition = kwargs.get('negate_condition', None) - self.match_values = kwargs.get('match_values', None) - self.transforms = kwargs.get('transforms', None) + super(SecretProperties, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) -class RequestMethodMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RequestMethod match conditions. +class SecurityPolicy(ProxyResource): + """SecurityPolicy association for AzureFrontDoor profile. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Equal". - :type operator: str or ~azure.mgmt.cdn.models.RequestMethodOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str or - ~azure.mgmt.cdn.models.RequestMethodMatchConditionParametersMatchValuesItem] + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :param parameters: object which contains security policy parameters. + :type parameters: ~azure.mgmt.cdn.models.SecurityPolicyWebApplicationFirewallParameters """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': 'SecurityPolicyWebApplicationFirewallParameters'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters" - def __init__( self, **kwargs ): - super(RequestMethodMatchConditionParameters, self).__init__(**kwargs) - self.operator = kwargs['operator'] - self.negate_condition = kwargs.get('negate_condition', None) - self.match_values = kwargs.get('match_values', None) + super(SecurityPolicy, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_status = None + self.parameters = kwargs.get('parameters', None) -class RequestSchemeMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RequestScheme match conditions. +class SecurityPolicyListResult(msrest.serialization.Model): + """Result of the request to list security policies. It contains a list of security policy objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters". - :vartype odata_type: str - :ivar operator: Required. Describes operator to be matched. Default value: "Equal". - :vartype operator: str - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str or - ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParametersMatchValuesItem] + :ivar value: List of Security policies within a profile. + :vartype value: list[~azure.mgmt.cdn.models.SecurityPolicy] + :param next_link: URL to get the next set of security policy objects if there is any. + :type next_link: str """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True, 'constant': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'value': {'key': 'value', 'type': '[SecurityPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters" - operator = "Equal" - def __init__( self, **kwargs ): - super(RequestSchemeMatchConditionParameters, self).__init__(**kwargs) - self.negate_condition = kwargs.get('negate_condition', None) - self.match_values = kwargs.get('match_values', None) + super(SecurityPolicyListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) -class RequestUriMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RequestUri match conditions. +class SecurityPolicyParameters(msrest.serialization.Model): + """The json object containing security policy parameters. - Variables are only populated by the server, and will be ignored when sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SecurityPolicyWebApplicationFirewallParameters. All required parameters must be populated in order to send to Azure. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.RequestUriOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :param type: Required. The type of the Security policy to create.Constant filled by server. + Possible values include: "WebApplicationFirewall". + :type type: str or ~azure.mgmt.cdn.models.SecurityPolicyType """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'type': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters" + _subtype_map = { + 'type': {'WebApplicationFirewall': 'SecurityPolicyWebApplicationFirewallParameters'} + } def __init__( self, **kwargs ): - super(RequestUriMatchConditionParameters, self).__init__(**kwargs) - self.operator = kwargs['operator'] - self.negate_condition = kwargs.get('negate_condition', None) - self.match_values = kwargs.get('match_values', None) - self.transforms = kwargs.get('transforms', None) + super(SecurityPolicyParameters, self).__init__(**kwargs) + self.type = None # type: Optional[str] -class ResourceReference(msrest.serialization.Model): - """Reference to another resource. +class SecurityPolicyProperties(AFDStateProperties): + """The json object that contains properties required to create a security policy. - :param id: Resource ID. - :type id: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :param parameters: object which contains security policy parameters. + :type parameters: ~azure.mgmt.cdn.models.SecurityPolicyWebApplicationFirewallParameters """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + } + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'SecurityPolicyWebApplicationFirewallParameters'}, } def __init__( self, **kwargs ): - super(ResourceReference, self).__init__(**kwargs) - self.id = kwargs.get('id', None) + super(SecurityPolicyProperties, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) -class ResourceUsage(msrest.serialization.Model): - """Output of check resource usage API. - - Variables are only populated by the server, and will be ignored when sending a request. +class SecurityPolicyWebApplicationFirewallAssociation(msrest.serialization.Model): + """settings for security policy patterns to match. - :ivar resource_type: Resource type for which the usage is provided. - :vartype resource_type: str - :ivar unit: Unit of the usage. e.g. Count. - :vartype unit: str - :ivar current_value: Actual value of usage on the specified resource type. - :vartype current_value: int - :ivar limit: Quota of the specified resource type. - :vartype limit: int + :param domains: List of domains. + :type domains: list[~azure.mgmt.cdn.models.ResourceReference] + :param patterns_to_match: List of paths. + :type patterns_to_match: list[str] """ - _validation = { - 'resource_type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - } - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, + 'domains': {'key': 'domains', 'type': '[ResourceReference]'}, + 'patterns_to_match': {'key': 'patternsToMatch', 'type': '[str]'}, } def __init__( self, **kwargs ): - super(ResourceUsage, self).__init__(**kwargs) - self.resource_type = None - self.unit = None - self.current_value = None - self.limit = None + super(SecurityPolicyWebApplicationFirewallAssociation, self).__init__(**kwargs) + self.domains = kwargs.get('domains', None) + self.patterns_to_match = kwargs.get('patterns_to_match', None) -class ResourceUsageListResult(msrest.serialization.Model): - """Output of check resource usage API. +class SecurityPolicyWebApplicationFirewallParameters(SecurityPolicyParameters): + """The json object containing security policy waf parameters. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: List of resource usages. - :vartype value: list[~azure.mgmt.cdn.models.ResourceUsage] - :param next_link: URL to get the next set of custom domain objects if there are any. - :type next_link: str + :param type: Required. The type of the Security policy to create.Constant filled by server. + Possible values include: "WebApplicationFirewall". + :type type: str or ~azure.mgmt.cdn.models.SecurityPolicyType + :param waf_policy: Resource ID. + :type waf_policy: ~azure.mgmt.cdn.models.ResourceReference + :param associations: Waf associations. + :type associations: + list[~azure.mgmt.cdn.models.SecurityPolicyWebApplicationFirewallAssociation] """ _validation = { - 'value': {'readonly': True}, + 'type': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceUsage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'waf_policy': {'key': 'wafPolicy', 'type': 'ResourceReference'}, + 'associations': {'key': 'associations', 'type': '[SecurityPolicyWebApplicationFirewallAssociation]'}, } def __init__( self, **kwargs ): - super(ResourceUsageListResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) + super(SecurityPolicyWebApplicationFirewallParameters, self).__init__(**kwargs) + self.type = 'WebApplicationFirewall' # type: str + self.waf_policy = kwargs.get('waf_policy', None) + self.associations = kwargs.get('associations', None) -class ResponseBasedOriginErrorDetectionParameters(msrest.serialization.Model): - """The JSON object that contains the properties to determine origin health using real requests/responses. +class SharedPrivateLinkResourceProperties(msrest.serialization.Model): + """Describes the properties of an existing Shared Private Link Resource to use when connecting to a private origin. - :param response_based_detected_error_types: Type of response errors for real user requests for - which origin will be deemed unhealthy. Possible values include: "None", "TcpErrorsOnly", - "TcpAndHttpErrors". - :type response_based_detected_error_types: str or - ~azure.mgmt.cdn.models.ResponseBasedDetectedErrorTypes - :param response_based_failover_threshold_percentage: The percentage of failed requests in the - sample where failover should trigger. - :type response_based_failover_threshold_percentage: int - :param http_error_ranges: The list of Http status code ranges that are considered as server - errors for origin and it is marked as unhealthy. - :type http_error_ranges: list[~azure.mgmt.cdn.models.HttpErrorRangeParameters] + :param private_link: The resource id of the resource the shared private link resource is for. + :type private_link: ~azure.mgmt.cdn.models.ResourceReference + :param private_link_location: The location of the shared private link resource. + :type private_link_location: str + :param group_id: The group id from the provider of resource the shared private link resource is + for. + :type group_id: str + :param request_message: The request message for requesting approval of the shared private link + resource. + :type request_message: str + :param status: Status of the shared private link resource. Can be Pending, Approved, Rejected, + Disconnected, or Timeout. Possible values include: "Pending", "Approved", "Rejected", + "Disconnected", "Timeout". + :type status: str or ~azure.mgmt.cdn.models.SharedPrivateLinkResourceStatus """ - _validation = { - 'response_based_failover_threshold_percentage': {'maximum': 100, 'minimum': 0}, - } - _attribute_map = { - 'response_based_detected_error_types': {'key': 'responseBasedDetectedErrorTypes', 'type': 'str'}, - 'response_based_failover_threshold_percentage': {'key': 'responseBasedFailoverThresholdPercentage', 'type': 'int'}, - 'http_error_ranges': {'key': 'httpErrorRanges', 'type': '[HttpErrorRangeParameters]'}, + 'private_link': {'key': 'privateLink', 'type': 'ResourceReference'}, + 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'request_message': {'key': 'requestMessage', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ResponseBasedOriginErrorDetectionParameters, self).__init__(**kwargs) - self.response_based_detected_error_types = kwargs.get('response_based_detected_error_types', None) - self.response_based_failover_threshold_percentage = kwargs.get('response_based_failover_threshold_percentage', None) - self.http_error_ranges = kwargs.get('http_error_ranges', None) + super(SharedPrivateLinkResourceProperties, self).__init__(**kwargs) + self.private_link = kwargs.get('private_link', None) + self.private_link_location = kwargs.get('private_link_location', None) + self.group_id = kwargs.get('group_id', None) + self.request_message = kwargs.get('request_message', None) + self.status = kwargs.get('status', None) class Sku(msrest.serialization.Model): @@ -4466,7 +7586,9 @@ class Sku(msrest.serialization.Model): :param name: Name of the pricing tier. Possible values include: "Standard_Verizon", "Premium_Verizon", "Custom_Verizon", "Standard_Akamai", "Standard_ChinaCdn", - "Standard_Microsoft", "Premium_ChinaCdn". + "Standard_Microsoft", "Premium_ChinaCdn", "Standard_AzureFrontDoor", "Premium_AzureFrontDoor", + "Standard_955BandWidth_ChinaCdn", "Standard_AvgBandWidth_ChinaCdn", "StandardPlus_ChinaCdn", + "StandardPlus_955BandWidth_ChinaCdn", "StandardPlus_AvgBandWidth_ChinaCdn". :type name: str or ~azure.mgmt.cdn.models.SkuName """ @@ -4532,6 +7654,47 @@ def __init__( self.supported_optimization_types = None +class SystemData(msrest.serialization.Model): + """Read only system data. + + :param created_by: An identifier for the identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "user", "application", "managedIdentity", "key". + :type created_by_type: str or ~azure.mgmt.cdn.models.IdentityType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: An identifier for the identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "user", "application", "managedIdentity", "key". + :type last_modified_by_type: str or ~azure.mgmt.cdn.models.IdentityType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + class UrlFileExtensionMatchConditionParameters(msrest.serialization.Model): """Defines the parameters for UrlFileExtension match conditions. @@ -4544,7 +7707,7 @@ class UrlFileExtensionMatchConditionParameters(msrest.serialization.Model): :vartype odata_type: str :param operator: Required. Describes operator to be matched. Possible values include: "Any", "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". + "GreaterThanOrEqual", "RegEx". :type operator: str or ~azure.mgmt.cdn.models.UrlFileExtensionOperator :param negate_condition: Describes if this is negate condition or not. :type negate_condition: bool @@ -4592,7 +7755,7 @@ class UrlFileNameMatchConditionParameters(msrest.serialization.Model): :vartype odata_type: str :param operator: Required. Describes operator to be matched. Possible values include: "Any", "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". + "GreaterThanOrEqual", "RegEx". :type operator: str or ~azure.mgmt.cdn.models.UrlFileNameOperator :param negate_condition: Describes if this is negate condition or not. :type negate_condition: bool @@ -4640,7 +7803,7 @@ class UrlPathMatchConditionParameters(msrest.serialization.Model): :vartype odata_type: str :param operator: Required. Describes operator to be matched. Possible values include: "Any", "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual", "Wildcard". + "GreaterThanOrEqual", "Wildcard", "RegEx". :type operator: str or ~azure.mgmt.cdn.models.UrlPathOperator :param negate_condition: Describes if this is negate condition or not. :type negate_condition: bool @@ -4683,8 +7846,8 @@ class UrlRedirectAction(DeliveryRuleAction): :param name: Required. The name of the action for the delivery rule.Constant filled by server. Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum :param parameters: Required. Defines the parameters for the action. :type parameters: ~azure.mgmt.cdn.models.UrlRedirectActionParameters """ @@ -4777,8 +7940,8 @@ class UrlRewriteAction(DeliveryRuleAction): :param name: Required. The name of the action for the delivery rule.Constant filled by server. Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum :param parameters: Required. Defines the parameters for the action. :type parameters: ~azure.mgmt.cdn.models.UrlRewriteActionParameters """ @@ -4854,8 +8017,8 @@ class UrlSigningAction(DeliveryRuleAction): :param name: Required. The name of the action for the delivery rule.Constant filled by server. Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum :param parameters: Required. Defines the parameters for the action. :type parameters: ~azure.mgmt.cdn.models.UrlSigningActionParameters """ @@ -4886,32 +8049,24 @@ class UrlSigningActionParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar odata_type: Default value: + :ivar odata_type: Required. Default value: "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlSigningActionParameters". :vartype odata_type: str - :param key_id: Required. Id reference of the key to be used to verify the hash and should be - defined in UrlSigningKeys. - :type key_id: str :param algorithm: Algorithm to use for URL signing. Possible values include: "SHA256". :type algorithm: str or ~azure.mgmt.cdn.models.Algorithm :param parameter_name_override: Defines which query string parameters in the url to be considered for expires, key id etc. :type parameter_name_override: list[~azure.mgmt.cdn.models.UrlSigningParamIdentifier] - :param ip_subnets: Match values to match against. Supports CIDR ranges (both IPv4 and IPv6). - :type ip_subnets: list[str] """ _validation = { - 'odata_type': {'constant': True}, - 'key_id': {'required': True}, + 'odata_type': {'required': True, 'constant': True}, } _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'key_id': {'key': 'keyId', 'type': 'str'}, 'algorithm': {'key': 'algorithm', 'type': 'str'}, 'parameter_name_override': {'key': 'parameterNameOverride', 'type': '[UrlSigningParamIdentifier]'}, - 'ip_subnets': {'key': 'ipSubnets', 'type': '[str]'}, } odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlSigningActionParameters" @@ -4921,10 +8076,8 @@ def __init__( **kwargs ): super(UrlSigningActionParameters, self).__init__(**kwargs) - self.key_id = kwargs['key_id'] self.algorithm = kwargs.get('algorithm', None) self.parameter_name_override = kwargs.get('parameter_name_override', None) - self.ip_subnets = kwargs.get('ip_subnets', None) class UrlSigningKey(msrest.serialization.Model): @@ -4959,6 +8112,47 @@ def __init__( self.key_source_parameters = kwargs['key_source_parameters'] +class UrlSigningKeyParameters(SecretParameters): + """Url signing key parameters. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The type of the Secret to create.Constant filled by server. Possible + values include: "UrlSigningKey", "CustomerCertificate", "ManagedCertificate". + :type type: str or ~azure.mgmt.cdn.models.SecretType + :param key_id: Required. Defines the customer defined key Id. This id will exist in the + incoming request to indicate the key used to form the hash. + :type key_id: str + :param secret_source: Required. Resource reference to the KV secret. + :type secret_source: ~azure.mgmt.cdn.models.ResourceReference + :param secret_version: Version of the secret to be used. + :type secret_version: str + """ + + _validation = { + 'type': {'required': True}, + 'key_id': {'required': True}, + 'secret_source': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'key_id': {'key': 'keyId', 'type': 'str'}, + 'secret_source': {'key': 'secretSource', 'type': 'ResourceReference'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UrlSigningKeyParameters, self).__init__(**kwargs) + self.type = 'UrlSigningKey' # type: str + self.key_id = kwargs['key_id'] + self.secret_source = kwargs['secret_source'] + self.secret_version = kwargs.get('secret_version', None) + + class UrlSigningParamIdentifier(msrest.serialization.Model): """Defines how to identify a parameter for a specific purpose e.g. expires. @@ -4990,6 +8184,100 @@ def __init__( self.param_name = kwargs['param_name'] +class Usage(msrest.serialization.Model): + """Describes resource usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource identifier. + :vartype id: str + :param unit: Required. An enum describing the unit of measurement. Possible values include: + "Count". + :type unit: str or ~azure.mgmt.cdn.models.UsageUnit + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.cdn.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = None + self.unit = kwargs['unit'] + self.current_value = kwargs['current_value'] + self.limit = kwargs['limit'] + self.name = kwargs['name'] + + +class UsageName(msrest.serialization.Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) + + +class UsagesListResult(msrest.serialization.Model): + """The list usages operation response. + + :param value: The list of resource usages. + :type value: list[~azure.mgmt.cdn.models.Usage] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsagesListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + class UserManagedHttpsParameters(CustomDomainHttpsParameters): """Defines the certificate source parameters using user's keyvault certificate for enabling SSL. @@ -5149,3 +8437,231 @@ def __init__( self.is_valid = None self.error_code = None self.message = None + + +class ValidateSecretInput(msrest.serialization.Model): + """Input of the secret to be validated. + + All required parameters must be populated in order to send to Azure. + + :param secret_source: Required. The secret source. + :type secret_source: ~azure.mgmt.cdn.models.ResourceReference + :param secret_type: Required. The secret type. Possible values include: "UrlSigningKey", + "ManagedCertificate", "CustomerCertificate". + :type secret_type: str or ~azure.mgmt.cdn.models.ValidateSecretType + """ + + _validation = { + 'secret_source': {'required': True}, + 'secret_type': {'required': True}, + } + + _attribute_map = { + 'secret_source': {'key': 'secretSource', 'type': 'ResourceReference'}, + 'secret_type': {'key': 'secretType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateSecretInput, self).__init__(**kwargs) + self.secret_source = kwargs['secret_source'] + self.secret_type = kwargs['secret_type'] + + +class ValidateSecretOutput(msrest.serialization.Model): + """Output of the validated secret. + + :param status: The validation status. Possible values include: "Valid", "Invalid", + "AccessDenied", "CertificateExpired". + :type status: str or ~azure.mgmt.cdn.models.Status + :param message: Detailed error message. + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateSecretOutput, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) + + +class ValidationToken(msrest.serialization.Model): + """The validation token. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar token: + :vartype token: str + """ + + _validation = { + 'token': {'readonly': True}, + } + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidationToken, self).__init__(**kwargs) + self.token = None + + +class WafMetricsResponse(msrest.serialization.Model): + """Waf Metrics Response. + + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param granularity: Possible values include: "PT5M", "PT1H", "P1D". + :type granularity: str or ~azure.mgmt.cdn.models.WafMetricsResponseGranularity + :param series: + :type series: list[~azure.mgmt.cdn.models.WafMetricsResponseSeriesItem] + """ + + _attribute_map = { + 'date_time_begin': {'key': 'dateTimeBegin', 'type': 'iso-8601'}, + 'date_time_end': {'key': 'dateTimeEnd', 'type': 'iso-8601'}, + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'series': {'key': 'series', 'type': '[WafMetricsResponseSeriesItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(WafMetricsResponse, self).__init__(**kwargs) + self.date_time_begin = kwargs.get('date_time_begin', None) + self.date_time_end = kwargs.get('date_time_end', None) + self.granularity = kwargs.get('granularity', None) + self.series = kwargs.get('series', None) + + +class WafMetricsResponseSeriesItem(msrest.serialization.Model): + """WafMetricsResponseSeriesItem. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param metric: + :type metric: str + :ivar unit: Default value: "count". + :vartype unit: str + :param groups: + :type groups: list[~azure.mgmt.cdn.models.WafMetricsResponseSeriesPropertiesItemsItem] + :param data: + :type data: + list[~azure.mgmt.cdn.models.Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems] + """ + + _validation = { + 'unit': {'constant': True}, + } + + _attribute_map = { + 'metric': {'key': 'metric', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[WafMetricsResponseSeriesPropertiesItemsItem]'}, + 'data': {'key': 'data', 'type': '[Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems]'}, + } + + unit = "count" + + def __init__( + self, + **kwargs + ): + super(WafMetricsResponseSeriesItem, self).__init__(**kwargs) + self.metric = kwargs.get('metric', None) + self.groups = kwargs.get('groups', None) + self.data = kwargs.get('data', None) + + +class WafMetricsResponseSeriesPropertiesItemsItem(msrest.serialization.Model): + """WafMetricsResponseSeriesPropertiesItemsItem. + + :param name: + :type name: str + :param value: + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WafMetricsResponseSeriesPropertiesItemsItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class WafRankingsResponse(msrest.serialization.Model): + """Waf Rankings Response. + + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param groups: + :type groups: list[str] + :param data: + :type data: list[~azure.mgmt.cdn.models.WafRankingsResponseDataItem] + """ + + _attribute_map = { + 'date_time_begin': {'key': 'dateTimeBegin', 'type': 'iso-8601'}, + 'date_time_end': {'key': 'dateTimeEnd', 'type': 'iso-8601'}, + 'groups': {'key': 'groups', 'type': '[str]'}, + 'data': {'key': 'data', 'type': '[WafRankingsResponseDataItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(WafRankingsResponse, self).__init__(**kwargs) + self.date_time_begin = kwargs.get('date_time_begin', None) + self.date_time_end = kwargs.get('date_time_end', None) + self.groups = kwargs.get('groups', None) + self.data = kwargs.get('data', None) + + +class WafRankingsResponseDataItem(msrest.serialization.Model): + """WafRankingsResponseDataItem. + + :param group_values: + :type group_values: list[str] + :param metrics: + :type metrics: + list[~azure.mgmt.cdn.models.ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems] + """ + + _attribute_map = { + 'group_values': {'key': 'groupValues', 'type': '[str]'}, + 'metrics': {'key': 'metrics', 'type': '[ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems]'}, + } + + def __init__( + self, + **kwargs + ): + super(WafRankingsResponseDataItem, self).__init__(**kwargs) + self.group_values = kwargs.get('group_values', None) + self.metrics = kwargs.get('metrics', None) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_models_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_models_py3.py index dd439a40c5eb..d82b8ee6889f 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_models_py3.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_models_py3.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError @@ -14,300 +15,403 @@ from ._cdn_management_client_enums import * -class CacheExpirationActionParameters(msrest.serialization.Model): - """Defines the parameters for the cache expiration action. +class Resource(msrest.serialization.Model): + """The core properties of ARM resources. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters". - :vartype odata_type: str - :param cache_behavior: Required. Caching behavior for the requests. Possible values include: - "BypassCache", "Override", "SetIfMissing". - :type cache_behavior: str or ~azure.mgmt.cdn.models.CacheBehavior - :param cache_type: Required. The level at which the content needs to be cached. Possible values - include: "All". - :type cache_type: str or ~azure.mgmt.cdn.models.CacheType - :param cache_duration: The duration for which the content needs to be cached. Allowed format is - [d.]hh:mm:ss. - :type cache_duration: str + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'cache_behavior': {'required': True}, - 'cache_type': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'cache_behavior': {'key': 'cacheBehavior', 'type': 'str'}, - 'cache_type': {'key': 'cacheType', 'type': 'str'}, - 'cache_duration': {'key': 'cacheDuration', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" - def __init__( self, - *, - cache_behavior: Union[str, "CacheBehavior"], - cache_type: Union[str, "CacheType"], - cache_duration: Optional[str] = None, **kwargs ): - super(CacheExpirationActionParameters, self).__init__(**kwargs) - self.cache_behavior = cache_behavior - self.cache_type = cache_type - self.cache_duration = cache_duration + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class CacheKeyQueryStringActionParameters(msrest.serialization.Model): - """Defines the parameters for the cache-key query string action. +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters". - :vartype odata_type: str - :param query_string_behavior: Required. Caching behavior for the requests. Possible values - include: "Include", "IncludeAll", "Exclude", "ExcludeAll". - :type query_string_behavior: str or ~azure.mgmt.cdn.models.QueryStringBehavior - :param query_parameters: query parameters to include or exclude (comma separated). - :type query_parameters: str + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'query_string_behavior': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'query_string_behavior': {'key': 'queryStringBehavior', 'type': 'str'}, - 'query_parameters': {'key': 'queryParameters', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters" - def __init__( self, - *, - query_string_behavior: Union[str, "QueryStringBehavior"], - query_parameters: Optional[str] = None, **kwargs ): - super(CacheKeyQueryStringActionParameters, self).__init__(**kwargs) - self.query_string_behavior = query_string_behavior - self.query_parameters = query_parameters + super(ProxyResource, self).__init__(**kwargs) + self.system_data = None -class CdnCertificateSourceParameters(msrest.serialization.Model): - """Defines the parameters for using CDN managed certificate for securing custom domain. +class AFDDomain(ProxyResource): + """Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters". - :vartype odata_type: str - :param certificate_type: Required. Type of certificate used. Possible values include: "Shared", - "Dedicated". - :type certificate_type: str or ~azure.mgmt.cdn.models.CertificateType + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param tls_settings: The configuration specifying how to enable HTTPS for the domain - using + AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl + uses AzureFrontDoor managed certificate by default. + :type tls_settings: ~azure.mgmt.cdn.models.AFDDomainHttpsParameters + :param azure_dns_zone: Resource reference to the Azure DNS zone. + :type azure_dns_zone: ~azure.mgmt.cdn.models.ResourceReference + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :ivar domain_validation_state: Provisioning substate shows the progress of custom HTTPS + enabling/disabling process step by step. DCV stands for DomainControlValidation. Possible + values include: "Unknown", "Submitting", "Pending", "TimedOut", "PendingRevalidation", + "Approved". + :vartype domain_validation_state: str or ~azure.mgmt.cdn.models.DomainValidationState + :param host_name: The host name of the domain. Must be a domain name. + :type host_name: str + :ivar validation_properties: Values the customer needs to validate domain ownership. + :vartype validation_properties: ~azure.mgmt.cdn.models.DomainValidationProperties """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'certificate_type': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + 'domain_validation_state': {'readonly': True}, + 'validation_properties': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'certificate_type': {'key': 'certificateType', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tls_settings': {'key': 'properties.tlsSettings', 'type': 'AFDDomainHttpsParameters'}, + 'azure_dns_zone': {'key': 'properties.azureDnsZone', 'type': 'ResourceReference'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + 'domain_validation_state': {'key': 'properties.domainValidationState', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'validation_properties': {'key': 'properties.validationProperties', 'type': 'DomainValidationProperties'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters" - def __init__( self, *, - certificate_type: Union[str, "CertificateType"], + tls_settings: Optional["AFDDomainHttpsParameters"] = None, + azure_dns_zone: Optional["ResourceReference"] = None, + host_name: Optional[str] = None, **kwargs ): - super(CdnCertificateSourceParameters, self).__init__(**kwargs) - self.certificate_type = certificate_type + super(AFDDomain, self).__init__(**kwargs) + self.tls_settings = tls_settings + self.azure_dns_zone = azure_dns_zone + self.provisioning_state = None + self.deployment_status = None + self.domain_validation_state = None + self.host_name = host_name + self.validation_properties = None -class CdnEndpoint(msrest.serialization.Model): - """Defines the ARM Resource ID for the linked endpoints. +class AFDDomainHttpsParameters(msrest.serialization.Model): + """The JSON object that contains the properties to secure a domain. - :param id: ARM Resource ID string. - :type id: str + All required parameters must be populated in order to send to Azure. + + :param certificate_type: Required. Defines the source of the SSL certificate. Possible values + include: "CustomerCertificate", "ManagedCertificate". + :type certificate_type: str or ~azure.mgmt.cdn.models.AfdCertificateType + :param minimum_tls_version: TLS protocol version that will be used for Https. Possible values + include: "TLS10", "TLS12". + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.AfdMinimumTlsVersion + :param secret: Resource reference to the secret. ie. subs/rg/profile/secret. + :type secret: ~azure.mgmt.cdn.models.ResourceReference """ + _validation = { + 'certificate_type': {'required': True}, + } + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'certificate_type': {'key': 'certificateType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'ResourceReference'}, } def __init__( self, *, - id: Optional[str] = None, + certificate_type: Union[str, "AfdCertificateType"], + minimum_tls_version: Optional[Union[str, "AfdMinimumTlsVersion"]] = None, + secret: Optional["ResourceReference"] = None, **kwargs ): - super(CdnEndpoint, self).__init__(**kwargs) - self.id = id - + super(AFDDomainHttpsParameters, self).__init__(**kwargs) + self.certificate_type = certificate_type + self.minimum_tls_version = minimum_tls_version + self.secret = secret -class CustomDomainHttpsParameters(msrest.serialization.Model): - """The JSON object that contains the properties to secure a custom domain. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: UserManagedHttpsParameters, CdnManagedHttpsParameters. +class AFDDomainListResult(msrest.serialization.Model): + """Result of the request to list domains. It contains a list of domain objects and a URL link to get the next set of results. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param certificate_source: Required. Defines the source of the SSL certificate.Constant filled - by server. Possible values include: "AzureKeyVault", "Cdn". - :type certificate_source: str or ~azure.mgmt.cdn.models.CertificateSource - :param protocol_type: Required. Defines the TLS extension protocol that is used for secure - delivery. Possible values include: "ServerNameIndication", "IPBased". - :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType - :param minimum_tls_version: TLS protocol version that will be used for Https. Possible values - include: "None", "TLS10", "TLS12". - :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion + :ivar value: List of AzureFrontDoor domains within a profile. + :vartype value: list[~azure.mgmt.cdn.models.AFDDomain] + :param next_link: URL to get the next set of domain objects if there are any. + :type next_link: str """ _validation = { - 'certificate_source': {'required': True}, - 'protocol_type': {'required': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, - 'protocol_type': {'key': 'protocolType', 'type': 'str'}, - 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, - } - - _subtype_map = { - 'certificate_source': {'AzureKeyVault': 'UserManagedHttpsParameters', 'Cdn': 'CdnManagedHttpsParameters'} + 'value': {'key': 'value', 'type': '[AFDDomain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - protocol_type: Union[str, "ProtocolType"], - minimum_tls_version: Optional[Union[str, "MinimumTlsVersion"]] = None, + next_link: Optional[str] = None, **kwargs ): - super(CustomDomainHttpsParameters, self).__init__(**kwargs) - self.certificate_source = None # type: Optional[str] - self.protocol_type = protocol_type - self.minimum_tls_version = minimum_tls_version + super(AFDDomainListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link -class CdnManagedHttpsParameters(CustomDomainHttpsParameters): - """Defines the certificate source parameters using CDN managed certificate for enabling SSL. +class AFDStateProperties(msrest.serialization.Model): + """The tracking states for afd resources. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param certificate_source: Required. Defines the source of the SSL certificate.Constant filled - by server. Possible values include: "AzureKeyVault", "Cdn". - :type certificate_source: str or ~azure.mgmt.cdn.models.CertificateSource - :param protocol_type: Required. Defines the TLS extension protocol that is used for secure - delivery. Possible values include: "ServerNameIndication", "IPBased". - :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType - :param minimum_tls_version: TLS protocol version that will be used for Https. Possible values - include: "None", "TLS10", "TLS12". - :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion - :param certificate_source_parameters: Required. Defines the certificate source parameters using - CDN managed certificate for enabling SSL. - :type certificate_source_parameters: ~azure.mgmt.cdn.models.CdnCertificateSourceParameters + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'certificate_source': {'required': True}, - 'protocol_type': {'required': True}, - 'certificate_source_parameters': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, - 'protocol_type': {'key': 'protocolType', 'type': 'str'}, - 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, - 'certificate_source_parameters': {'key': 'certificateSourceParameters', 'type': 'CdnCertificateSourceParameters'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } def __init__( self, - *, - protocol_type: Union[str, "ProtocolType"], - certificate_source_parameters: "CdnCertificateSourceParameters", - minimum_tls_version: Optional[Union[str, "MinimumTlsVersion"]] = None, **kwargs ): - super(CdnManagedHttpsParameters, self).__init__(protocol_type=protocol_type, minimum_tls_version=minimum_tls_version, **kwargs) - self.certificate_source = 'Cdn' # type: str - self.certificate_source_parameters = certificate_source_parameters - + super(AFDStateProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_status = None -class Resource(msrest.serialization.Model): - """The core properties of ARM resources. - Variables are only populated by the server, and will be ignored when sending a request. +class AFDDomainUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the domain to create. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str + :param tls_settings: The configuration specifying how to enable HTTPS for the domain - using + AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl + uses AzureFrontDoor managed certificate by default. + :type tls_settings: ~azure.mgmt.cdn.models.AFDDomainHttpsParameters + :param azure_dns_zone: Resource reference to the Azure DNS zone. + :type azure_dns_zone: ~azure.mgmt.cdn.models.ResourceReference """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'tls_settings': {'key': 'tlsSettings', 'type': 'AFDDomainHttpsParameters'}, + 'azure_dns_zone': {'key': 'azureDnsZone', 'type': 'ResourceReference'}, } def __init__( self, + *, + tls_settings: Optional["AFDDomainHttpsParameters"] = None, + azure_dns_zone: Optional["ResourceReference"] = None, **kwargs ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(AFDDomainUpdatePropertiesParameters, self).__init__(**kwargs) + self.tls_settings = tls_settings + self.azure_dns_zone = azure_dns_zone -class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. +class AFDDomainProperties(AFDDomainUpdatePropertiesParameters, AFDStateProperties): + """The JSON object that contains the properties of the domain to create. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :param tls_settings: The configuration specifying how to enable HTTPS for the domain - using + AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl + uses AzureFrontDoor managed certificate by default. + :type tls_settings: ~azure.mgmt.cdn.models.AFDDomainHttpsParameters + :param azure_dns_zone: Resource reference to the Azure DNS zone. + :type azure_dns_zone: ~azure.mgmt.cdn.models.ResourceReference + :ivar domain_validation_state: Provisioning substate shows the progress of custom HTTPS + enabling/disabling process step by step. DCV stands for DomainControlValidation. Possible + values include: "Unknown", "Submitting", "Pending", "TimedOut", "PendingRevalidation", + "Approved". + :vartype domain_validation_state: str or ~azure.mgmt.cdn.models.DomainValidationState + :param host_name: Required. The host name of the domain. Must be a domain name. + :type host_name: str + :ivar validation_properties: Values the customer needs to validate domain ownership. + :vartype validation_properties: ~azure.mgmt.cdn.models.DomainValidationProperties + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + 'domain_validation_state': {'readonly': True}, + 'host_name': {'required': True}, + 'validation_properties': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, + 'tls_settings': {'key': 'tlsSettings', 'type': 'AFDDomainHttpsParameters'}, + 'azure_dns_zone': {'key': 'azureDnsZone', 'type': 'ResourceReference'}, + 'domain_validation_state': {'key': 'domainValidationState', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'validation_properties': {'key': 'validationProperties', 'type': 'DomainValidationProperties'}, + } + + def __init__( + self, + *, + host_name: str, + tls_settings: Optional["AFDDomainHttpsParameters"] = None, + azure_dns_zone: Optional["ResourceReference"] = None, + **kwargs + ): + super(AFDDomainProperties, self).__init__(tls_settings=tls_settings, azure_dns_zone=azure_dns_zone, **kwargs) + self.provisioning_state = None + self.deployment_status = None + self.domain_validation_state = None + self.host_name = host_name + self.validation_properties = None + self.tls_settings = tls_settings + self.azure_dns_zone = azure_dns_zone + self.domain_validation_state = None + self.host_name = host_name + self.validation_properties = None + + +class AFDDomainUpdateParameters(msrest.serialization.Model): + """The domain JSON object required for domain creation or update. + + :param tls_settings: The configuration specifying how to enable HTTPS for the domain - using + AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl + uses AzureFrontDoor managed certificate by default. + :type tls_settings: ~azure.mgmt.cdn.models.AFDDomainHttpsParameters + :param azure_dns_zone: Resource reference to the Azure DNS zone. + :type azure_dns_zone: ~azure.mgmt.cdn.models.ResourceReference + """ + + _attribute_map = { + 'tls_settings': {'key': 'properties.tlsSettings', 'type': 'AFDDomainHttpsParameters'}, + 'azure_dns_zone': {'key': 'properties.azureDnsZone', 'type': 'ResourceReference'}, + } + + def __init__( + self, + *, + tls_settings: Optional["AFDDomainHttpsParameters"] = None, + azure_dns_zone: Optional["ResourceReference"] = None, + **kwargs + ): + super(AFDDomainUpdateParameters, self).__init__(**kwargs) + self.tls_settings = tls_settings + self.azure_dns_zone = azure_dns_zone + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData """ _validation = { @@ -315,6 +419,7 @@ class TrackedResource(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -323,6 +428,7 @@ class TrackedResource(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -335,10 +441,11 @@ def __init__( super(TrackedResource, self).__init__(**kwargs) self.location = location self.tags = tags + self.system_data = None -class CdnWebApplicationFirewallPolicy(TrackedResource): - """Defines web application firewall policy for Azure CDN. +class AFDEndpoint(TrackedResource): + """CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content caching and delivery behavior. The AzureFrontDoor endpoint uses the URL format :code:``.azureedge.net. Variables are only populated by the server, and will be ignored when sending a request. @@ -354,28 +461,23 @@ class CdnWebApplicationFirewallPolicy(TrackedResource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param sku: Required. The pricing tier (defines a CDN provider, feature list and rate) of the - CdnWebApplicationFirewallPolicy. - :type sku: ~azure.mgmt.cdn.models.Sku - :param policy_settings: Describes policySettings for policy. - :type policy_settings: ~azure.mgmt.cdn.models.PolicySettings - :param rate_limit_rules: Describes rate limit rules inside the policy. - :type rate_limit_rules: ~azure.mgmt.cdn.models.RateLimitRuleList - :param custom_rules: Describes custom rules inside the policy. - :type custom_rules: ~azure.mgmt.cdn.models.CustomRuleList - :param managed_rules: Describes managed rules inside the policy. - :type managed_rules: ~azure.mgmt.cdn.models.ManagedRuleSetList - :ivar endpoint_links: Describes Azure CDN endpoints associated with this Web Application - Firewall policy. - :vartype endpoint_links: list[~azure.mgmt.cdn.models.CdnEndpoint] - :ivar provisioning_state: Provisioning state of the WebApplicationFirewallPolicy. Possible - values include: "Creating", "Succeeded", "Failed". - :vartype provisioning_state: str or ~azure.mgmt.cdn.models.ProvisioningState - :ivar resource_state: Resource status of the policy. Possible values include: "Creating", - "Enabling", "Enabled", "Disabling", "Disabled", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.PolicyResourceState + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param origin_response_timeout_seconds: Send and receive timeout on forwarding request to the + origin. When timeout is reached, the request fails and returns. + :type origin_response_timeout_seconds: int + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + contoso.azureedge.net. + :vartype host_name: str """ _validation = { @@ -383,10 +485,11 @@ class CdnWebApplicationFirewallPolicy(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'sku': {'required': True}, - 'endpoint_links': {'readonly': True}, + 'system_data': {'readonly': True}, + 'origin_response_timeout_seconds': {'minimum': 16}, 'provisioning_state': {'readonly': True}, - 'resource_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + 'host_name': {'readonly': True}, } _attribute_map = { @@ -395,51 +498,39 @@ class CdnWebApplicationFirewallPolicy(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'policy_settings': {'key': 'properties.policySettings', 'type': 'PolicySettings'}, - 'rate_limit_rules': {'key': 'properties.rateLimitRules', 'type': 'RateLimitRuleList'}, - 'custom_rules': {'key': 'properties.customRules', 'type': 'CustomRuleList'}, - 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRuleSetList'}, - 'endpoint_links': {'key': 'properties.endpointLinks', 'type': '[CdnEndpoint]'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'origin_response_timeout_seconds': {'key': 'properties.originResponseTimeoutSeconds', 'type': 'int'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, } def __init__( self, *, location: str, - sku: "Sku", tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - policy_settings: Optional["PolicySettings"] = None, - rate_limit_rules: Optional["RateLimitRuleList"] = None, - custom_rules: Optional["CustomRuleList"] = None, - managed_rules: Optional["ManagedRuleSetList"] = None, + origin_response_timeout_seconds: Optional[int] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(CdnWebApplicationFirewallPolicy, self).__init__(location=location, tags=tags, **kwargs) - self.etag = etag - self.sku = sku - self.policy_settings = policy_settings - self.rate_limit_rules = rate_limit_rules - self.custom_rules = custom_rules - self.managed_rules = managed_rules - self.endpoint_links = None + super(AFDEndpoint, self).__init__(location=location, tags=tags, **kwargs) + self.origin_response_timeout_seconds = origin_response_timeout_seconds + self.enabled_state = enabled_state self.provisioning_state = None - self.resource_state = None + self.deployment_status = None + self.host_name = None -class CdnWebApplicationFirewallPolicyList(msrest.serialization.Model): - """Defines a list of WebApplicationFirewallPolicies for Azure CDN. It contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. +class AFDEndpointListResult(msrest.serialization.Model): + """Result of the request to list endpoints. It contains a list of endpoint objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Azure CDN WebApplicationFirewallPolicies within a resource group. - :vartype value: list[~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicy] - :param next_link: URL to get the next set of WebApplicationFirewallPolicy objects if there are - any. + :ivar value: List of AzureFrontDoor endpoints within a profile. + :vartype value: list[~azure.mgmt.cdn.models.AFDEndpoint] + :param next_link: URL to get the next set of endpoint objects if there is any. :type next_link: str """ @@ -448,7 +539,7 @@ class CdnWebApplicationFirewallPolicyList(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[CdnWebApplicationFirewallPolicy]'}, + 'value': {'key': 'value', 'type': '[AFDEndpoint]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -458,189 +549,264 @@ def __init__( next_link: Optional[str] = None, **kwargs ): - super(CdnWebApplicationFirewallPolicyList, self).__init__(**kwargs) + super(AFDEndpointListResult, self).__init__(**kwargs) self.value = None self.next_link = next_link -class CdnWebApplicationFirewallPolicyPatchParameters(msrest.serialization.Model): - """Properties required to update a CdnWebApplicationFirewallPolicy. +class AFDEndpointPropertiesUpdateParameters(msrest.serialization.Model): + """The JSON object containing endpoint update parameters. - :param tags: A set of tags. CdnWebApplicationFirewallPolicy tags. - :type tags: dict[str, str] + :param origin_response_timeout_seconds: Send and receive timeout on forwarding request to the + origin. When timeout is reached, the request fails and returns. + :type origin_response_timeout_seconds: int + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ + _validation = { + 'origin_response_timeout_seconds': {'minimum': 16}, + } + _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + 'origin_response_timeout_seconds': {'key': 'originResponseTimeoutSeconds', 'type': 'int'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, } def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + origin_response_timeout_seconds: Optional[int] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(CdnWebApplicationFirewallPolicyPatchParameters, self).__init__(**kwargs) - self.tags = tags + super(AFDEndpointPropertiesUpdateParameters, self).__init__(**kwargs) + self.origin_response_timeout_seconds = origin_response_timeout_seconds + self.enabled_state = enabled_state -class CheckNameAvailabilityInput(msrest.serialization.Model): - """Input of CheckNameAvailability API. +class AFDEndpointProperties(AFDStateProperties, AFDEndpointPropertiesUpdateParameters): + """The JSON object that contains the properties required to create an endpoint. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :param name: Required. The resource name to validate. - :type name: str - :ivar type: Required. The type of the resource whose name is to be validated. Default value: - "Microsoft.Cdn/Profiles/Endpoints". - :vartype type: str + :param origin_response_timeout_seconds: Send and receive timeout on forwarding request to the + origin. When timeout is reached, the request fails and returns. + :type origin_response_timeout_seconds: int + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + contoso.azureedge.net. + :vartype host_name: str """ _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, + 'origin_response_timeout_seconds': {'minimum': 16}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + 'host_name': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'origin_response_timeout_seconds': {'key': 'originResponseTimeoutSeconds', 'type': 'int'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, } - type = "Microsoft.Cdn/Profiles/Endpoints" - def __init__( self, *, - name: str, + origin_response_timeout_seconds: Optional[int] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(CheckNameAvailabilityInput, self).__init__(**kwargs) - self.name = name - + super(AFDEndpointProperties, self).__init__(origin_response_timeout_seconds=origin_response_timeout_seconds, enabled_state=enabled_state, **kwargs) + self.origin_response_timeout_seconds = origin_response_timeout_seconds + self.enabled_state = enabled_state + self.host_name = None + self.provisioning_state = None + self.deployment_status = None + self.host_name = None -class CheckNameAvailabilityOutput(msrest.serialization.Model): - """Output of check name availability API. - Variables are only populated by the server, and will be ignored when sending a request. +class AFDEndpointUpdateParameters(msrest.serialization.Model): + """Properties required to create or update an endpoint. - :ivar name_available: Indicates whether the name is available. - :vartype name_available: bool - :ivar reason: The reason why the name is not available. - :vartype reason: str - :ivar message: The detailed error message describing why the name is not available. - :vartype message: str + :param tags: A set of tags. Endpoint tags. + :type tags: dict[str, str] + :param origin_response_timeout_seconds: Send and receive timeout on forwarding request to the + origin. When timeout is reached, the request fails and returns. + :type origin_response_timeout_seconds: int + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, + 'origin_response_timeout_seconds': {'minimum': 16}, } _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'origin_response_timeout_seconds': {'key': 'properties.originResponseTimeoutSeconds', 'type': 'int'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, } def __init__( self, + *, + tags: Optional[Dict[str, str]] = None, + origin_response_timeout_seconds: Optional[int] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(CheckNameAvailabilityOutput, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None + super(AFDEndpointUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.origin_response_timeout_seconds = origin_response_timeout_seconds + self.enabled_state = enabled_state -class CidrIpAddress(msrest.serialization.Model): - """CIDR Ip address. +class AfdErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - :param base_ip_address: Ip address itself. - :type base_ip_address: str - :param prefix_length: The length of the prefix of the ip address. - :type prefix_length: int + :param error: The error object. + :type error: ~azure.mgmt.cdn.models.ErrorResponse """ _attribute_map = { - 'base_ip_address': {'key': 'baseIpAddress', 'type': 'str'}, - 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, } def __init__( self, *, - base_ip_address: Optional[str] = None, - prefix_length: Optional[int] = None, + error: Optional["ErrorResponse"] = None, **kwargs ): - super(CidrIpAddress, self).__init__(**kwargs) - self.base_ip_address = base_ip_address - self.prefix_length = prefix_length + super(AfdErrorResponse, self).__init__(**kwargs) + self.error = error -class CookiesMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for Cookies match conditions. +class AFDOrigin(ProxyResource): + """CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the configured origins. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters". - :vartype odata_type: str - :param selector: Name of Cookies to be matched. - :type selector: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.CookiesOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param azure_origin: Resource reference to the Azure origin resource. + :type azure_origin: ~azure.mgmt.cdn.models.ResourceReference + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param shared_private_link_resource: The properties of the private link resource for private + origin. + :type shared_private_link_resource: object + :param enabled_state: Whether to enable health probes to be made against backends defined under + backendPools. Health probes can only be disabled if there is a single enabled backend in single + enabled backend pool. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'selector': {'key': 'selector', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters" + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'azure_origin': {'key': 'properties.azureOrigin', 'type': 'ResourceReference'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'weight': {'key': 'properties.weight', 'type': 'int'}, + 'shared_private_link_resource': {'key': 'properties.sharedPrivateLinkResource', 'type': 'object'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + } def __init__( self, *, - operator: Union[str, "CookiesOperator"], - selector: Optional[str] = None, - negate_condition: Optional[bool] = None, - match_values: Optional[List[str]] = None, - transforms: Optional[List[Union[str, "Transform"]]] = None, + azure_origin: Optional["ResourceReference"] = None, + host_name: Optional[str] = None, + http_port: Optional[int] = None, + https_port: Optional[int] = None, + origin_host_header: Optional[str] = None, + priority: Optional[int] = None, + weight: Optional[int] = None, + shared_private_link_resource: Optional[object] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(CookiesMatchConditionParameters, self).__init__(**kwargs) - self.selector = selector - self.operator = operator - self.negate_condition = negate_condition - self.match_values = match_values - self.transforms = transforms + super(AFDOrigin, self).__init__(**kwargs) + self.azure_origin = azure_origin + self.host_name = host_name + self.http_port = http_port + self.https_port = https_port + self.origin_host_header = origin_host_header + self.priority = priority + self.weight = weight + self.shared_private_link_resource = shared_private_link_resource + self.enabled_state = enabled_state + self.provisioning_state = None + self.deployment_status = None -class CustomDomain(Resource): - """Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. +class AFDOriginGroup(ProxyResource): + """AFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. Variables are only populated by the server, and will be ignored when sending a request. @@ -650,77 +816,85 @@ class CustomDomain(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param host_name: The host name of the custom domain. Must be a domain name. - :type host_name: str - :ivar resource_state: Resource status of the custom domain. Possible values include: - "Creating", "Active", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.CustomDomainResourceState - :ivar custom_https_provisioning_state: Provisioning status of Custom Https of the custom - domain. Possible values include: "Enabling", "Enabled", "Disabling", "Disabled", "Failed". - :vartype custom_https_provisioning_state: str or - ~azure.mgmt.cdn.models.CustomHttpsProvisioningState - :ivar custom_https_provisioning_substate: Provisioning substate shows the progress of custom - HTTPS enabling/disabling process step by step. Possible values include: - "SubmittingDomainControlValidationRequest", "PendingDomainControlValidationREquestApproval", - "DomainControlValidationRequestApproved", "DomainControlValidationRequestRejected", - "DomainControlValidationRequestTimedOut", "IssuingCertificate", "DeployingCertificate", - "CertificateDeployed", "DeletingCertificate", "CertificateDeleted". - :vartype custom_https_provisioning_substate: str or - ~azure.mgmt.cdn.models.CustomHttpsProvisioningSubstate - :param validation_data: Special validation or data may be required when delivering CDN to some - regions due to local compliance reasons. E.g. ICP license number of a custom domain is required - to deliver content in China. - :type validation_data: str - :ivar provisioning_state: Provisioning status of the custom domain. - :vartype provisioning_state: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param load_balancing_settings: Load balancing settings for a backend pool. + :type load_balancing_settings: ~azure.mgmt.cdn.models.LoadBalancingSettingsParameters + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_afd_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_afd_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param session_affinity_state: Whether to allow session affinity on this host. Valid options + are 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". + :type session_affinity_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'resource_state': {'readonly': True}, - 'custom_https_provisioning_state': {'readonly': True}, - 'custom_https_provisioning_substate': {'readonly': True}, + 'system_data': {'readonly': True}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, - 'custom_https_provisioning_state': {'key': 'properties.customHttpsProvisioningState', 'type': 'str'}, - 'custom_https_provisioning_substate': {'key': 'properties.customHttpsProvisioningSubstate', 'type': 'str'}, - 'validation_data': {'key': 'properties.validationData', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'load_balancing_settings': {'key': 'properties.loadBalancingSettings', 'type': 'LoadBalancingSettingsParameters'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_afd_origin_error_detection_settings': {'key': 'properties.responseBasedAfdOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'session_affinity_state': {'key': 'properties.sessionAffinityState', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, } def __init__( self, *, - host_name: Optional[str] = None, - validation_data: Optional[str] = None, + load_balancing_settings: Optional["LoadBalancingSettingsParameters"] = None, + health_probe_settings: Optional["HealthProbeParameters"] = None, + traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, + response_based_afd_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + session_affinity_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(CustomDomain, self).__init__(**kwargs) - self.host_name = host_name - self.resource_state = None - self.custom_https_provisioning_state = None - self.custom_https_provisioning_substate = None - self.validation_data = validation_data + super(AFDOriginGroup, self).__init__(**kwargs) + self.load_balancing_settings = load_balancing_settings + self.health_probe_settings = health_probe_settings + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes + self.response_based_afd_origin_error_detection_settings = response_based_afd_origin_error_detection_settings + self.session_affinity_state = session_affinity_state self.provisioning_state = None + self.deployment_status = None -class CustomDomainListResult(msrest.serialization.Model): - """Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the next set of results. +class AFDOriginGroupListResult(msrest.serialization.Model): + """Result of the request to list origin groups. It contains a list of origin groups objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of CDN CustomDomains within an endpoint. - :vartype value: list[~azure.mgmt.cdn.models.CustomDomain] - :param next_link: URL to get the next set of custom domain objects if there are any. + :ivar value: List of CDN origin groups within an endpoint. + :vartype value: list[~azure.mgmt.cdn.models.AFDOriginGroup] + :param next_link: URL to get the next set of origin objects if there are any. :type next_link: str """ @@ -729,7 +903,7 @@ class CustomDomainListResult(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[CustomDomain]'}, + 'value': {'key': 'value', 'type': '[AFDOriginGroup]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -739,151 +913,246 @@ def __init__( next_link: Optional[str] = None, **kwargs ): - super(CustomDomainListResult, self).__init__(**kwargs) + super(AFDOriginGroupListResult, self).__init__(**kwargs) self.value = None self.next_link = next_link -class CustomDomainParameters(msrest.serialization.Model): - """The customDomain JSON object required for custom domain creation or update. +class AFDOriginGroupUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the origin group. - :param host_name: The host name of the custom domain. Must be a domain name. - :type host_name: str + :param load_balancing_settings: Load balancing settings for a backend pool. + :type load_balancing_settings: ~azure.mgmt.cdn.models.LoadBalancingSettingsParameters + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_afd_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_afd_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param session_affinity_state: Whether to allow session affinity on this host. Valid options + are 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". + :type session_affinity_state: str or ~azure.mgmt.cdn.models.EnabledState """ + _validation = { + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + } + _attribute_map = { - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'load_balancing_settings': {'key': 'loadBalancingSettings', 'type': 'LoadBalancingSettingsParameters'}, + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_afd_origin_error_detection_settings': {'key': 'responseBasedAfdOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'session_affinity_state': {'key': 'sessionAffinityState', 'type': 'str'}, } def __init__( self, *, - host_name: Optional[str] = None, + load_balancing_settings: Optional["LoadBalancingSettingsParameters"] = None, + health_probe_settings: Optional["HealthProbeParameters"] = None, + traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, + response_based_afd_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + session_affinity_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(CustomDomainParameters, self).__init__(**kwargs) - self.host_name = host_name + super(AFDOriginGroupUpdatePropertiesParameters, self).__init__(**kwargs) + self.load_balancing_settings = load_balancing_settings + self.health_probe_settings = health_probe_settings + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes + self.response_based_afd_origin_error_detection_settings = response_based_afd_origin_error_detection_settings + self.session_affinity_state = session_affinity_state -class CustomRule(msrest.serialization.Model): - """Defines the common attributes for a custom rule that can be included in a waf policy. +class AFDOriginGroupProperties(AFDStateProperties, AFDOriginGroupUpdatePropertiesParameters): + """The JSON object that contains the properties of the origin group. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. Defines the name of the custom rule. - :type name: str - :param enabled_state: Describes if the custom rule is in enabled or disabled state. Defaults to - Enabled if not specified. Possible values include: "Disabled", "Enabled". - :type enabled_state: str or ~azure.mgmt.cdn.models.CustomRuleEnabledState - :param priority: Required. Defines in what order this rule be evaluated in the overall list of - custom rules. - :type priority: int - :param match_conditions: Required. List of match conditions. - :type match_conditions: list[~azure.mgmt.cdn.models.MatchCondition] - :param action: Required. Describes what action to be applied when rule matches. Possible values - include: "Allow", "Block", "Log", "Redirect". - :type action: str or ~azure.mgmt.cdn.models.ActionType + :param load_balancing_settings: Load balancing settings for a backend pool. + :type load_balancing_settings: ~azure.mgmt.cdn.models.LoadBalancingSettingsParameters + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_afd_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_afd_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param session_affinity_state: Whether to allow session affinity on this host. Valid options + are 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". + :type session_affinity_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'name': {'required': True}, - 'priority': {'required': True, 'maximum': 1000, 'minimum': 0}, - 'match_conditions': {'required': True}, - 'action': {'required': True}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'enabled_state': {'key': 'enabledState', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, - 'action': {'key': 'action', 'type': 'str'}, + 'load_balancing_settings': {'key': 'loadBalancingSettings', 'type': 'LoadBalancingSettingsParameters'}, + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_afd_origin_error_detection_settings': {'key': 'responseBasedAfdOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'session_affinity_state': {'key': 'sessionAffinityState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } def __init__( self, *, - name: str, - priority: int, - match_conditions: List["MatchCondition"], - action: Union[str, "ActionType"], - enabled_state: Optional[Union[str, "CustomRuleEnabledState"]] = None, + load_balancing_settings: Optional["LoadBalancingSettingsParameters"] = None, + health_probe_settings: Optional["HealthProbeParameters"] = None, + traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, + response_based_afd_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + session_affinity_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(CustomRule, self).__init__(**kwargs) - self.name = name - self.enabled_state = enabled_state - self.priority = priority - self.match_conditions = match_conditions - self.action = action + super(AFDOriginGroupProperties, self).__init__(load_balancing_settings=load_balancing_settings, health_probe_settings=health_probe_settings, traffic_restoration_time_to_healed_or_new_endpoints_in_minutes=traffic_restoration_time_to_healed_or_new_endpoints_in_minutes, response_based_afd_origin_error_detection_settings=response_based_afd_origin_error_detection_settings, session_affinity_state=session_affinity_state, **kwargs) + self.load_balancing_settings = load_balancing_settings + self.health_probe_settings = health_probe_settings + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes + self.response_based_afd_origin_error_detection_settings = response_based_afd_origin_error_detection_settings + self.session_affinity_state = session_affinity_state + self.provisioning_state = None + self.deployment_status = None -class CustomRuleList(msrest.serialization.Model): - """Defines contents of custom rules. +class AFDOriginGroupUpdateParameters(msrest.serialization.Model): + """AFDOrigin group properties needed for origin group creation or update. - :param rules: List of rules. - :type rules: list[~azure.mgmt.cdn.models.CustomRule] + :param load_balancing_settings: Load balancing settings for a backend pool. + :type load_balancing_settings: ~azure.mgmt.cdn.models.LoadBalancingSettingsParameters + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_afd_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_afd_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param session_affinity_state: Whether to allow session affinity on this host. Valid options + are 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". + :type session_affinity_state: str or ~azure.mgmt.cdn.models.EnabledState """ + _validation = { + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + } + _attribute_map = { - 'rules': {'key': 'rules', 'type': '[CustomRule]'}, + 'load_balancing_settings': {'key': 'properties.loadBalancingSettings', 'type': 'LoadBalancingSettingsParameters'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_afd_origin_error_detection_settings': {'key': 'properties.responseBasedAfdOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'session_affinity_state': {'key': 'properties.sessionAffinityState', 'type': 'str'}, } def __init__( self, *, - rules: Optional[List["CustomRule"]] = None, + load_balancing_settings: Optional["LoadBalancingSettingsParameters"] = None, + health_probe_settings: Optional["HealthProbeParameters"] = None, + traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, + response_based_afd_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + session_affinity_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(CustomRuleList, self).__init__(**kwargs) - self.rules = rules + super(AFDOriginGroupUpdateParameters, self).__init__(**kwargs) + self.load_balancing_settings = load_balancing_settings + self.health_probe_settings = health_probe_settings + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes + self.response_based_afd_origin_error_detection_settings = response_based_afd_origin_error_detection_settings + self.session_affinity_state = session_affinity_state -class DeepCreatedOrigin(msrest.serialization.Model): - """The main origin of CDN content which is added when creating a CDN endpoint. +class AFDOriginListResult(msrest.serialization.Model): + """Result of the request to list origins. It contains a list of origin objects and a URL link to get the next set of results. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. Origin name which must be unique within the endpoint. - :type name: str - :param host_name: The address of the origin. It can be a domain name, IPv4 address, or IPv6 - address. This should be unique across all origins in an endpoint. - :type host_name: str - :param http_port: The value of the HTTP port. Must be between 1 and 65535. - :type http_port: int - :param https_port: The value of the HTTPS port. Must be between 1 and 65535. - :type https_port: int - :param origin_host_header: The host header value sent to the origin with each request. If you - leave this blank, the request hostname determines this value. Azure CDN origins, such as Web - Apps, Blob Storage, and Cloud Services require this host header value to match the origin - hostname by default. - :type origin_host_header: str - :param priority: Priority of origin in given origin group for load balancing. Higher priorities - will not be used for load balancing if any lower priority origin is healthy.Must be between 1 - and 5. + :ivar value: List of CDN origins within an endpoint. + :vartype value: list[~azure.mgmt.cdn.models.AFDOrigin] + :param next_link: URL to get the next set of origin objects if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AFDOrigin]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(AFDOriginListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class AFDOriginUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the origin. + + :param azure_origin: Resource reference to the Azure origin resource. + :type azure_origin: ~azure.mgmt.cdn.models.ResourceReference + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. :type priority: int :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. :type weight: int - :param enabled: Origin is enabled for load balancing or not. By default, origin is always - enabled. - :type enabled: bool - :param private_link_alias: The Alias of the Private Link resource. Populating this optional - field indicates that this origin 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 - :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 shared_private_link_resource: The properties of the private link resource for private + origin. + :type shared_private_link_resource: object + :param enabled_state: Whether to enable health probes to be made against backends defined under + backendPools. Health probes can only be disabled if there is a single enabled backend in single + enabled backend pool. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ _validation = { - 'name': {'required': True}, 'http_port': {'maximum': 65535, 'minimum': 1}, 'https_port': {'maximum': 65535, 'minimum': 1}, 'priority': {'maximum': 5, 'minimum': 1}, @@ -891,997 +1160,1046 @@ class DeepCreatedOrigin(msrest.serialization.Model): } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, - 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, - 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, - 'priority': {'key': 'properties.priority', 'type': 'int'}, - 'weight': {'key': 'properties.weight', 'type': 'int'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, - 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, + 'azure_origin': {'key': 'azureOrigin', 'type': 'ResourceReference'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'http_port': {'key': 'httpPort', 'type': 'int'}, + 'https_port': {'key': 'httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'shared_private_link_resource': {'key': 'sharedPrivateLinkResource', 'type': 'object'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, } def __init__( self, *, - name: str, + azure_origin: Optional["ResourceReference"] = None, host_name: Optional[str] = None, http_port: Optional[int] = None, https_port: Optional[int] = None, origin_host_header: Optional[str] = None, priority: Optional[int] = None, weight: Optional[int] = None, - enabled: Optional[bool] = None, - private_link_alias: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - private_link_location: Optional[str] = None, - private_link_approval_message: Optional[str] = None, + shared_private_link_resource: Optional[object] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(DeepCreatedOrigin, self).__init__(**kwargs) - self.name = name + super(AFDOriginUpdatePropertiesParameters, self).__init__(**kwargs) + self.azure_origin = azure_origin self.host_name = host_name self.http_port = http_port self.https_port = https_port self.origin_host_header = origin_host_header self.priority = priority self.weight = weight - self.enabled = enabled - 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_link_approval_message = private_link_approval_message + self.shared_private_link_resource = shared_private_link_resource + self.enabled_state = enabled_state -class DeepCreatedOriginGroup(msrest.serialization.Model): - """The origin group for CDN content which is added when creating a CDN endpoint. Traffic is sent to the origins within the origin group based on origin health. +class AFDOriginProperties(AFDStateProperties, AFDOriginUpdatePropertiesParameters): + """The JSON object that contains the properties of the origin. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. Origin group name which must be unique within the endpoint. - :type name: str - :param health_probe_settings: Health probe settings to the origin that is used to determine the - health of the origin. - :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters - :param origins: The source of the content being delivered via CDN within given origin group. - :type origins: list[~azure.mgmt.cdn.models.ResourceReference] - :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift - the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new - endpoint is added. Default is 10 mins. This property is currently not supported. - :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int - :param response_based_origin_error_detection_settings: The JSON object that contains the - properties to determine origin health using real requests/responses.This property is currently - not supported. - :type response_based_origin_error_detection_settings: - ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param azure_origin: Resource reference to the Azure origin resource. + :type azure_origin: ~azure.mgmt.cdn.models.ResourceReference + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param shared_private_link_resource: The properties of the private link resource for private + origin. + :type shared_private_link_resource: object + :param enabled_state: Whether to enable health probes to be made against backends defined under + backendPools. Health probes can only be disabled if there is a single enabled backend in single + enabled backend pool. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'name': {'required': True}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, - 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, - 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'azure_origin': {'key': 'azureOrigin', 'type': 'ResourceReference'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'http_port': {'key': 'httpPort', 'type': 'int'}, + 'https_port': {'key': 'httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'shared_private_link_resource': {'key': 'sharedPrivateLinkResource', 'type': 'object'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } def __init__( self, *, - name: str, - health_probe_settings: Optional["HealthProbeParameters"] = None, - origins: Optional[List["ResourceReference"]] = None, - traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, - response_based_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + azure_origin: Optional["ResourceReference"] = None, + host_name: Optional[str] = None, + http_port: Optional[int] = None, + https_port: Optional[int] = None, + origin_host_header: Optional[str] = None, + priority: Optional[int] = None, + weight: Optional[int] = None, + shared_private_link_resource: Optional[object] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(DeepCreatedOriginGroup, self).__init__(**kwargs) - self.name = name - self.health_probe_settings = health_probe_settings - self.origins = origins - self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes - self.response_based_origin_error_detection_settings = response_based_origin_error_detection_settings - + super(AFDOriginProperties, self).__init__(azure_origin=azure_origin, host_name=host_name, http_port=http_port, https_port=https_port, origin_host_header=origin_host_header, priority=priority, weight=weight, shared_private_link_resource=shared_private_link_resource, enabled_state=enabled_state, **kwargs) + self.azure_origin = azure_origin + self.host_name = host_name + self.http_port = http_port + self.https_port = https_port + self.origin_host_header = origin_host_header + self.priority = priority + self.weight = weight + self.shared_private_link_resource = shared_private_link_resource + self.enabled_state = enabled_state + self.provisioning_state = None + self.deployment_status = None -class DeliveryRule(msrest.serialization.Model): - """A rule that specifies a set of actions and conditions. - All required parameters must be populated in order to send to Azure. +class AFDOriginUpdateParameters(msrest.serialization.Model): + """AFDOrigin properties needed for origin update. - :param name: Name of the rule. - :type name: str - :param order: Required. The order in which the rules are applied for the endpoint. Possible - values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater - order. Rule with order 0 is a special rule. It does not require any condition and actions - listed in it will always be applied. - :type order: int - :param conditions: A list of conditions that must be matched for the actions to be executed. - :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] - :param actions: Required. A list of actions that are executed when all the conditions of a rule - are satisfied. - :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :param azure_origin: Resource reference to the Azure origin resource. + :type azure_origin: ~azure.mgmt.cdn.models.ResourceReference + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param shared_private_link_resource: The properties of the private link resource for private + origin. + :type shared_private_link_resource: object + :param enabled_state: Whether to enable health probes to be made against backends defined under + backendPools. Health probes can only be disabled if there is a single enabled backend in single + enabled backend pool. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ _validation = { - 'order': {'required': True}, - 'actions': {'required': True}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'int'}, - 'conditions': {'key': 'conditions', 'type': '[DeliveryRuleCondition]'}, - 'actions': {'key': 'actions', 'type': '[DeliveryRuleAction]'}, + 'azure_origin': {'key': 'properties.azureOrigin', 'type': 'ResourceReference'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'weight': {'key': 'properties.weight', 'type': 'int'}, + 'shared_private_link_resource': {'key': 'properties.sharedPrivateLinkResource', 'type': 'object'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, } def __init__( self, *, - order: int, - actions: List["DeliveryRuleAction"], - name: Optional[str] = None, - conditions: Optional[List["DeliveryRuleCondition"]] = None, + azure_origin: Optional["ResourceReference"] = None, + host_name: Optional[str] = None, + http_port: Optional[int] = None, + https_port: Optional[int] = None, + origin_host_header: Optional[str] = None, + priority: Optional[int] = None, + weight: Optional[int] = None, + shared_private_link_resource: Optional[object] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(DeliveryRule, self).__init__(**kwargs) - self.name = name - self.order = order - self.conditions = conditions - self.actions = actions - + super(AFDOriginUpdateParameters, self).__init__(**kwargs) + self.azure_origin = azure_origin + self.host_name = host_name + self.http_port = http_port + self.https_port = https_port + self.origin_host_header = origin_host_header + self.priority = priority + self.weight = weight + self.shared_private_link_resource = shared_private_link_resource + self.enabled_state = enabled_state -class DeliveryRuleAction(msrest.serialization.Model): - """An action for the delivery rule. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DeliveryRuleCacheExpirationAction, DeliveryRuleCacheKeyQueryStringAction, DeliveryRuleRequestHeaderAction, DeliveryRuleResponseHeaderAction, UrlRedirectAction, UrlRewriteAction, UrlSigningAction. +class AfdPurgeParameters(msrest.serialization.Model): + """Parameters required for content purge. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the action for the delivery rule.Constant filled by server. - Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName + :param content_paths: Required. The path to the content to be purged. Can describe a file path + or a wild card directory. + :type content_paths: list[str] + :param domains: List of domains. + :type domains: list[str] """ _validation = { - 'name': {'required': True}, + 'content_paths': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - _subtype_map = { - 'name': {'CacheExpiration': 'DeliveryRuleCacheExpirationAction', 'CacheKeyQueryString': 'DeliveryRuleCacheKeyQueryStringAction', 'ModifyRequestHeader': 'DeliveryRuleRequestHeaderAction', 'ModifyResponseHeader': 'DeliveryRuleResponseHeaderAction', 'UrlRedirect': 'UrlRedirectAction', 'UrlRewrite': 'UrlRewriteAction', 'UrlSigning': 'UrlSigningAction'} + 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + 'domains': {'key': 'domains', 'type': '[str]'}, } def __init__( self, + *, + content_paths: List[str], + domains: Optional[List[str]] = None, **kwargs ): - super(DeliveryRuleAction, self).__init__(**kwargs) - self.name = None # type: Optional[str] + super(AfdPurgeParameters, self).__init__(**kwargs) + self.content_paths = content_paths + self.domains = domains -class DeliveryRuleCacheExpirationAction(DeliveryRuleAction): - """Defines the cache expiration action for the delivery rule. +class CacheExpirationActionParameters(msrest.serialization.Model): + """Defines the parameters for the cache expiration action. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the action for the delivery rule.Constant filled by server. - Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName - :param parameters: Required. Defines the parameters for the action. - :type parameters: ~azure.mgmt.cdn.models.CacheExpirationActionParameters + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters". + :vartype odata_type: str + :param cache_behavior: Required. Caching behavior for the requests. Possible values include: + "BypassCache", "Override", "SetIfMissing". + :type cache_behavior: str or ~azure.mgmt.cdn.models.CacheBehavior + :param cache_type: Required. The level at which the content needs to be cached. Possible values + include: "All". + :type cache_type: str or ~azure.mgmt.cdn.models.CacheType + :param cache_duration: The duration for which the content needs to be cached. Allowed format is + [d.]hh:mm:ss. + :type cache_duration: str """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'odata_type': {'required': True, 'constant': True}, + 'cache_behavior': {'required': True}, + 'cache_type': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'CacheExpirationActionParameters'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'cache_behavior': {'key': 'cacheBehavior', 'type': 'str'}, + 'cache_type': {'key': 'cacheType', 'type': 'str'}, + 'cache_duration': {'key': 'cacheDuration', 'type': 'str'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" + def __init__( self, *, - parameters: "CacheExpirationActionParameters", + cache_behavior: Union[str, "CacheBehavior"], + cache_type: Union[str, "CacheType"], + cache_duration: Optional[str] = None, **kwargs ): - super(DeliveryRuleCacheExpirationAction, self).__init__(**kwargs) - self.name = 'CacheExpiration' # type: str - self.parameters = parameters + super(CacheExpirationActionParameters, self).__init__(**kwargs) + self.cache_behavior = cache_behavior + self.cache_type = cache_type + self.cache_duration = cache_duration -class DeliveryRuleCacheKeyQueryStringAction(DeliveryRuleAction): - """Defines the cache-key query string action for the delivery rule. +class CacheKeyQueryStringActionParameters(msrest.serialization.Model): + """Defines the parameters for the cache-key query string action. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the action for the delivery rule.Constant filled by server. - Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName - :param parameters: Required. Defines the parameters for the action. - :type parameters: ~azure.mgmt.cdn.models.CacheKeyQueryStringActionParameters + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters". + :vartype odata_type: str + :param query_string_behavior: Required. Caching behavior for the requests. Possible values + include: "Include", "IncludeAll", "Exclude", "ExcludeAll". + :type query_string_behavior: str or ~azure.mgmt.cdn.models.QueryStringBehavior + :param query_parameters: query parameters to include or exclude (comma separated). + :type query_parameters: str """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'odata_type': {'required': True, 'constant': True}, + 'query_string_behavior': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'CacheKeyQueryStringActionParameters'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'query_string_behavior': {'key': 'queryStringBehavior', 'type': 'str'}, + 'query_parameters': {'key': 'queryParameters', 'type': 'str'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheKeyQueryStringBehaviorActionParameters" + def __init__( self, *, - parameters: "CacheKeyQueryStringActionParameters", + query_string_behavior: Union[str, "QueryStringBehavior"], + query_parameters: Optional[str] = None, **kwargs ): - super(DeliveryRuleCacheKeyQueryStringAction, self).__init__(**kwargs) - self.name = 'CacheKeyQueryString' # type: str - self.parameters = parameters + super(CacheKeyQueryStringActionParameters, self).__init__(**kwargs) + self.query_string_behavior = query_string_behavior + self.query_parameters = query_parameters -class DeliveryRuleCondition(msrest.serialization.Model): - """A condition for the delivery rule. +class CdnCertificateSourceParameters(msrest.serialization.Model): + """Defines the parameters for using CDN managed certificate for securing custom domain. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DeliveryRuleCookiesCondition, DeliveryRuleHttpVersionCondition, DeliveryRuleIsDeviceCondition, DeliveryRulePostArgsCondition, DeliveryRuleQueryStringCondition, DeliveryRuleRemoteAddressCondition, DeliveryRuleRequestBodyCondition, DeliveryRuleRequestHeaderCondition, DeliveryRuleRequestMethodCondition, DeliveryRuleRequestSchemeCondition, DeliveryRuleRequestUriCondition, DeliveryRuleUrlFileExtensionCondition, DeliveryRuleUrlFileNameCondition, DeliveryRuleUrlPathCondition. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters". + :vartype odata_type: str + :param certificate_type: Required. Type of certificate used. Possible values include: "Shared", + "Dedicated". + :type certificate_type: str or ~azure.mgmt.cdn.models.CertificateType """ _validation = { - 'name': {'required': True}, + 'odata_type': {'required': True, 'constant': True}, + 'certificate_type': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'certificate_type': {'key': 'certificateType', 'type': 'str'}, } - _subtype_map = { - 'name': {'Cookies': 'DeliveryRuleCookiesCondition', 'HttpVersion': 'DeliveryRuleHttpVersionCondition', 'IsDevice': 'DeliveryRuleIsDeviceCondition', 'PostArgs': 'DeliveryRulePostArgsCondition', 'QueryString': 'DeliveryRuleQueryStringCondition', 'RemoteAddress': 'DeliveryRuleRemoteAddressCondition', 'RequestBody': 'DeliveryRuleRequestBodyCondition', 'RequestHeader': 'DeliveryRuleRequestHeaderCondition', 'RequestMethod': 'DeliveryRuleRequestMethodCondition', 'RequestScheme': 'DeliveryRuleRequestSchemeCondition', 'RequestUri': 'DeliveryRuleRequestUriCondition', 'UrlFileExtension': 'DeliveryRuleUrlFileExtensionCondition', 'UrlFileName': 'DeliveryRuleUrlFileNameCondition', 'UrlPath': 'DeliveryRuleUrlPathCondition'} - } + odata_type = "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters" def __init__( self, + *, + certificate_type: Union[str, "CertificateType"], **kwargs ): - super(DeliveryRuleCondition, self).__init__(**kwargs) - self.name = None # type: Optional[str] - + super(CdnCertificateSourceParameters, self).__init__(**kwargs) + self.certificate_type = certificate_type -class DeliveryRuleCookiesCondition(DeliveryRuleCondition): - """Defines the Cookies condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class CdnEndpoint(msrest.serialization.Model): + """Defines the ARM Resource ID for the linked endpoints. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.CookiesMatchConditionParameters + :param id: ARM Resource ID string. + :type id: str """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'CookiesMatchConditionParameters'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, *, - parameters: "CookiesMatchConditionParameters", + id: Optional[str] = None, **kwargs ): - super(DeliveryRuleCookiesCondition, self).__init__(**kwargs) - self.name = 'Cookies' # type: str - self.parameters = parameters + super(CdnEndpoint, self).__init__(**kwargs) + self.id = id -class DeliveryRuleHttpVersionCondition(DeliveryRuleCondition): - """Defines the HttpVersion condition for the delivery rule. +class CustomDomainHttpsParameters(msrest.serialization.Model): + """The JSON object that contains the properties to secure a custom domain. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: UserManagedHttpsParameters, CdnManagedHttpsParameters. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.HttpVersionMatchConditionParameters + :param certificate_source: Required. Defines the source of the SSL certificate.Constant filled + by server. Possible values include: "AzureKeyVault", "Cdn". + :type certificate_source: str or ~azure.mgmt.cdn.models.CertificateSource + :param protocol_type: Required. Defines the TLS extension protocol that is used for secure + delivery. Possible values include: "ServerNameIndication", "IPBased". + :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType + :param minimum_tls_version: TLS protocol version that will be used for Https. Possible values + include: "None", "TLS10", "TLS12". + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'certificate_source': {'required': True}, + 'protocol_type': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'HttpVersionMatchConditionParameters'}, + 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + } + + _subtype_map = { + 'certificate_source': {'AzureKeyVault': 'UserManagedHttpsParameters', 'Cdn': 'CdnManagedHttpsParameters'} } def __init__( self, *, - parameters: "HttpVersionMatchConditionParameters", + protocol_type: Union[str, "ProtocolType"], + minimum_tls_version: Optional[Union[str, "MinimumTlsVersion"]] = None, **kwargs ): - super(DeliveryRuleHttpVersionCondition, self).__init__(**kwargs) - self.name = 'HttpVersion' # type: str - self.parameters = parameters + super(CustomDomainHttpsParameters, self).__init__(**kwargs) + self.certificate_source = None # type: Optional[str] + self.protocol_type = protocol_type + self.minimum_tls_version = minimum_tls_version -class DeliveryRuleIsDeviceCondition(DeliveryRuleCondition): - """Defines the IsDevice condition for the delivery rule. +class CdnManagedHttpsParameters(CustomDomainHttpsParameters): + """Defines the certificate source parameters using CDN managed certificate for enabling SSL. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.IsDeviceMatchConditionParameters + :param certificate_source: Required. Defines the source of the SSL certificate.Constant filled + by server. Possible values include: "AzureKeyVault", "Cdn". + :type certificate_source: str or ~azure.mgmt.cdn.models.CertificateSource + :param protocol_type: Required. Defines the TLS extension protocol that is used for secure + delivery. Possible values include: "ServerNameIndication", "IPBased". + :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType + :param minimum_tls_version: TLS protocol version that will be used for Https. Possible values + include: "None", "TLS10", "TLS12". + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion + :param certificate_source_parameters: Required. Defines the certificate source parameters using + CDN managed certificate for enabling SSL. + :type certificate_source_parameters: ~azure.mgmt.cdn.models.CdnCertificateSourceParameters """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'certificate_source': {'required': True}, + 'protocol_type': {'required': True}, + 'certificate_source_parameters': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'IsDeviceMatchConditionParameters'}, + 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'str'}, + 'certificate_source_parameters': {'key': 'certificateSourceParameters', 'type': 'CdnCertificateSourceParameters'}, } def __init__( self, *, - parameters: "IsDeviceMatchConditionParameters", + protocol_type: Union[str, "ProtocolType"], + certificate_source_parameters: "CdnCertificateSourceParameters", + minimum_tls_version: Optional[Union[str, "MinimumTlsVersion"]] = None, **kwargs ): - super(DeliveryRuleIsDeviceCondition, self).__init__(**kwargs) - self.name = 'IsDevice' # type: str - self.parameters = parameters + super(CdnManagedHttpsParameters, self).__init__(protocol_type=protocol_type, minimum_tls_version=minimum_tls_version, **kwargs) + self.certificate_source = 'Cdn' # type: str + self.certificate_source_parameters = certificate_source_parameters -class DeliveryRulePostArgsCondition(DeliveryRuleCondition): - """Defines the PostArgs condition for the delivery rule. +class CdnWebApplicationFirewallPolicy(TrackedResource): + """Defines web application firewall policy for Azure CDN. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.PostArgsMatchConditionParameters + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param etag: Gets a unique read-only string that changes whenever the resource is updated. + :type etag: str + :param sku: Required. The pricing tier (defines a CDN provider, feature list and rate) of the + CdnWebApplicationFirewallPolicy. + :type sku: ~azure.mgmt.cdn.models.Sku + :param policy_settings: Describes policySettings for policy. + :type policy_settings: ~azure.mgmt.cdn.models.PolicySettings + :param rate_limit_rules: Describes rate limit rules inside the policy. + :type rate_limit_rules: ~azure.mgmt.cdn.models.RateLimitRuleList + :param custom_rules: Describes custom rules inside the policy. + :type custom_rules: ~azure.mgmt.cdn.models.CustomRuleList + :param managed_rules: Describes managed rules inside the policy. + :type managed_rules: ~azure.mgmt.cdn.models.ManagedRuleSetList + :ivar endpoint_links: Describes Azure CDN endpoints associated with this Web Application + Firewall policy. + :vartype endpoint_links: list[~azure.mgmt.cdn.models.CdnEndpoint] + :ivar provisioning_state: Provisioning state of the WebApplicationFirewallPolicy. Possible + values include: "Creating", "Succeeded", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.ProvisioningState + :ivar resource_state: Resource status of the policy. Possible values include: "Creating", + "Enabling", "Enabled", "Disabling", "Disabled", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.PolicyResourceState """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'sku': {'required': True}, + 'endpoint_links': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_state': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'PostArgsMatchConditionParameters'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'policy_settings': {'key': 'properties.policySettings', 'type': 'PolicySettings'}, + 'rate_limit_rules': {'key': 'properties.rateLimitRules', 'type': 'RateLimitRuleList'}, + 'custom_rules': {'key': 'properties.customRules', 'type': 'CustomRuleList'}, + 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRuleSetList'}, + 'endpoint_links': {'key': 'properties.endpointLinks', 'type': '[CdnEndpoint]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, } def __init__( self, *, - parameters: "PostArgsMatchConditionParameters", + location: str, + sku: "Sku", + tags: Optional[Dict[str, str]] = None, + etag: Optional[str] = None, + policy_settings: Optional["PolicySettings"] = None, + rate_limit_rules: Optional["RateLimitRuleList"] = None, + custom_rules: Optional["CustomRuleList"] = None, + managed_rules: Optional["ManagedRuleSetList"] = None, **kwargs ): - super(DeliveryRulePostArgsCondition, self).__init__(**kwargs) - self.name = 'PostArgs' # type: str - self.parameters = parameters + super(CdnWebApplicationFirewallPolicy, self).__init__(location=location, tags=tags, **kwargs) + self.etag = etag + self.sku = sku + self.policy_settings = policy_settings + self.rate_limit_rules = rate_limit_rules + self.custom_rules = custom_rules + self.managed_rules = managed_rules + self.endpoint_links = None + self.provisioning_state = None + self.resource_state = None -class DeliveryRuleQueryStringCondition(DeliveryRuleCondition): - """Defines the QueryString condition for the delivery rule. +class CdnWebApplicationFirewallPolicyList(msrest.serialization.Model): + """Defines a list of WebApplicationFirewallPolicies for Azure CDN. It contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.QueryStringMatchConditionParameters + :ivar value: List of Azure CDN WebApplicationFirewallPolicies within a resource group. + :vartype value: list[~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicy] + :param next_link: URL to get the next set of WebApplicationFirewallPolicy objects if there are + any. + :type next_link: str """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'QueryStringMatchConditionParameters'}, + 'value': {'key': 'value', 'type': '[CdnWebApplicationFirewallPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - parameters: "QueryStringMatchConditionParameters", + next_link: Optional[str] = None, **kwargs ): - super(DeliveryRuleQueryStringCondition, self).__init__(**kwargs) - self.name = 'QueryString' # type: str - self.parameters = parameters - + super(CdnWebApplicationFirewallPolicyList, self).__init__(**kwargs) + self.value = None + self.next_link = next_link -class DeliveryRuleRemoteAddressCondition(DeliveryRuleCondition): - """Defines the RemoteAddress condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class CdnWebApplicationFirewallPolicyPatchParameters(msrest.serialization.Model): + """Properties required to update a CdnWebApplicationFirewallPolicy. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RemoteAddressMatchConditionParameters + :param tags: A set of tags. CdnWebApplicationFirewallPolicy tags. + :type tags: dict[str, str] """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RemoteAddressMatchConditionParameters'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__( self, *, - parameters: "RemoteAddressMatchConditionParameters", + tags: Optional[Dict[str, str]] = None, **kwargs ): - super(DeliveryRuleRemoteAddressCondition, self).__init__(**kwargs) - self.name = 'RemoteAddress' # type: str - self.parameters = parameters - + super(CdnWebApplicationFirewallPolicyPatchParameters, self).__init__(**kwargs) + self.tags = tags -class DeliveryRuleRequestBodyCondition(DeliveryRuleCondition): - """Defines the RequestBody condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class Certificate(msrest.serialization.Model): + """Certificate used for https. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RequestBodyMatchConditionParameters + :param subject: Subject name in the certificate. + :type subject: str + :param expiration_date: Certificate expiration date. + :type expiration_date: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RequestBodyMatchConditionParameters'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, } def __init__( self, *, - parameters: "RequestBodyMatchConditionParameters", + subject: Optional[str] = None, + expiration_date: Optional[str] = None, + thumbprint: Optional[str] = None, **kwargs ): - super(DeliveryRuleRequestBodyCondition, self).__init__(**kwargs) - self.name = 'RequestBody' # type: str - self.parameters = parameters + super(Certificate, self).__init__(**kwargs) + self.subject = subject + self.expiration_date = expiration_date + self.thumbprint = thumbprint -class DeliveryRuleRequestHeaderAction(DeliveryRuleAction): - """Defines the request header action for the delivery rule. +class CheckNameAvailabilityInput(msrest.serialization.Model): + """Input of CheckNameAvailability API. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the action for the delivery rule.Constant filled by server. - Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName - :param parameters: Required. Defines the parameters for the action. - :type parameters: ~azure.mgmt.cdn.models.HeaderActionParameters + :param name: Required. The resource name to validate. + :type name: str + :ivar type: Required. The type of the resource whose name is to be validated. Default value: + "Microsoft.Cdn/Profiles/Endpoints". + :vartype type: str """ _validation = { 'name': {'required': True}, - 'parameters': {'required': True}, + 'type': {'required': True, 'constant': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'HeaderActionParameters'}, + 'type': {'key': 'type', 'type': 'str'}, } + type = "Microsoft.Cdn/Profiles/Endpoints" + def __init__( self, *, - parameters: "HeaderActionParameters", + name: str, **kwargs ): - super(DeliveryRuleRequestHeaderAction, self).__init__(**kwargs) - self.name = 'ModifyRequestHeader' # type: str - self.parameters = parameters + super(CheckNameAvailabilityInput, self).__init__(**kwargs) + self.name = name -class DeliveryRuleRequestHeaderCondition(DeliveryRuleCondition): - """Defines the RequestHeader condition for the delivery rule. +class CheckNameAvailabilityOutput(msrest.serialization.Model): + """Output of check name availability API. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RequestHeaderMatchConditionParameters + :ivar name_available: Indicates whether the name is available. + :vartype name_available: bool + :ivar reason: The reason why the name is not available. + :vartype reason: str + :ivar message: The detailed error message describing why the name is not available. + :vartype message: str """ _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RequestHeaderMatchConditionParameters'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, } def __init__( self, - *, - parameters: "RequestHeaderMatchConditionParameters", **kwargs ): - super(DeliveryRuleRequestHeaderCondition, self).__init__(**kwargs) - self.name = 'RequestHeader' # type: str - self.parameters = parameters + super(CheckNameAvailabilityOutput, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None -class DeliveryRuleRequestMethodCondition(DeliveryRuleCondition): - """Defines the RequestMethod condition for the delivery rule. +class CidrIpAddress(msrest.serialization.Model): + """CIDR Ip address. - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RequestMethodMatchConditionParameters - """ - - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } + :param base_ip_address: Ip address itself. + :type base_ip_address: str + :param prefix_length: The length of the prefix of the ip address. + :type prefix_length: int + """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RequestMethodMatchConditionParameters'}, + 'base_ip_address': {'key': 'baseIpAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, } def __init__( self, *, - parameters: "RequestMethodMatchConditionParameters", + base_ip_address: Optional[str] = None, + prefix_length: Optional[int] = None, **kwargs ): - super(DeliveryRuleRequestMethodCondition, self).__init__(**kwargs) - self.name = 'RequestMethod' # type: str - self.parameters = parameters - + super(CidrIpAddress, self).__init__(**kwargs) + self.base_ip_address = base_ip_address + self.prefix_length = prefix_length -class DeliveryRuleRequestSchemeCondition(DeliveryRuleCondition): - """Defines the RequestScheme condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems(msrest.serialization.Model): + """Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParameters + :param date_time: + :type date_time: ~datetime.datetime + :param value: + :type value: float """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RequestSchemeMatchConditionParameters'}, + 'date_time': {'key': 'dateTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': 'float'}, } def __init__( self, *, - parameters: "RequestSchemeMatchConditionParameters", + date_time: Optional[datetime.datetime] = None, + value: Optional[float] = None, **kwargs ): - super(DeliveryRuleRequestSchemeCondition, self).__init__(**kwargs) - self.name = 'RequestScheme' # type: str - self.parameters = parameters - + super(Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems, self).__init__(**kwargs) + self.date_time = date_time + self.value = value -class DeliveryRuleRequestUriCondition(DeliveryRuleCondition): - """Defines the RequestUri condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems(msrest.serialization.Model): + """Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.RequestUriMatchConditionParameters + :param date_time: + :type date_time: ~datetime.datetime + :param value: + :type value: float """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'RequestUriMatchConditionParameters'}, + 'date_time': {'key': 'dateTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': 'float'}, } def __init__( self, *, - parameters: "RequestUriMatchConditionParameters", + date_time: Optional[datetime.datetime] = None, + value: Optional[float] = None, **kwargs ): - super(DeliveryRuleRequestUriCondition, self).__init__(**kwargs) - self.name = 'RequestUri' # type: str - self.parameters = parameters - + super(Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems, self).__init__(**kwargs) + self.date_time = date_time + self.value = value -class DeliveryRuleResponseHeaderAction(DeliveryRuleAction): - """Defines the response header action for the delivery rule. - All required parameters must be populated in order to send to Azure. +class ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems(msrest.serialization.Model): + """ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems. - :param name: Required. The name of the action for the delivery rule.Constant filled by server. - Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName - :param parameters: Required. Defines the parameters for the action. - :type parameters: ~azure.mgmt.cdn.models.HeaderActionParameters + :param metric: + :type metric: str + :param value: + :type value: long + :param percentage: + :type percentage: float """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'HeaderActionParameters'}, + 'metric': {'key': 'metric', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'long'}, + 'percentage': {'key': 'percentage', 'type': 'float'}, } def __init__( self, *, - parameters: "HeaderActionParameters", + metric: Optional[str] = None, + value: Optional[int] = None, + percentage: Optional[float] = None, **kwargs ): - super(DeliveryRuleResponseHeaderAction, self).__init__(**kwargs) - self.name = 'ModifyResponseHeader' # type: str - self.parameters = parameters - + super(ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems, self).__init__(**kwargs) + self.metric = metric + self.value = value + self.percentage = percentage -class DeliveryRuleUrlFileExtensionCondition(DeliveryRuleCondition): - """Defines the UrlFileExtension condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class CompressionSettings(msrest.serialization.Model): + """settings for compression. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.UrlFileExtensionMatchConditionParameters + :param content_types_to_compress: List of content types on which compression applies. The value + should be a valid MIME type. + :type content_types_to_compress: list[str] + :param is_compression_enabled: Indicates whether content compression is enabled on + AzureFrontDoor. Default value is false. If compression is enabled, content will be served as + compressed if user requests for a compressed version. Content won't be compressed on + AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. + :type is_compression_enabled: bool """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'UrlFileExtensionMatchConditionParameters'}, + 'content_types_to_compress': {'key': 'contentTypesToCompress', 'type': '[str]'}, + 'is_compression_enabled': {'key': 'isCompressionEnabled', 'type': 'bool'}, } def __init__( self, *, - parameters: "UrlFileExtensionMatchConditionParameters", + content_types_to_compress: Optional[List[str]] = None, + is_compression_enabled: Optional[bool] = None, **kwargs ): - super(DeliveryRuleUrlFileExtensionCondition, self).__init__(**kwargs) - self.name = 'UrlFileExtension' # type: str - self.parameters = parameters - + super(CompressionSettings, self).__init__(**kwargs) + self.content_types_to_compress = content_types_to_compress + self.is_compression_enabled = is_compression_enabled -class DeliveryRuleUrlFileNameCondition(DeliveryRuleCondition): - """Defines the UrlFileName condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class ContinentsResponse(msrest.serialization.Model): + """Continents Response. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.UrlFileNameMatchConditionParameters + :param continents: + :type continents: list[~azure.mgmt.cdn.models.ContinentsResponseContinentsItem] + :param country_or_regions: + :type country_or_regions: list[~azure.mgmt.cdn.models.ContinentsResponseCountryOrRegionsItem] """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'UrlFileNameMatchConditionParameters'}, + 'continents': {'key': 'continents', 'type': '[ContinentsResponseContinentsItem]'}, + 'country_or_regions': {'key': 'countryOrRegions', 'type': '[ContinentsResponseCountryOrRegionsItem]'}, } def __init__( self, *, - parameters: "UrlFileNameMatchConditionParameters", + continents: Optional[List["ContinentsResponseContinentsItem"]] = None, + country_or_regions: Optional[List["ContinentsResponseCountryOrRegionsItem"]] = None, **kwargs ): - super(DeliveryRuleUrlFileNameCondition, self).__init__(**kwargs) - self.name = 'UrlFileName' # type: str - self.parameters = parameters - + super(ContinentsResponse, self).__init__(**kwargs) + self.continents = continents + self.country_or_regions = country_or_regions -class DeliveryRuleUrlPathCondition(DeliveryRuleCondition): - """Defines the UrlPath condition for the delivery rule. - All required parameters must be populated in order to send to Azure. +class ContinentsResponseContinentsItem(msrest.serialization.Model): + """ContinentsResponseContinentsItem. - :param name: Required. The name of the condition for the delivery rule.Constant filled by - server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", - "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", - "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type name: str or ~azure.mgmt.cdn.models.MatchVariable - :param parameters: Required. Defines the parameters for the condition. - :type parameters: ~azure.mgmt.cdn.models.UrlPathMatchConditionParameters + :param id: + :type id: str """ - _validation = { - 'name': {'required': True}, - 'parameters': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': 'UrlPathMatchConditionParameters'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, *, - parameters: "UrlPathMatchConditionParameters", + id: Optional[str] = None, **kwargs ): - super(DeliveryRuleUrlPathCondition, self).__init__(**kwargs) - self.name = 'UrlPath' # type: str - self.parameters = parameters - + super(ContinentsResponseContinentsItem, self).__init__(**kwargs) + self.id = id -class EdgeNode(Resource): - """Edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. - Variables are only populated by the server, and will be ignored when sending a request. +class ContinentsResponseCountryOrRegionsItem(msrest.serialization.Model): + """ContinentsResponseCountryOrRegionsItem. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param ip_address_groups: List of ip address groups. - :type ip_address_groups: list[~azure.mgmt.cdn.models.IpAddressGroup] + :param id: + :type id: str + :param continent_id: + :type continent_id: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'ip_address_groups': {'key': 'properties.ipAddressGroups', 'type': '[IpAddressGroup]'}, + 'continent_id': {'key': 'continentId', 'type': 'str'}, } def __init__( self, *, - ip_address_groups: Optional[List["IpAddressGroup"]] = None, + id: Optional[str] = None, + continent_id: Optional[str] = None, **kwargs ): - super(EdgeNode, self).__init__(**kwargs) - self.ip_address_groups = ip_address_groups + super(ContinentsResponseCountryOrRegionsItem, self).__init__(**kwargs) + self.id = id + self.continent_id = continent_id -class EdgenodeResult(msrest.serialization.Model): - """Result of the request to list CDN edgenodes. It contains a list of ip address group and a URL link to get the next set of results. +class CookiesMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for Cookies match conditions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: Edge node of CDN service. - :vartype value: list[~azure.mgmt.cdn.models.EdgeNode] - :param next_link: URL to get the next set of edgenode list results if there are any. - :type next_link: str + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters". + :vartype odata_type: str + :param selector: Name of Cookies to be matched. + :type selector: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.CookiesOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] """ _validation = { - 'value': {'readonly': True}, + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[EdgeNode]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters" + def __init__( self, *, - next_link: Optional[str] = None, + operator: Union[str, "CookiesOperator"], + selector: Optional[str] = None, + negate_condition: Optional[bool] = None, + match_values: Optional[List[str]] = None, + transforms: Optional[List[Union[str, "Transform"]]] = None, **kwargs ): - super(EdgenodeResult, self).__init__(**kwargs) - self.value = None - self.next_link = next_link + super(CookiesMatchConditionParameters, self).__init__(**kwargs) + self.selector = selector + self.operator = operator + self.negate_condition = negate_condition + self.match_values = match_values + self.transforms = transforms -class Endpoint(TrackedResource): - """CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format :code:``.azureedge.net. +class CustomDomain(ProxyResource): + """Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param origin_path: A directory path on the origin that CDN can use to retrieve content from, - e.g. contoso.cloudapp.net/originpath. - :type origin_path: str - :param content_types_to_compress: List of content types on which compression applies. The value - should be a valid MIME type. - :type content_types_to_compress: list[str] - :param origin_host_header: The host header value sent to the origin with each request. This - property at Endpoint is only allowed when endpoint uses single origin and can be overridden by - the same property specified at origin.If you leave this blank, the request hostname determines - this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this - host header value to match the origin hostname by default. - :type origin_host_header: str - :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default - value is false. If compression is enabled, content will be served as compressed if user - requests for a compressed version. Content won't be compressed on CDN when requested content is - smaller than 1 byte or larger than 1 MB. - :type is_compression_enabled: bool - :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_http_allowed: bool - :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_https_allowed: bool - :param query_string_caching_behavior: Defines how CDN caches requests that include query - strings. You can ignore any query strings when caching, bypass caching to prevent requests that - contain query strings from being cached, or cache every request with a unique URL. Possible - values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". - :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior - :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to - optimize for, e.g. Download, Media services. With this information, CDN can apply scenario - driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", - "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". - :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType - :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the - dynamic content and calculate the most optimal routes for the CDN. This is relative to the - origin path. This property is only relevant when using a single origin. - :type probe_path: str - :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each - geo filter defines an access rule to a specified path or content, e.g. block APAC for path - /pictures/. - :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] - :param default_origin_group: A reference to the origin group. - :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference - :param url_signing_keys: List of keys used to validate the signed URL hashes. - :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] - :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. - :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy - :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for - the endpoint (if applicable). - :type web_application_firewall_policy_link: - ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink - :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. - contoso.azureedge.net. - :vartype host_name: str - :param origins: The source of the content being delivered via CDN. - :type origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin] - :param origin_groups: The origin groups comprising of origins that are used for load balancing - the traffic based on availability. - :type origin_groups: list[~azure.mgmt.cdn.models.DeepCreatedOriginGroup] - :ivar resource_state: Resource status of the endpoint. Possible values include: "Creating", - "Deleting", "Running", "Starting", "Stopped", "Stopping". - :vartype resource_state: str or ~azure.mgmt.cdn.models.EndpointResourceState - :ivar provisioning_state: Provisioning status of the endpoint. + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param host_name: The host name of the custom domain. Must be a domain name. + :type host_name: str + :ivar resource_state: Resource status of the custom domain. Possible values include: + "Creating", "Active", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.CustomDomainResourceState + :ivar custom_https_provisioning_state: Provisioning status of Custom Https of the custom + domain. Possible values include: "Enabling", "Enabled", "Disabling", "Disabled", "Failed". + :vartype custom_https_provisioning_state: str or + ~azure.mgmt.cdn.models.CustomHttpsProvisioningState + :ivar custom_https_provisioning_substate: Provisioning substate shows the progress of custom + HTTPS enabling/disabling process step by step. Possible values include: + "SubmittingDomainControlValidationRequest", "PendingDomainControlValidationREquestApproval", + "DomainControlValidationRequestApproved", "DomainControlValidationRequestRejected", + "DomainControlValidationRequestTimedOut", "IssuingCertificate", "DeployingCertificate", + "CertificateDeployed", "DeletingCertificate", "CertificateDeleted". + :vartype custom_https_provisioning_substate: str or + ~azure.mgmt.cdn.models.CustomHttpsProvisioningSubstate + :param validation_data: Special validation or data may be required when delivering CDN to some + regions due to local compliance reasons. E.g. ICP license number of a custom domain is required + to deliver content in China. + :type validation_data: str + :ivar provisioning_state: Provisioning status of the custom domain. :vartype provisioning_state: str """ @@ -1889,9 +2207,10 @@ class Endpoint(TrackedResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, - 'host_name': {'readonly': True}, + 'system_data': {'readonly': True}, 'resource_state': {'readonly': True}, + 'custom_https_provisioning_state': {'readonly': True}, + 'custom_https_provisioning_substate': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -1899,82 +2218,39 @@ class Endpoint(TrackedResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, - 'content_types_to_compress': {'key': 'properties.contentTypesToCompress', 'type': '[str]'}, - 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, - 'is_compression_enabled': {'key': 'properties.isCompressionEnabled', 'type': 'bool'}, - 'is_http_allowed': {'key': 'properties.isHttpAllowed', 'type': 'bool'}, - 'is_https_allowed': {'key': 'properties.isHttpsAllowed', 'type': 'bool'}, - 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, - 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, - 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, - 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, - 'default_origin_group': {'key': 'properties.defaultOriginGroup', 'type': 'ResourceReference'}, - 'url_signing_keys': {'key': 'properties.urlSigningKeys', 'type': '[UrlSigningKey]'}, - 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, - 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'origins': {'key': 'properties.origins', 'type': '[DeepCreatedOrigin]'}, - 'origin_groups': {'key': 'properties.originGroups', 'type': '[DeepCreatedOriginGroup]'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'custom_https_provisioning_state': {'key': 'properties.customHttpsProvisioningState', 'type': 'str'}, + 'custom_https_provisioning_substate': {'key': 'properties.customHttpsProvisioningSubstate', 'type': 'str'}, + 'validation_data': {'key': 'properties.validationData', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__( self, *, - location: str, - tags: Optional[Dict[str, str]] = None, - origin_path: Optional[str] = None, - content_types_to_compress: Optional[List[str]] = None, - origin_host_header: Optional[str] = None, - is_compression_enabled: Optional[bool] = None, - is_http_allowed: Optional[bool] = None, - is_https_allowed: Optional[bool] = None, - query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, - optimization_type: Optional[Union[str, "OptimizationType"]] = None, - probe_path: Optional[str] = None, - geo_filters: Optional[List["GeoFilter"]] = None, - default_origin_group: Optional["ResourceReference"] = None, - url_signing_keys: Optional[List["UrlSigningKey"]] = None, - delivery_policy: Optional["EndpointPropertiesUpdateParametersDeliveryPolicy"] = None, - web_application_firewall_policy_link: Optional["EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"] = None, - origins: Optional[List["DeepCreatedOrigin"]] = None, - origin_groups: Optional[List["DeepCreatedOriginGroup"]] = None, + host_name: Optional[str] = None, + validation_data: Optional[str] = None, **kwargs ): - super(Endpoint, self).__init__(location=location, tags=tags, **kwargs) - self.origin_path = origin_path - self.content_types_to_compress = content_types_to_compress - self.origin_host_header = origin_host_header - self.is_compression_enabled = is_compression_enabled - self.is_http_allowed = is_http_allowed - self.is_https_allowed = is_https_allowed - self.query_string_caching_behavior = query_string_caching_behavior - self.optimization_type = optimization_type - self.probe_path = probe_path - self.geo_filters = geo_filters - self.default_origin_group = default_origin_group - self.url_signing_keys = url_signing_keys - self.delivery_policy = delivery_policy - self.web_application_firewall_policy_link = web_application_firewall_policy_link - self.host_name = None - self.origins = origins - self.origin_groups = origin_groups + super(CustomDomain, self).__init__(**kwargs) + self.host_name = host_name self.resource_state = None + self.custom_https_provisioning_state = None + self.custom_https_provisioning_substate = None + self.validation_data = validation_data self.provisioning_state = None -class EndpointListResult(msrest.serialization.Model): - """Result of the request to list endpoints. It contains a list of endpoint objects and a URL link to get the next set of results. +class CustomDomainListResult(msrest.serialization.Model): + """Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of CDN endpoints within a profile. - :vartype value: list[~azure.mgmt.cdn.models.Endpoint] - :param next_link: URL to get the next set of endpoint objects if there is any. + :ivar value: List of CDN CustomDomains within an endpoint. + :vartype value: list[~azure.mgmt.cdn.models.CustomDomain] + :param next_link: URL to get the next set of custom domain objects if there are any. :type next_link: str """ @@ -1983,7 +2259,7 @@ class EndpointListResult(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[Endpoint]'}, + 'value': {'key': 'value', 'type': '[CustomDomain]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -1993,1481 +2269,1198 @@ def __init__( next_link: Optional[str] = None, **kwargs ): - super(EndpointListResult, self).__init__(**kwargs) + super(CustomDomainListResult, self).__init__(**kwargs) self.value = None self.next_link = next_link -class EndpointPropertiesUpdateParameters(msrest.serialization.Model): - """The JSON object containing endpoint update parameters. +class CustomDomainParameters(msrest.serialization.Model): + """The customDomain JSON object required for custom domain creation or update. - :param origin_path: A directory path on the origin that CDN can use to retrieve content from, - e.g. contoso.cloudapp.net/originpath. - :type origin_path: str - :param content_types_to_compress: List of content types on which compression applies. The value - should be a valid MIME type. - :type content_types_to_compress: list[str] - :param origin_host_header: The host header value sent to the origin with each request. This - property at Endpoint is only allowed when endpoint uses single origin and can be overridden by - the same property specified at origin.If you leave this blank, the request hostname determines - this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this - host header value to match the origin hostname by default. - :type origin_host_header: str - :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default - value is false. If compression is enabled, content will be served as compressed if user - requests for a compressed version. Content won't be compressed on CDN when requested content is - smaller than 1 byte or larger than 1 MB. - :type is_compression_enabled: bool - :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_http_allowed: bool - :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_https_allowed: bool - :param query_string_caching_behavior: Defines how CDN caches requests that include query - strings. You can ignore any query strings when caching, bypass caching to prevent requests that - contain query strings from being cached, or cache every request with a unique URL. Possible - values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". - :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior - :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to - optimize for, e.g. Download, Media services. With this information, CDN can apply scenario - driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", - "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". - :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType - :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the - dynamic content and calculate the most optimal routes for the CDN. This is relative to the - origin path. This property is only relevant when using a single origin. - :type probe_path: str - :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each - geo filter defines an access rule to a specified path or content, e.g. block APAC for path - /pictures/. - :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] - :param default_origin_group: A reference to the origin group. - :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference - :param url_signing_keys: List of keys used to validate the signed URL hashes. - :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] - :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. - :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy - :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for - the endpoint (if applicable). - :type web_application_firewall_policy_link: - ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + :param host_name: The host name of the custom domain. Must be a domain name. + :type host_name: str """ _attribute_map = { - 'origin_path': {'key': 'originPath', 'type': 'str'}, - 'content_types_to_compress': {'key': 'contentTypesToCompress', 'type': '[str]'}, - 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, - 'is_compression_enabled': {'key': 'isCompressionEnabled', 'type': 'bool'}, - 'is_http_allowed': {'key': 'isHttpAllowed', 'type': 'bool'}, - 'is_https_allowed': {'key': 'isHttpsAllowed', 'type': 'bool'}, - 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, - 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, - 'probe_path': {'key': 'probePath', 'type': 'str'}, - 'geo_filters': {'key': 'geoFilters', 'type': '[GeoFilter]'}, - 'default_origin_group': {'key': 'defaultOriginGroup', 'type': 'ResourceReference'}, - 'url_signing_keys': {'key': 'urlSigningKeys', 'type': '[UrlSigningKey]'}, - 'delivery_policy': {'key': 'deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, - 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, } def __init__( self, *, - origin_path: Optional[str] = None, - content_types_to_compress: Optional[List[str]] = None, - origin_host_header: Optional[str] = None, - is_compression_enabled: Optional[bool] = None, - is_http_allowed: Optional[bool] = None, - is_https_allowed: Optional[bool] = None, - query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, - optimization_type: Optional[Union[str, "OptimizationType"]] = None, - probe_path: Optional[str] = None, - geo_filters: Optional[List["GeoFilter"]] = None, - default_origin_group: Optional["ResourceReference"] = None, - url_signing_keys: Optional[List["UrlSigningKey"]] = None, - delivery_policy: Optional["EndpointPropertiesUpdateParametersDeliveryPolicy"] = None, - web_application_firewall_policy_link: Optional["EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"] = None, + host_name: Optional[str] = None, **kwargs ): - super(EndpointPropertiesUpdateParameters, self).__init__(**kwargs) - self.origin_path = origin_path - self.content_types_to_compress = content_types_to_compress - self.origin_host_header = origin_host_header - self.is_compression_enabled = is_compression_enabled - self.is_http_allowed = is_http_allowed - self.is_https_allowed = is_https_allowed - self.query_string_caching_behavior = query_string_caching_behavior - self.optimization_type = optimization_type - self.probe_path = probe_path - self.geo_filters = geo_filters - self.default_origin_group = default_origin_group - self.url_signing_keys = url_signing_keys - self.delivery_policy = delivery_policy - self.web_application_firewall_policy_link = web_application_firewall_policy_link - + super(CustomDomainParameters, self).__init__(**kwargs) + self.host_name = host_name -class EndpointProperties(EndpointPropertiesUpdateParameters): - """The JSON object that contains the properties required to create an endpoint. - Variables are only populated by the server, and will be ignored when sending a request. +class CustomerCertificate(Certificate): + """Customer Certificate used for https. All required parameters must be populated in order to send to Azure. - :param origin_path: A directory path on the origin that CDN can use to retrieve content from, - e.g. contoso.cloudapp.net/originpath. - :type origin_path: str - :param content_types_to_compress: List of content types on which compression applies. The value - should be a valid MIME type. - :type content_types_to_compress: list[str] - :param origin_host_header: The host header value sent to the origin with each request. This - property at Endpoint is only allowed when endpoint uses single origin and can be overridden by - the same property specified at origin.If you leave this blank, the request hostname determines - this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this - host header value to match the origin hostname by default. - :type origin_host_header: str - :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default - value is false. If compression is enabled, content will be served as compressed if user - requests for a compressed version. Content won't be compressed on CDN when requested content is - smaller than 1 byte or larger than 1 MB. - :type is_compression_enabled: bool - :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_http_allowed: bool - :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_https_allowed: bool - :param query_string_caching_behavior: Defines how CDN caches requests that include query - strings. You can ignore any query strings when caching, bypass caching to prevent requests that - contain query strings from being cached, or cache every request with a unique URL. Possible - values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". - :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior - :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to - optimize for, e.g. Download, Media services. With this information, CDN can apply scenario - driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", - "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". - :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType - :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the - dynamic content and calculate the most optimal routes for the CDN. This is relative to the - origin path. This property is only relevant when using a single origin. - :type probe_path: str - :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each - geo filter defines an access rule to a specified path or content, e.g. block APAC for path - /pictures/. - :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] - :param default_origin_group: A reference to the origin group. - :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference - :param url_signing_keys: List of keys used to validate the signed URL hashes. - :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] - :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. - :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy - :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for - the endpoint (if applicable). - :type web_application_firewall_policy_link: - ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink - :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. - contoso.azureedge.net. - :vartype host_name: str - :param origins: Required. The source of the content being delivered via CDN. - :type origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin] - :param origin_groups: The origin groups comprising of origins that are used for load balancing - the traffic based on availability. - :type origin_groups: list[~azure.mgmt.cdn.models.DeepCreatedOriginGroup] - :ivar resource_state: Resource status of the endpoint. Possible values include: "Creating", - "Deleting", "Running", "Starting", "Stopped", "Stopping". - :vartype resource_state: str or ~azure.mgmt.cdn.models.EndpointResourceState - :ivar provisioning_state: Provisioning status of the endpoint. - :vartype provisioning_state: str + :param subject: Subject name in the certificate. + :type subject: str + :param expiration_date: Certificate expiration date. + :type expiration_date: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str + :param version: Certificate version. + :type version: str + :param certificate_authority: Certificate issuing authority. + :type certificate_authority: str + :param certificate_url: Required. Complete Url to the certificate. + :type certificate_url: str + :param use_latest_version: Whether to use the latest version for the certificate. + :type use_latest_version: bool + :param subject_alternative_names: The list of SANs. + :type subject_alternative_names: list[str] """ _validation = { - 'host_name': {'readonly': True}, - 'origins': {'required': True}, - 'resource_state': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + 'certificate_url': {'required': True}, } _attribute_map = { - 'origin_path': {'key': 'originPath', 'type': 'str'}, - 'content_types_to_compress': {'key': 'contentTypesToCompress', 'type': '[str]'}, - 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, - 'is_compression_enabled': {'key': 'isCompressionEnabled', 'type': 'bool'}, - 'is_http_allowed': {'key': 'isHttpAllowed', 'type': 'bool'}, - 'is_https_allowed': {'key': 'isHttpsAllowed', 'type': 'bool'}, - 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, - 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, - 'probe_path': {'key': 'probePath', 'type': 'str'}, - 'geo_filters': {'key': 'geoFilters', 'type': '[GeoFilter]'}, - 'default_origin_group': {'key': 'defaultOriginGroup', 'type': 'ResourceReference'}, - 'url_signing_keys': {'key': 'urlSigningKeys', 'type': '[UrlSigningKey]'}, - 'delivery_policy': {'key': 'deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, - 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'origins': {'key': 'origins', 'type': '[DeepCreatedOrigin]'}, - 'origin_groups': {'key': 'originGroups', 'type': '[DeepCreatedOriginGroup]'}, - 'resource_state': {'key': 'resourceState', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'certificate_authority': {'key': 'certificateAuthority', 'type': 'str'}, + 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, + 'use_latest_version': {'key': 'useLatestVersion', 'type': 'bool'}, + 'subject_alternative_names': {'key': 'subjectAlternativeNames', 'type': '[str]'}, } def __init__( self, *, - origins: List["DeepCreatedOrigin"], - origin_path: Optional[str] = None, - content_types_to_compress: Optional[List[str]] = None, - origin_host_header: Optional[str] = None, - is_compression_enabled: Optional[bool] = None, - is_http_allowed: Optional[bool] = None, - is_https_allowed: Optional[bool] = None, - query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, - optimization_type: Optional[Union[str, "OptimizationType"]] = None, - probe_path: Optional[str] = None, - geo_filters: Optional[List["GeoFilter"]] = None, - default_origin_group: Optional["ResourceReference"] = None, - url_signing_keys: Optional[List["UrlSigningKey"]] = None, - delivery_policy: Optional["EndpointPropertiesUpdateParametersDeliveryPolicy"] = None, - web_application_firewall_policy_link: Optional["EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"] = None, - origin_groups: Optional[List["DeepCreatedOriginGroup"]] = None, + certificate_url: str, + subject: Optional[str] = None, + expiration_date: Optional[str] = None, + thumbprint: Optional[str] = None, + version: Optional[str] = None, + certificate_authority: Optional[str] = None, + use_latest_version: Optional[bool] = None, + subject_alternative_names: Optional[List[str]] = None, **kwargs ): - super(EndpointProperties, self).__init__(origin_path=origin_path, content_types_to_compress=content_types_to_compress, origin_host_header=origin_host_header, is_compression_enabled=is_compression_enabled, is_http_allowed=is_http_allowed, is_https_allowed=is_https_allowed, query_string_caching_behavior=query_string_caching_behavior, optimization_type=optimization_type, probe_path=probe_path, geo_filters=geo_filters, default_origin_group=default_origin_group, url_signing_keys=url_signing_keys, delivery_policy=delivery_policy, web_application_firewall_policy_link=web_application_firewall_policy_link, **kwargs) - self.host_name = None - self.origins = origins - self.origin_groups = origin_groups - self.resource_state = None - self.provisioning_state = None + super(CustomerCertificate, self).__init__(subject=subject, expiration_date=expiration_date, thumbprint=thumbprint, **kwargs) + self.version = version + self.certificate_authority = certificate_authority + self.certificate_url = certificate_url + self.use_latest_version = use_latest_version + self.subject_alternative_names = subject_alternative_names -class EndpointPropertiesUpdateParametersDeliveryPolicy(msrest.serialization.Model): - """A policy that specifies the delivery rules to be used for an endpoint. +class SecretParameters(msrest.serialization.Model): + """The json object containing secret parameters. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CustomerCertificateParameters, ManagedCertificateParameters, UrlSigningKeyParameters. All required parameters must be populated in order to send to Azure. - :param description: User-friendly description of the policy. - :type description: str - :param rules: Required. A list of the delivery rules. - :type rules: list[~azure.mgmt.cdn.models.DeliveryRule] + :param type: Required. The type of the Secret to create.Constant filled by server. Possible + values include: "UrlSigningKey", "CustomerCertificate", "ManagedCertificate". + :type type: str or ~azure.mgmt.cdn.models.SecretType """ _validation = { - 'rules': {'required': True}, + 'type': {'required': True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[DeliveryRule]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'CustomerCertificate': 'CustomerCertificateParameters', 'ManagedCertificate': 'ManagedCertificateParameters', 'UrlSigningKey': 'UrlSigningKeyParameters'} } def __init__( self, - *, - rules: List["DeliveryRule"], - description: Optional[str] = None, **kwargs ): - super(EndpointPropertiesUpdateParametersDeliveryPolicy, self).__init__(**kwargs) - self.description = description - self.rules = rules + super(SecretParameters, self).__init__(**kwargs) + self.type = None # type: Optional[str] -class EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink(msrest.serialization.Model): - """Defines the Web Application Firewall policy for the endpoint (if applicable). +class CustomerCertificateParameters(SecretParameters, Certificate): + """Customer Certificate used for https. - :param id: Resource ID. - :type id: str + All required parameters must be populated in order to send to Azure. + + :param subject: Subject name in the certificate. + :type subject: str + :param expiration_date: Certificate expiration date. + :type expiration_date: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str + :param type: Required. The type of the Secret to create.Constant filled by server. Possible + values include: "UrlSigningKey", "CustomerCertificate", "ManagedCertificate". + :type type: str or ~azure.mgmt.cdn.models.SecretType + :param secret_source: Required. Resource reference to the KV secret. + :type secret_source: ~azure.mgmt.cdn.models.ResourceReference + :param secret_version: Version of the secret to be used. + :type secret_version: str + :param certificate_authority: Certificate issuing authority. + :type certificate_authority: str + :param use_latest_version: Whether to use the latest version for the certificate. + :type use_latest_version: bool + :param subject_alternative_names: The list of SANs. + :type subject_alternative_names: list[str] """ + _validation = { + 'type': {'required': True}, + 'secret_source': {'required': True}, + } + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'secret_source': {'key': 'secretSource', 'type': 'ResourceReference'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + 'certificate_authority': {'key': 'certificateAuthority', 'type': 'str'}, + 'use_latest_version': {'key': 'useLatestVersion', 'type': 'bool'}, + 'subject_alternative_names': {'key': 'subjectAlternativeNames', 'type': '[str]'}, } def __init__( self, *, - id: Optional[str] = None, + secret_source: "ResourceReference", + subject: Optional[str] = None, + expiration_date: Optional[str] = None, + thumbprint: Optional[str] = None, + secret_version: Optional[str] = None, + certificate_authority: Optional[str] = None, + use_latest_version: Optional[bool] = None, + subject_alternative_names: Optional[List[str]] = None, **kwargs ): - super(EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink, self).__init__(**kwargs) - self.id = id + super(CustomerCertificateParameters, self).__init__(subject=subject, expiration_date=expiration_date, thumbprint=thumbprint, **kwargs) + self.subject = subject + self.expiration_date = expiration_date + self.thumbprint = thumbprint + self.type = 'CustomerCertificate' # type: str + self.secret_source = secret_source + self.secret_version = secret_version + self.certificate_authority = certificate_authority + self.use_latest_version = use_latest_version + self.subject_alternative_names = subject_alternative_names + self.type = 'CustomerCertificate' # type: str + self.secret_source = secret_source + self.secret_version = secret_version + self.certificate_authority = certificate_authority + self.use_latest_version = use_latest_version + self.subject_alternative_names = subject_alternative_names -class EndpointUpdateParameters(msrest.serialization.Model): - """Properties required to create or update an endpoint. +class CustomRule(msrest.serialization.Model): + """Defines the common attributes for a custom rule that can be included in a waf policy. - :param tags: A set of tags. Endpoint tags. - :type tags: dict[str, str] - :param origin_path: A directory path on the origin that CDN can use to retrieve content from, - e.g. contoso.cloudapp.net/originpath. - :type origin_path: str - :param content_types_to_compress: List of content types on which compression applies. The value - should be a valid MIME type. - :type content_types_to_compress: list[str] - :param origin_host_header: The host header value sent to the origin with each request. This - property at Endpoint is only allowed when endpoint uses single origin and can be overridden by - the same property specified at origin.If you leave this blank, the request hostname determines - this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this - host header value to match the origin hostname by default. - :type origin_host_header: str - :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default - value is false. If compression is enabled, content will be served as compressed if user - requests for a compressed version. Content won't be compressed on CDN when requested content is - smaller than 1 byte or larger than 1 MB. - :type is_compression_enabled: bool - :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_http_allowed: bool - :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default - value is true. At least one protocol (HTTP or HTTPS) must be allowed. - :type is_https_allowed: bool - :param query_string_caching_behavior: Defines how CDN caches requests that include query - strings. You can ignore any query strings when caching, bypass caching to prevent requests that - contain query strings from being cached, or cache every request with a unique URL. Possible - values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". - :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior - :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to - optimize for, e.g. Download, Media services. With this information, CDN can apply scenario - driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", - "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". - :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType - :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the - dynamic content and calculate the most optimal routes for the CDN. This is relative to the - origin path. This property is only relevant when using a single origin. - :type probe_path: str - :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each - geo filter defines an access rule to a specified path or content, e.g. block APAC for path - /pictures/. - :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] - :param default_origin_group: A reference to the origin group. - :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference - :param url_signing_keys: List of keys used to validate the signed URL hashes. - :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] - :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. - :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy - :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for - the endpoint (if applicable). - :type web_application_firewall_policy_link: - ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + All required parameters must be populated in order to send to Azure. + + :param name: Required. Defines the name of the custom rule. + :type name: str + :param enabled_state: Describes if the custom rule is in enabled or disabled state. Defaults to + Enabled if not specified. Possible values include: "Disabled", "Enabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.CustomRuleEnabledState + :param priority: Required. Defines in what order this rule be evaluated in the overall list of + custom rules. + :type priority: int + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.cdn.models.MatchCondition] + :param action: Required. Describes what action to be applied when rule matches. Possible values + include: "Allow", "Block", "Log", "Redirect". + :type action: str or ~azure.mgmt.cdn.models.ActionType """ + _validation = { + 'name': {'required': True}, + 'priority': {'required': True, 'maximum': 1000, 'minimum': 0}, + 'match_conditions': {'required': True}, + 'action': {'required': True}, + } + _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, - 'content_types_to_compress': {'key': 'properties.contentTypesToCompress', 'type': '[str]'}, - 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, - 'is_compression_enabled': {'key': 'properties.isCompressionEnabled', 'type': 'bool'}, - 'is_http_allowed': {'key': 'properties.isHttpAllowed', 'type': 'bool'}, - 'is_https_allowed': {'key': 'properties.isHttpsAllowed', 'type': 'bool'}, - 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, - 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, - 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, - 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, - 'default_origin_group': {'key': 'properties.defaultOriginGroup', 'type': 'ResourceReference'}, - 'url_signing_keys': {'key': 'properties.urlSigningKeys', 'type': '[UrlSigningKey]'}, - 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, - 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + 'name': {'key': 'name', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, + 'action': {'key': 'action', 'type': 'str'}, } def __init__( self, *, - tags: Optional[Dict[str, str]] = None, - origin_path: Optional[str] = None, - content_types_to_compress: Optional[List[str]] = None, - origin_host_header: Optional[str] = None, - is_compression_enabled: Optional[bool] = None, - is_http_allowed: Optional[bool] = None, - is_https_allowed: Optional[bool] = None, - query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, - optimization_type: Optional[Union[str, "OptimizationType"]] = None, - probe_path: Optional[str] = None, - geo_filters: Optional[List["GeoFilter"]] = None, - default_origin_group: Optional["ResourceReference"] = None, - url_signing_keys: Optional[List["UrlSigningKey"]] = None, - delivery_policy: Optional["EndpointPropertiesUpdateParametersDeliveryPolicy"] = None, - web_application_firewall_policy_link: Optional["EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"] = None, + name: str, + priority: int, + match_conditions: List["MatchCondition"], + action: Union[str, "ActionType"], + enabled_state: Optional[Union[str, "CustomRuleEnabledState"]] = None, **kwargs ): - super(EndpointUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.origin_path = origin_path - self.content_types_to_compress = content_types_to_compress - self.origin_host_header = origin_host_header - self.is_compression_enabled = is_compression_enabled - self.is_http_allowed = is_http_allowed - self.is_https_allowed = is_https_allowed - self.query_string_caching_behavior = query_string_caching_behavior - self.optimization_type = optimization_type - self.probe_path = probe_path - self.geo_filters = geo_filters - self.default_origin_group = default_origin_group - self.url_signing_keys = url_signing_keys - self.delivery_policy = delivery_policy - self.web_application_firewall_policy_link = web_application_firewall_policy_link - + super(CustomRule, self).__init__(**kwargs) + self.name = name + self.enabled_state = enabled_state + self.priority = priority + self.match_conditions = match_conditions + self.action = action -class ErrorResponse(msrest.serialization.Model): - """Error response indicates CDN service is not able to process the incoming request. The reason is provided in the error message. - Variables are only populated by the server, and will be ignored when sending a request. +class CustomRuleList(msrest.serialization.Model): + """Defines contents of custom rules. - :ivar code: Error code. - :vartype code: str - :ivar message: Error message indicating why the operation failed. - :vartype message: str + :param rules: List of rules. + :type rules: list[~azure.mgmt.cdn.models.CustomRule] """ - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[CustomRule]'}, } def __init__( self, + *, + rules: Optional[List["CustomRule"]] = None, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.code = None - self.message = None + super(CustomRuleList, self).__init__(**kwargs) + self.rules = rules -class GeoFilter(msrest.serialization.Model): - """Rules defining user's geo access within a CDN endpoint. +class DeepCreatedOrigin(msrest.serialization.Model): + """The main origin of CDN content which is added when creating a CDN endpoint. All required parameters must be populated in order to send to Azure. - :param relative_path: Required. Relative path applicable to geo filter. (e.g. '/mypictures', - '/mypicture/kitty.jpg', and etc.). - :type relative_path: str - :param action: Required. Action of the geo filter, i.e. allow or block access. Possible values - include: "Block", "Allow". - :type action: str or ~azure.mgmt.cdn.models.GeoFilterActions - :param country_codes: Required. Two letter country codes defining user country access in a geo - filter, e.g. AU, MX, US. - :type country_codes: list[str] + :param name: Required. Origin name which must be unique within the endpoint. + :type name: str + :param host_name: The address of the origin. It can be a domain name, IPv4 address, or IPv6 + address. This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param enabled: Origin is enabled for load balancing or not. By default, origin is always + enabled. + :type enabled: bool + :param private_link_alias: The Alias of the Private Link resource. Populating this optional + field indicates that this origin 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 + :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 """ _validation = { - 'relative_path': {'required': True}, - 'action': {'required': True}, - 'country_codes': {'required': True}, + 'name': {'required': True}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, } _attribute_map = { - 'relative_path': {'key': 'relativePath', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'country_codes': {'key': 'countryCodes', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'weight': {'key': 'properties.weight', 'type': 'int'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, + 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, } def __init__( self, *, - relative_path: str, - action: Union[str, "GeoFilterActions"], - country_codes: List[str], + name: str, + host_name: Optional[str] = None, + http_port: Optional[int] = None, + https_port: Optional[int] = None, + origin_host_header: Optional[str] = None, + priority: Optional[int] = None, + weight: Optional[int] = None, + enabled: Optional[bool] = None, + private_link_alias: Optional[str] = None, + private_link_resource_id: Optional[str] = None, + private_link_location: Optional[str] = None, + private_link_approval_message: Optional[str] = None, **kwargs ): - super(GeoFilter, self).__init__(**kwargs) - self.relative_path = relative_path - self.action = action - self.country_codes = country_codes - + super(DeepCreatedOrigin, self).__init__(**kwargs) + self.name = name + self.host_name = host_name + self.http_port = http_port + self.https_port = https_port + self.origin_host_header = origin_host_header + self.priority = priority + self.weight = weight + self.enabled = enabled + 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_link_approval_message = private_link_approval_message -class HeaderActionParameters(msrest.serialization.Model): - """Defines the parameters for the request header action. - Variables are only populated by the server, and will be ignored when sending a request. +class DeepCreatedOriginGroup(msrest.serialization.Model): + """The origin group for CDN content which is added when creating a CDN endpoint. Traffic is sent to the origins within the origin group based on origin health. All required parameters must be populated in order to send to Azure. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters". - :vartype odata_type: str - :param header_action: Required. Action to perform. Possible values include: "Append", - "Overwrite", "Delete". - :type header_action: str or ~azure.mgmt.cdn.models.HeaderAction - :param header_name: Required. Name of the header to modify. - :type header_name: str - :param value: Value for the specified action. - :type value: str + :param name: Required. Origin group name which must be unique within the endpoint. + :type name: str + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param origins: The source of the content being delivered via CDN within given origin group. + :type origins: list[~azure.mgmt.cdn.models.ResourceReference] + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses.This property is currently + not supported. + :type response_based_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'header_action': {'required': True}, - 'header_name': {'required': True}, + 'name': {'required': True}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'header_action': {'key': 'headerAction', 'type': 'str'}, - 'header_name': {'key': 'headerName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters" - def __init__( self, *, - header_action: Union[str, "HeaderAction"], - header_name: str, - value: Optional[str] = None, + name: str, + health_probe_settings: Optional["HealthProbeParameters"] = None, + origins: Optional[List["ResourceReference"]] = None, + traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, + response_based_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, **kwargs ): - super(HeaderActionParameters, self).__init__(**kwargs) - self.header_action = header_action - self.header_name = header_name - self.value = value + super(DeepCreatedOriginGroup, self).__init__(**kwargs) + self.name = name + self.health_probe_settings = health_probe_settings + self.origins = origins + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes + self.response_based_origin_error_detection_settings = response_based_origin_error_detection_settings -class HealthProbeParameters(msrest.serialization.Model): - """The JSON object that contains the properties to send health probes to origin. +class DeliveryRule(msrest.serialization.Model): + """A rule that specifies a set of actions and conditions. - :param probe_path: The path relative to the origin that is used to determine the health of the - origin. - :type probe_path: str - :param probe_request_type: The type of health probe request that is made. Possible values - include: "NotSet", "GET", "HEAD". - :type probe_request_type: str or ~azure.mgmt.cdn.models.HealthProbeRequestType - :param probe_protocol: Protocol to use for health probe. Possible values include: "NotSet", - "Http", "Https". - :type probe_protocol: str or ~azure.mgmt.cdn.models.ProbeProtocol - :param probe_interval_in_seconds: The number of seconds between health probes.Default is - 240sec. - :type probe_interval_in_seconds: int + All required parameters must be populated in order to send to Azure. + + :param name: Name of the rule. + :type name: str + :param order: Required. The order in which the rules are applied for the endpoint. Possible + values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater + order. Rule with order 0 is a special rule. It does not require any condition and actions + listed in it will always be applied. + :type order: int + :param conditions: A list of conditions that must be matched for the actions to be executed. + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + :param actions: Required. A list of actions that are executed when all the conditions of a rule + are satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] """ _validation = { - 'probe_interval_in_seconds': {'maximum': 255, 'minimum': 1}, + 'order': {'required': True}, + 'actions': {'required': True}, } _attribute_map = { - 'probe_path': {'key': 'probePath', 'type': 'str'}, - 'probe_request_type': {'key': 'probeRequestType', 'type': 'str'}, - 'probe_protocol': {'key': 'probeProtocol', 'type': 'str'}, - 'probe_interval_in_seconds': {'key': 'probeIntervalInSeconds', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'conditions': {'key': 'conditions', 'type': '[DeliveryRuleCondition]'}, + 'actions': {'key': 'actions', 'type': '[DeliveryRuleAction]'}, } def __init__( self, *, - probe_path: Optional[str] = None, - probe_request_type: Optional[Union[str, "HealthProbeRequestType"]] = None, - probe_protocol: Optional[Union[str, "ProbeProtocol"]] = None, - probe_interval_in_seconds: Optional[int] = None, + order: int, + actions: List["DeliveryRuleAction"], + name: Optional[str] = None, + conditions: Optional[List["DeliveryRuleCondition"]] = None, **kwargs ): - super(HealthProbeParameters, self).__init__(**kwargs) - self.probe_path = probe_path - self.probe_request_type = probe_request_type - self.probe_protocol = probe_protocol - self.probe_interval_in_seconds = probe_interval_in_seconds + super(DeliveryRule, self).__init__(**kwargs) + self.name = name + self.order = order + self.conditions = conditions + self.actions = actions -class HttpErrorRangeParameters(msrest.serialization.Model): - """The JSON object that represents the range for http status codes. +class DeliveryRuleAction(msrest.serialization.Model): + """An action for the delivery rule. - :param begin: The inclusive start of the http status code range. - :type begin: int - :param end: The inclusive end of the http status code range. - :type end: int + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DeliveryRuleCacheExpirationAction, DeliveryRuleCacheKeyQueryStringAction, DeliveryRuleRequestHeaderAction, DeliveryRuleResponseHeaderAction, OriginGroupOverrideAction, UrlRedirectAction, UrlRewriteAction, UrlSigningAction. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum """ _validation = { - 'begin': {'maximum': 999, 'minimum': 100}, - 'end': {'maximum': 999, 'minimum': 100}, + 'name': {'required': True}, } _attribute_map = { - 'begin': {'key': 'begin', 'type': 'int'}, - 'end': {'key': 'end', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'name': {'CacheExpiration': 'DeliveryRuleCacheExpirationAction', 'CacheKeyQueryString': 'DeliveryRuleCacheKeyQueryStringAction', 'ModifyRequestHeader': 'DeliveryRuleRequestHeaderAction', 'ModifyResponseHeader': 'DeliveryRuleResponseHeaderAction', 'OriginGroupOverride': 'OriginGroupOverrideAction', 'UrlRedirect': 'UrlRedirectAction', 'UrlRewrite': 'UrlRewriteAction', 'UrlSigning': 'UrlSigningAction'} } def __init__( self, - *, - begin: Optional[int] = None, - end: Optional[int] = None, **kwargs ): - super(HttpErrorRangeParameters, self).__init__(**kwargs) - self.begin = begin - self.end = end - + super(DeliveryRuleAction, self).__init__(**kwargs) + self.name = None # type: Optional[str] -class HttpVersionMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for HttpVersion match conditions. - Variables are only populated by the server, and will be ignored when sending a request. +class DeliveryRuleCacheExpirationAction(DeliveryRuleAction): + """Defines the cache expiration action for the delivery rule. All required parameters must be populated in order to send to Azure. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Equal". - :type operator: str or ~azure.mgmt.cdn.models.HttpVersionOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.CacheExpirationActionParameters """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'CacheExpirationActionParameters'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters" - def __init__( self, *, - operator: Union[str, "HttpVersionOperator"], - negate_condition: Optional[bool] = None, - match_values: Optional[List[str]] = None, + parameters: "CacheExpirationActionParameters", **kwargs ): - super(HttpVersionMatchConditionParameters, self).__init__(**kwargs) - self.operator = operator - self.negate_condition = negate_condition - self.match_values = match_values + super(DeliveryRuleCacheExpirationAction, self).__init__(**kwargs) + self.name = 'CacheExpiration' # type: str + self.parameters = parameters -class IpAddressGroup(msrest.serialization.Model): - """CDN Ip address group. +class DeliveryRuleCacheKeyQueryStringAction(DeliveryRuleAction): + """Defines the cache-key query string action for the delivery rule. - :param delivery_region: The delivery region of the ip address group. - :type delivery_region: str - :param ipv4_addresses: The list of ip v4 addresses. - :type ipv4_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress] - :param ipv6_addresses: The list of ip v6 addresses. - :type ipv6_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress] + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.CacheKeyQueryStringActionParameters """ + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + _attribute_map = { - 'delivery_region': {'key': 'deliveryRegion', 'type': 'str'}, - 'ipv4_addresses': {'key': 'ipv4Addresses', 'type': '[CidrIpAddress]'}, - 'ipv6_addresses': {'key': 'ipv6Addresses', 'type': '[CidrIpAddress]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'CacheKeyQueryStringActionParameters'}, } def __init__( self, *, - delivery_region: Optional[str] = None, - ipv4_addresses: Optional[List["CidrIpAddress"]] = None, - ipv6_addresses: Optional[List["CidrIpAddress"]] = None, + parameters: "CacheKeyQueryStringActionParameters", **kwargs ): - super(IpAddressGroup, self).__init__(**kwargs) - self.delivery_region = delivery_region - self.ipv4_addresses = ipv4_addresses - self.ipv6_addresses = ipv6_addresses + super(DeliveryRuleCacheKeyQueryStringAction, self).__init__(**kwargs) + self.name = 'CacheKeyQueryString' # type: str + self.parameters = parameters -class IsDeviceMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for IsDevice match conditions. +class DeliveryRuleCondition(msrest.serialization.Model): + """A condition for the delivery rule. - Variables are only populated by the server, and will be ignored when sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DeliveryRuleCookiesCondition, DeliveryRuleHttpVersionCondition, DeliveryRuleIsDeviceCondition, DeliveryRulePostArgsCondition, DeliveryRuleQueryStringCondition, DeliveryRuleRemoteAddressCondition, DeliveryRuleRequestBodyCondition, DeliveryRuleRequestHeaderCondition, DeliveryRuleRequestMethodCondition, DeliveryRuleRequestSchemeCondition, DeliveryRuleRequestUriCondition, DeliveryRuleUrlFileExtensionCondition, DeliveryRuleUrlFileNameCondition, DeliveryRuleUrlPathCondition. All required parameters must be populated in order to send to Azure. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Equal". - :type operator: str or ~azure.mgmt.cdn.models.IsDeviceOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str or - ~azure.mgmt.cdn.models.IsDeviceMatchConditionParametersMatchValuesItem] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'name': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters" + _subtype_map = { + 'name': {'Cookies': 'DeliveryRuleCookiesCondition', 'HttpVersion': 'DeliveryRuleHttpVersionCondition', 'IsDevice': 'DeliveryRuleIsDeviceCondition', 'PostArgs': 'DeliveryRulePostArgsCondition', 'QueryString': 'DeliveryRuleQueryStringCondition', 'RemoteAddress': 'DeliveryRuleRemoteAddressCondition', 'RequestBody': 'DeliveryRuleRequestBodyCondition', 'RequestHeader': 'DeliveryRuleRequestHeaderCondition', 'RequestMethod': 'DeliveryRuleRequestMethodCondition', 'RequestScheme': 'DeliveryRuleRequestSchemeCondition', 'RequestUri': 'DeliveryRuleRequestUriCondition', 'UrlFileExtension': 'DeliveryRuleUrlFileExtensionCondition', 'UrlFileName': 'DeliveryRuleUrlFileNameCondition', 'UrlPath': 'DeliveryRuleUrlPathCondition'} + } def __init__( self, - *, - operator: Union[str, "IsDeviceOperator"], - negate_condition: Optional[bool] = None, - match_values: Optional[List[Union[str, "IsDeviceMatchConditionParametersMatchValuesItem"]]] = None, - transforms: Optional[List[Union[str, "Transform"]]] = None, **kwargs ): - super(IsDeviceMatchConditionParameters, self).__init__(**kwargs) - self.operator = operator - self.negate_condition = negate_condition - self.match_values = match_values - self.transforms = transforms - + super(DeliveryRuleCondition, self).__init__(**kwargs) + self.name = None # type: Optional[str] -class KeyVaultCertificateSourceParameters(msrest.serialization.Model): - """Describes the parameters for using a user's KeyVault certificate for securing custom domain. - Variables are only populated by the server, and will be ignored when sending a request. +class DeliveryRuleCookiesCondition(DeliveryRuleCondition): + """Defines the Cookies condition for the delivery rule. All required parameters must be populated in order to send to Azure. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters". - :vartype odata_type: str - :param subscription_id: Required. Subscription Id of the user's Key Vault containing the SSL - certificate. - :type subscription_id: str - :param resource_group_name: Required. Resource group of the user's Key Vault containing the SSL - certificate. - :type resource_group_name: str - :param vault_name: Required. The name of the user's Key Vault containing the SSL certificate. - :type vault_name: str - :param secret_name: Required. The name of Key Vault Secret (representing the full certificate - PFX) in Key Vault. - :type secret_name: str - :param secret_version: The version(GUID) of Key Vault Secret in Key Vault. - :type secret_version: str - :param update_rule: Required. Describes the action that shall be taken when the certificate is - updated in Key Vault. Possible values include: "NoAction". - :type update_rule: str or ~azure.mgmt.cdn.models.UpdateRule - :param delete_rule: Required. Describes the action that shall be taken when the certificate is - removed from Key Vault. Possible values include: "NoAction". - :type delete_rule: str or ~azure.mgmt.cdn.models.DeleteRule + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.CookiesMatchConditionParameters """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'subscription_id': {'required': True}, - 'resource_group_name': {'required': True}, - 'vault_name': {'required': True}, - 'secret_name': {'required': True}, - 'update_rule': {'required': True}, - 'delete_rule': {'required': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, - 'vault_name': {'key': 'vaultName', 'type': 'str'}, - 'secret_name': {'key': 'secretName', 'type': 'str'}, - 'secret_version': {'key': 'secretVersion', 'type': 'str'}, - 'update_rule': {'key': 'updateRule', 'type': 'str'}, - 'delete_rule': {'key': 'deleteRule', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'CookiesMatchConditionParameters'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters" - def __init__( self, *, - subscription_id: str, - resource_group_name: str, - vault_name: str, - secret_name: str, - update_rule: Union[str, "UpdateRule"], - delete_rule: Union[str, "DeleteRule"], - secret_version: Optional[str] = None, + parameters: "CookiesMatchConditionParameters", **kwargs ): - super(KeyVaultCertificateSourceParameters, self).__init__(**kwargs) - self.subscription_id = subscription_id - self.resource_group_name = resource_group_name - self.vault_name = vault_name - self.secret_name = secret_name - self.secret_version = secret_version - self.update_rule = update_rule - self.delete_rule = delete_rule - + super(DeliveryRuleCookiesCondition, self).__init__(**kwargs) + self.name = 'Cookies' # type: str + self.parameters = parameters -class KeyVaultSigningKeyParameters(msrest.serialization.Model): - """Describes the parameters for using a user's KeyVault for URL Signing Key. - Variables are only populated by the server, and will be ignored when sending a request. +class DeliveryRuleHttpVersionCondition(DeliveryRuleCondition): + """Defines the HttpVersion condition for the delivery rule. All required parameters must be populated in order to send to Azure. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters". - :vartype odata_type: str - :param subscription_id: Required. Subscription Id of the user's Key Vault containing the - secret. - :type subscription_id: str - :param resource_group_name: Required. Resource group of the user's Key Vault containing the - secret. - :type resource_group_name: str - :param vault_name: Required. The name of the user's Key Vault containing the secret. - :type vault_name: str - :param secret_name: Required. The name of secret in Key Vault. - :type secret_name: str - :param secret_version: Required. The version(GUID) of secret in Key Vault. - :type secret_version: str + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.HttpVersionMatchConditionParameters """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'subscription_id': {'required': True}, - 'resource_group_name': {'required': True}, - 'vault_name': {'required': True}, - 'secret_name': {'required': True}, - 'secret_version': {'required': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, - 'vault_name': {'key': 'vaultName', 'type': 'str'}, - 'secret_name': {'key': 'secretName', 'type': 'str'}, - 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'HttpVersionMatchConditionParameters'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters" - def __init__( self, *, - subscription_id: str, - resource_group_name: str, - vault_name: str, - secret_name: str, - secret_version: str, + parameters: "HttpVersionMatchConditionParameters", **kwargs ): - super(KeyVaultSigningKeyParameters, self).__init__(**kwargs) - self.subscription_id = subscription_id - self.resource_group_name = resource_group_name - self.vault_name = vault_name - self.secret_name = secret_name - self.secret_version = secret_version + super(DeliveryRuleHttpVersionCondition, self).__init__(**kwargs) + self.name = 'HttpVersion' # type: str + self.parameters = parameters -class LoadParameters(msrest.serialization.Model): - """Parameters required for content load. +class DeliveryRuleIsDeviceCondition(DeliveryRuleCondition): + """Defines the IsDevice condition for the delivery rule. All required parameters must be populated in order to send to Azure. - :param content_paths: Required. The path to the content to be loaded. Path should be a relative - file URL of the origin. - :type content_paths: list[str] + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.IsDeviceMatchConditionParameters """ _validation = { - 'content_paths': {'required': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'IsDeviceMatchConditionParameters'}, } def __init__( self, *, - content_paths: List[str], + parameters: "IsDeviceMatchConditionParameters", **kwargs ): - super(LoadParameters, self).__init__(**kwargs) - self.content_paths = content_paths + super(DeliveryRuleIsDeviceCondition, self).__init__(**kwargs) + self.name = 'IsDevice' # type: str + self.parameters = parameters -class ManagedRuleDefinition(msrest.serialization.Model): - """Describes a managed rule definition. +class DeliveryRulePostArgsCondition(DeliveryRuleCondition): + """Defines the PostArgs condition for the delivery rule. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar rule_id: Identifier for the managed rule. - :vartype rule_id: str - :ivar description: Describes the functionality of the managed rule. - :vartype description: str + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.PostArgsMatchConditionParameters """ _validation = { - 'rule_id': {'readonly': True}, - 'description': {'readonly': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'rule_id': {'key': 'ruleId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'PostArgsMatchConditionParameters'}, } def __init__( self, + *, + parameters: "PostArgsMatchConditionParameters", **kwargs ): - super(ManagedRuleDefinition, self).__init__(**kwargs) - self.rule_id = None - self.description = None + super(DeliveryRulePostArgsCondition, self).__init__(**kwargs) + self.name = 'PostArgs' # type: str + self.parameters = parameters -class ManagedRuleGroupDefinition(msrest.serialization.Model): - """Describes a managed rule group. +class DeliveryRuleQueryStringCondition(DeliveryRuleCondition): + """Defines the QueryString condition for the delivery rule. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar rule_group_name: Name of the managed rule group. - :vartype rule_group_name: str - :ivar description: Description of the managed rule group. - :vartype description: str - :ivar rules: List of rules within the managed rule group. - :vartype rules: list[~azure.mgmt.cdn.models.ManagedRuleDefinition] + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.QueryStringMatchConditionParameters """ _validation = { - 'rule_group_name': {'readonly': True}, - 'description': {'readonly': True}, - 'rules': {'readonly': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[ManagedRuleDefinition]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'QueryStringMatchConditionParameters'}, } def __init__( self, + *, + parameters: "QueryStringMatchConditionParameters", **kwargs ): - super(ManagedRuleGroupDefinition, self).__init__(**kwargs) - self.rule_group_name = None - self.description = None - self.rules = None + super(DeliveryRuleQueryStringCondition, self).__init__(**kwargs) + self.name = 'QueryString' # type: str + self.parameters = parameters -class ManagedRuleGroupOverride(msrest.serialization.Model): - """Defines a managed rule group override setting. +class DeliveryRuleRemoteAddressCondition(DeliveryRuleCondition): + """Defines the RemoteAddress condition for the delivery rule. All required parameters must be populated in order to send to Azure. - :param rule_group_name: Required. Describes the managed rule group within the rule set to - override. - :type rule_group_name: str - :param rules: List of rules that will be disabled. If none specified, all rules in the group - will be disabled. - :type rules: list[~azure.mgmt.cdn.models.ManagedRuleOverride] + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RemoteAddressMatchConditionParameters """ _validation = { - 'rule_group_name': {'required': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[ManagedRuleOverride]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RemoteAddressMatchConditionParameters'}, } def __init__( self, *, - rule_group_name: str, - rules: Optional[List["ManagedRuleOverride"]] = None, + parameters: "RemoteAddressMatchConditionParameters", **kwargs ): - super(ManagedRuleGroupOverride, self).__init__(**kwargs) - self.rule_group_name = rule_group_name - self.rules = rules + super(DeliveryRuleRemoteAddressCondition, self).__init__(**kwargs) + self.name = 'RemoteAddress' # type: str + self.parameters = parameters -class ManagedRuleOverride(msrest.serialization.Model): - """Defines a managed rule group override setting. +class DeliveryRuleRequestBodyCondition(DeliveryRuleCondition): + """Defines the RequestBody condition for the delivery rule. All required parameters must be populated in order to send to Azure. - :param rule_id: Required. Identifier for the managed rule. - :type rule_id: str - :param enabled_state: Describes if the managed rule is in enabled or disabled state. Defaults - to Disabled if not specified. Possible values include: "Disabled", "Enabled". - :type enabled_state: str or ~azure.mgmt.cdn.models.ManagedRuleEnabledState - :param action: Describes the override action to be applied when rule matches. Possible values - include: "Allow", "Block", "Log", "Redirect". - :type action: str or ~azure.mgmt.cdn.models.ActionType + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RequestBodyMatchConditionParameters """ _validation = { - 'rule_id': {'required': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'rule_id': {'key': 'ruleId', 'type': 'str'}, - 'enabled_state': {'key': 'enabledState', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RequestBodyMatchConditionParameters'}, } def __init__( self, *, - rule_id: str, - enabled_state: Optional[Union[str, "ManagedRuleEnabledState"]] = None, - action: Optional[Union[str, "ActionType"]] = None, + parameters: "RequestBodyMatchConditionParameters", **kwargs ): - super(ManagedRuleOverride, self).__init__(**kwargs) - self.rule_id = rule_id - self.enabled_state = enabled_state - self.action = action + super(DeliveryRuleRequestBodyCondition, self).__init__(**kwargs) + self.name = 'RequestBody' # type: str + self.parameters = parameters -class ManagedRuleSet(msrest.serialization.Model): - """Defines a managed rule set. +class DeliveryRuleRequestHeaderAction(DeliveryRuleAction): + """Defines the request header action for the delivery rule. All required parameters must be populated in order to send to Azure. - :param rule_set_type: Required. Defines the rule set type to use. - :type rule_set_type: str - :param rule_set_version: Required. Defines the version of the rule set to use. - :type rule_set_version: str - :param anomaly_score: Verizon only : If the rule set supports anomaly detection mode, this - describes the threshold for blocking requests. - :type anomaly_score: int - :param rule_group_overrides: Defines the rule overrides to apply to the rule set. - :type rule_group_overrides: list[~azure.mgmt.cdn.models.ManagedRuleGroupOverride] + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.HeaderActionParameters """ _validation = { - 'rule_set_type': {'required': True}, - 'rule_set_version': {'required': True}, - 'anomaly_score': {'maximum': 20, 'minimum': 0}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, - 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, - 'anomaly_score': {'key': 'anomalyScore', 'type': 'int'}, - 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[ManagedRuleGroupOverride]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'HeaderActionParameters'}, } def __init__( self, *, - rule_set_type: str, - rule_set_version: str, - anomaly_score: Optional[int] = None, - rule_group_overrides: Optional[List["ManagedRuleGroupOverride"]] = None, + parameters: "HeaderActionParameters", **kwargs ): - super(ManagedRuleSet, self).__init__(**kwargs) - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.anomaly_score = anomaly_score - self.rule_group_overrides = rule_group_overrides + super(DeliveryRuleRequestHeaderAction, self).__init__(**kwargs) + self.name = 'ModifyRequestHeader' # type: str + self.parameters = parameters -class ManagedRuleSetDefinition(Resource): - """Describes a managed rule set definition. +class DeliveryRuleRequestHeaderCondition(DeliveryRuleCondition): + """Defines the RequestHeader condition for the delivery rule. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param sku: The pricing tier (defines a CDN provider, feature list and rate) of the - CdnWebApplicationFirewallPolicy. - :type sku: ~azure.mgmt.cdn.models.Sku - :ivar provisioning_state: Provisioning state of the managed rule set. - :vartype provisioning_state: str - :ivar rule_set_type: Type of the managed rule set. - :vartype rule_set_type: str - :ivar rule_set_version: Version of the managed rule set type. - :vartype rule_set_version: str - :ivar rule_groups: Rule groups of the managed rule set. - :vartype rule_groups: list[~azure.mgmt.cdn.models.ManagedRuleGroupDefinition] + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RequestHeaderMatchConditionParameters """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'rule_set_type': {'readonly': True}, - 'rule_set_version': {'readonly': True}, - 'rule_groups': {'readonly': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, - 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, - 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ManagedRuleGroupDefinition]'}, + 'parameters': {'key': 'parameters', 'type': 'RequestHeaderMatchConditionParameters'}, } def __init__( self, *, - sku: Optional["Sku"] = None, + parameters: "RequestHeaderMatchConditionParameters", **kwargs ): - super(ManagedRuleSetDefinition, self).__init__(**kwargs) - self.sku = sku - self.provisioning_state = None - self.rule_set_type = None - self.rule_set_version = None - self.rule_groups = None + super(DeliveryRuleRequestHeaderCondition, self).__init__(**kwargs) + self.name = 'RequestHeader' # type: str + self.parameters = parameters -class ManagedRuleSetDefinitionList(msrest.serialization.Model): - """List of managed rule set definitions available for use in a policy. +class DeliveryRuleRequestMethodCondition(DeliveryRuleCondition): + """Defines the RequestMethod condition for the delivery rule. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: List of managed rule set definitions. - :vartype value: list[~azure.mgmt.cdn.models.ManagedRuleSetDefinition] - :param next_link: URL to retrieve next set of managed rule set definitions. - :type next_link: str + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RequestMethodMatchConditionParameters """ _validation = { - 'value': {'readonly': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedRuleSetDefinition]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RequestMethodMatchConditionParameters'}, } def __init__( self, *, - next_link: Optional[str] = None, + parameters: "RequestMethodMatchConditionParameters", **kwargs ): - super(ManagedRuleSetDefinitionList, self).__init__(**kwargs) - self.value = None - self.next_link = next_link + super(DeliveryRuleRequestMethodCondition, self).__init__(**kwargs) + self.name = 'RequestMethod' # type: str + self.parameters = parameters -class ManagedRuleSetList(msrest.serialization.Model): - """Defines the list of managed rule sets for the policy. +class DeliveryRuleRequestSchemeCondition(DeliveryRuleCondition): + """Defines the RequestScheme condition for the delivery rule. - :param managed_rule_sets: List of rule sets. - :type managed_rule_sets: list[~azure.mgmt.cdn.models.ManagedRuleSet] + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParameters """ + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + _attribute_map = { - 'managed_rule_sets': {'key': 'managedRuleSets', 'type': '[ManagedRuleSet]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RequestSchemeMatchConditionParameters'}, } def __init__( self, *, - managed_rule_sets: Optional[List["ManagedRuleSet"]] = None, + parameters: "RequestSchemeMatchConditionParameters", **kwargs ): - super(ManagedRuleSetList, self).__init__(**kwargs) - self.managed_rule_sets = managed_rule_sets + super(DeliveryRuleRequestSchemeCondition, self).__init__(**kwargs) + self.name = 'RequestScheme' # type: str + self.parameters = parameters -class MatchCondition(msrest.serialization.Model): - """Define match conditions. +class DeliveryRuleRequestUriCondition(DeliveryRuleCondition): + """Defines the RequestUri condition for the delivery rule. All required parameters must be populated in order to send to Azure. - :param match_variable: Required. Match variable to compare against. Possible values include: - "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", "RequestUri", "RequestHeader", - "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", "UrlFileName", "HttpVersion", - "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". - :type match_variable: str or ~azure.mgmt.cdn.models.MatchVariable - :param selector: Selector can used to match a specific key for QueryString, Cookies, - RequestHeader or PostArgs. - :type selector: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "IPMatch", "GeoMatch", "Equal", "Contains", "LessThan", "GreaterThan", "LessThanOrEqual", - "GreaterThanOrEqual", "BeginsWith", "EndsWith", "RegEx". - :type operator: str or ~azure.mgmt.cdn.models.Operator - :param negate_condition: Describes if the result of this condition should be negated. - :type negate_condition: bool - :param match_value: Required. List of possible match values. - :type match_value: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.TransformType] + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.RequestUriMatchConditionParameters """ _validation = { - 'match_variable': {'required': True}, - 'operator': {'required': True}, - 'match_value': {'required': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'match_variable': {'key': 'matchVariable', 'type': 'str'}, - 'selector': {'key': 'selector', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_value': {'key': 'matchValue', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'RequestUriMatchConditionParameters'}, } def __init__( self, *, - match_variable: Union[str, "MatchVariable"], - operator: Union[str, "Operator"], - match_value: List[str], - selector: Optional[str] = None, - negate_condition: Optional[bool] = None, - transforms: Optional[List[Union[str, "TransformType"]]] = None, + parameters: "RequestUriMatchConditionParameters", **kwargs ): - super(MatchCondition, self).__init__(**kwargs) - self.match_variable = match_variable - self.selector = selector - self.operator = operator - self.negate_condition = negate_condition - self.match_value = match_value - self.transforms = transforms + super(DeliveryRuleRequestUriCondition, self).__init__(**kwargs) + self.name = 'RequestUri' # type: str + self.parameters = parameters -class Operation(msrest.serialization.Model): - """CDN REST API operation. +class DeliveryRuleResponseHeaderAction(DeliveryRuleAction): + """Defines the response header action for the delivery rule. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.cdn.models.OperationDisplay + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.HeaderActionParameters """ _validation = { - 'name': {'readonly': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'parameters': {'key': 'parameters', 'type': 'HeaderActionParameters'}, } def __init__( self, *, - display: Optional["OperationDisplay"] = None, + parameters: "HeaderActionParameters", **kwargs ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = display + super(DeliveryRuleResponseHeaderAction, self).__init__(**kwargs) + self.name = 'ModifyResponseHeader' # type: str + self.parameters = parameters -class OperationDisplay(msrest.serialization.Model): - """The object that represents the operation. +class DeliveryRuleUrlFileExtensionCondition(DeliveryRuleCondition): + """Defines the UrlFileExtension condition for the delivery rule. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar provider: Service provider: Microsoft.Cdn. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: Profile, endpoint, etc. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.UrlFileExtensionMatchConditionParameters """ _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'UrlFileExtensionMatchConditionParameters'}, } def __init__( self, + *, + parameters: "UrlFileExtensionMatchConditionParameters", **kwargs ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None + super(DeliveryRuleUrlFileExtensionCondition, self).__init__(**kwargs) + self.name = 'UrlFileExtension' # type: str + self.parameters = parameters -class OperationsListResult(msrest.serialization.Model): - """Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. +class DeliveryRuleUrlFileNameCondition(DeliveryRuleCondition): + """Defines the UrlFileName condition for the delivery rule. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: List of CDN operations supported by the CDN resource provider. - :vartype value: list[~azure.mgmt.cdn.models.Operation] - :param next_link: URL to get the next set of operation list results if there are any. - :type next_link: str + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.UrlFileNameMatchConditionParameters """ _validation = { - 'value': {'readonly': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'UrlFileNameMatchConditionParameters'}, } def __init__( self, *, - next_link: Optional[str] = None, + parameters: "UrlFileNameMatchConditionParameters", **kwargs ): - super(OperationsListResult, self).__init__(**kwargs) - self.value = None - self.next_link = next_link + super(DeliveryRuleUrlFileNameCondition, self).__init__(**kwargs) + self.name = 'UrlFileName' # type: str + self.parameters = parameters -class Origin(Resource): - """CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the configured origins. +class DeliveryRuleUrlPathCondition(DeliveryRuleCondition): + """Defines the UrlPath condition for the delivery rule. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses - are supported.This should be unique across all origins in an endpoint. - :type host_name: str - :param http_port: The value of the HTTP port. Must be between 1 and 65535. - :type http_port: int - :param https_port: The value of the HTTPS port. Must be between 1 and 65535. - :type https_port: int - :param origin_host_header: The host header value sent to the origin with each request. If you - leave this blank, the request hostname determines this value. Azure CDN origins, such as Web - Apps, Blob Storage, and Cloud Services require this host header value to match the origin - hostname by default. This overrides the host header defined at Endpoint. - :type origin_host_header: str - :param priority: Priority of origin in given origin group for load balancing. Higher priorities - will not be used for load balancing if any lower priority origin is healthy.Must be between 1 - and 5. - :type priority: int - :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 - and 1000. - :type weight: int - :param enabled: Origin is enabled for load balancing or not. - :type enabled: bool - :param private_link_alias: The Alias of the Private Link resource. Populating this optional - field indicates that this origin 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 - :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 - :ivar resource_state: Resource status of the origin. Possible values include: "Creating", - "Active", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState - :ivar provisioning_state: Provisioning status of the origin. - :vartype provisioning_state: 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.cdn.models.PrivateEndpointStatus + :param name: Required. The name of the condition for the delivery rule.Constant filled by + server. Possible values include: "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", + "RequestUri", "RequestHeader", "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", + "UrlFileName", "HttpVersion", "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type name: str or ~azure.mgmt.cdn.models.MatchVariable + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.UrlPathMatchConditionParameters """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'http_port': {'maximum': 65535, 'minimum': 1}, - 'https_port': {'maximum': 65535, 'minimum': 1}, - 'priority': {'maximum': 5, 'minimum': 1}, - 'weight': {'maximum': 1000, 'minimum': 1}, - 'resource_state': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'private_endpoint_status': {'readonly': True}, + 'name': {'required': True}, + 'parameters': {'required': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, - 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, - 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, - 'priority': {'key': 'properties.priority', 'type': 'int'}, - 'weight': {'key': 'properties.weight', 'type': 'int'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, - 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, - 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'private_endpoint_status': {'key': 'properties.privateEndpointStatus', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'UrlPathMatchConditionParameters'}, } def __init__( self, *, - host_name: Optional[str] = None, - http_port: Optional[int] = None, - https_port: Optional[int] = None, - origin_host_header: Optional[str] = None, - priority: Optional[int] = None, - weight: Optional[int] = None, - enabled: Optional[bool] = None, - private_link_alias: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - private_link_location: Optional[str] = None, - private_link_approval_message: Optional[str] = None, + parameters: "UrlPathMatchConditionParameters", **kwargs ): - super(Origin, self).__init__(**kwargs) - self.host_name = host_name - self.http_port = http_port - self.https_port = https_port - self.origin_host_header = origin_host_header - self.priority = priority - self.weight = weight - self.enabled = enabled - 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_link_approval_message = private_link_approval_message - self.resource_state = None - self.provisioning_state = None - self.private_endpoint_status = None + super(DeliveryRuleUrlPathCondition, self).__init__(**kwargs) + self.name = 'UrlPath' # type: str + self.parameters = parameters -class OriginGroup(Resource): - """Origin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. +class DomainValidationProperties(msrest.serialization.Model): + """The JSON object that contains the properties to validate a domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar validation_token: Challenge used for DNS TXT record or file based validation. + :vartype validation_token: str + :ivar expiration_date: The date time that the token expires. + :vartype expiration_date: str + """ + + _validation = { + 'validation_token': {'readonly': True}, + 'expiration_date': {'readonly': True}, + } + + _attribute_map = { + 'validation_token': {'key': 'validationToken', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainValidationProperties, self).__init__(**kwargs) + self.validation_token = None + self.expiration_date = None + + +class EdgeNode(ProxyResource): + """Edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. Variables are only populated by the server, and will be ignored when sending a request. @@ -3477,74 +3470,45 @@ class OriginGroup(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param health_probe_settings: Health probe settings to the origin that is used to determine the - health of the origin. - :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters - :param origins: The source of the content being delivered via CDN within given origin group. - :type origins: list[~azure.mgmt.cdn.models.ResourceReference] - :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift - the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new - endpoint is added. Default is 10 mins. This property is currently not supported. - :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int - :param response_based_origin_error_detection_settings: The JSON object that contains the - properties to determine origin health using real requests/responses. This property is currently - not supported. - :type response_based_origin_error_detection_settings: - ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters - :ivar resource_state: Resource status of the origin group. Possible values include: "Creating", - "Active", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginGroupResourceState - :ivar provisioning_state: Provisioning status of the origin group. - :vartype provisioning_state: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param ip_address_groups: List of ip address groups. + :type ip_address_groups: list[~azure.mgmt.cdn.models.IpAddressGroup] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, - 'resource_state': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, - 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, - 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, - 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'ip_address_groups': {'key': 'properties.ipAddressGroups', 'type': '[IpAddressGroup]'}, } def __init__( self, *, - health_probe_settings: Optional["HealthProbeParameters"] = None, - origins: Optional[List["ResourceReference"]] = None, - traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, - response_based_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + ip_address_groups: Optional[List["IpAddressGroup"]] = None, **kwargs ): - super(OriginGroup, self).__init__(**kwargs) - self.health_probe_settings = health_probe_settings - self.origins = origins - self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes - self.response_based_origin_error_detection_settings = response_based_origin_error_detection_settings - self.resource_state = None - self.provisioning_state = None + super(EdgeNode, self).__init__(**kwargs) + self.ip_address_groups = ip_address_groups -class OriginGroupListResult(msrest.serialization.Model): - """Result of the request to list origin groups. It contains a list of origin groups objects and a URL link to get the next set of results. +class EdgenodeResult(msrest.serialization.Model): + """Result of the request to list CDN edgenodes. It contains a list of ip address group and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of CDN origin groups within an endpoint. - :vartype value: list[~azure.mgmt.cdn.models.OriginGroup] - :param next_link: URL to get the next set of origin objects if there are any. + :ivar value: Edge node of CDN service. + :vartype value: list[~azure.mgmt.cdn.models.EdgeNode] + :param next_link: URL to get the next set of edgenode list results if there are any. :type next_link: str """ @@ -3553,176 +3517,3550 @@ class OriginGroupListResult(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[OriginGroup]'}, + 'value': {'key': 'value', 'type': '[EdgeNode]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(EdgenodeResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class Endpoint(TrackedResource): + """CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format :code:``.azureedge.net. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param origin_path: A directory path on the origin that CDN can use to retrieve content from, + e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param content_types_to_compress: List of content types on which compression applies. The value + should be a valid MIME type. + :type content_types_to_compress: list[str] + :param origin_host_header: The host header value sent to the origin with each request. This + property at Endpoint is only allowed when endpoint uses single origin and can be overridden by + the same property specified at origin.If you leave this blank, the request hostname determines + this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this + host header value to match the origin hostname by default. + :type origin_host_header: str + :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default + value is false. If compression is enabled, content will be served as compressed if user + requests for a compressed version. Content won't be compressed on CDN when requested content is + smaller than 1 byte or larger than 1 MB. + :type is_compression_enabled: bool + :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_http_allowed: bool + :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_https_allowed: bool + :param query_string_caching_behavior: Defines how CDN caches requests that include query + strings. You can ignore any query strings when caching, bypass caching to prevent requests that + contain query strings from being cached, or cache every request with a unique URL. Possible + values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to + optimize for, e.g. Download, Media services. With this information, CDN can apply scenario + driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", + "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the + dynamic content and calculate the most optimal routes for the CDN. This is relative to the + origin path. This property is only relevant when using a single origin. + :type probe_path: str + :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each + geo filter defines an access rule to a specified path or content, e.g. block APAC for path + /pictures/. + :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param default_origin_group: A reference to the origin group. + :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param url_signing_keys: List of keys used to validate the signed URL hashes. + :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] + :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. + :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy + :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for + the endpoint (if applicable). + :type web_application_firewall_policy_link: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + contoso.azureedge.net. + :vartype host_name: str + :param origins: The source of the content being delivered via CDN. + :type origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin] + :param origin_groups: The origin groups comprising of origins that are used for load balancing + the traffic based on availability. + :type origin_groups: list[~azure.mgmt.cdn.models.DeepCreatedOriginGroup] + :ivar resource_state: Resource status of the endpoint. Possible values include: "Creating", + "Deleting", "Running", "Starting", "Stopped", "Stopping". + :vartype resource_state: str or ~azure.mgmt.cdn.models.EndpointResourceState + :ivar provisioning_state: Provisioning status of the endpoint. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'host_name': {'readonly': True}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, + 'content_types_to_compress': {'key': 'properties.contentTypesToCompress', 'type': '[str]'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'is_compression_enabled': {'key': 'properties.isCompressionEnabled', 'type': 'bool'}, + 'is_http_allowed': {'key': 'properties.isHttpAllowed', 'type': 'bool'}, + 'is_https_allowed': {'key': 'properties.isHttpsAllowed', 'type': 'bool'}, + 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, + 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, + 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, + 'default_origin_group': {'key': 'properties.defaultOriginGroup', 'type': 'ResourceReference'}, + 'url_signing_keys': {'key': 'properties.urlSigningKeys', 'type': '[UrlSigningKey]'}, + 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, + 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'origins': {'key': 'properties.origins', 'type': '[DeepCreatedOrigin]'}, + 'origin_groups': {'key': 'properties.originGroups', 'type': '[DeepCreatedOriginGroup]'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + origin_path: Optional[str] = None, + content_types_to_compress: Optional[List[str]] = None, + origin_host_header: Optional[str] = None, + is_compression_enabled: Optional[bool] = None, + is_http_allowed: Optional[bool] = None, + is_https_allowed: Optional[bool] = None, + query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, + optimization_type: Optional[Union[str, "OptimizationType"]] = None, + probe_path: Optional[str] = None, + geo_filters: Optional[List["GeoFilter"]] = None, + default_origin_group: Optional["ResourceReference"] = None, + url_signing_keys: Optional[List["UrlSigningKey"]] = None, + delivery_policy: Optional["EndpointPropertiesUpdateParametersDeliveryPolicy"] = None, + web_application_firewall_policy_link: Optional["EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"] = None, + origins: Optional[List["DeepCreatedOrigin"]] = None, + origin_groups: Optional[List["DeepCreatedOriginGroup"]] = None, + **kwargs + ): + super(Endpoint, self).__init__(location=location, tags=tags, **kwargs) + self.origin_path = origin_path + self.content_types_to_compress = content_types_to_compress + self.origin_host_header = origin_host_header + self.is_compression_enabled = is_compression_enabled + self.is_http_allowed = is_http_allowed + self.is_https_allowed = is_https_allowed + self.query_string_caching_behavior = query_string_caching_behavior + self.optimization_type = optimization_type + self.probe_path = probe_path + self.geo_filters = geo_filters + self.default_origin_group = default_origin_group + self.url_signing_keys = url_signing_keys + self.delivery_policy = delivery_policy + self.web_application_firewall_policy_link = web_application_firewall_policy_link + self.host_name = None + self.origins = origins + self.origin_groups = origin_groups + self.resource_state = None + self.provisioning_state = None + + +class EndpointListResult(msrest.serialization.Model): + """Result of the request to list endpoints. It contains a list of endpoint objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of CDN endpoints within a profile. + :vartype value: list[~azure.mgmt.cdn.models.Endpoint] + :param next_link: URL to get the next set of endpoint objects if there is any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Endpoint]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - next_link: Optional[str] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(EndpointListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class EndpointPropertiesUpdateParameters(msrest.serialization.Model): + """The JSON object containing endpoint update parameters. + + :param origin_path: A directory path on the origin that CDN can use to retrieve content from, + e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param content_types_to_compress: List of content types on which compression applies. The value + should be a valid MIME type. + :type content_types_to_compress: list[str] + :param origin_host_header: The host header value sent to the origin with each request. This + property at Endpoint is only allowed when endpoint uses single origin and can be overridden by + the same property specified at origin.If you leave this blank, the request hostname determines + this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this + host header value to match the origin hostname by default. + :type origin_host_header: str + :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default + value is false. If compression is enabled, content will be served as compressed if user + requests for a compressed version. Content won't be compressed on CDN when requested content is + smaller than 1 byte or larger than 1 MB. + :type is_compression_enabled: bool + :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_http_allowed: bool + :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_https_allowed: bool + :param query_string_caching_behavior: Defines how CDN caches requests that include query + strings. You can ignore any query strings when caching, bypass caching to prevent requests that + contain query strings from being cached, or cache every request with a unique URL. Possible + values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to + optimize for, e.g. Download, Media services. With this information, CDN can apply scenario + driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", + "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the + dynamic content and calculate the most optimal routes for the CDN. This is relative to the + origin path. This property is only relevant when using a single origin. + :type probe_path: str + :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each + geo filter defines an access rule to a specified path or content, e.g. block APAC for path + /pictures/. + :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param default_origin_group: A reference to the origin group. + :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param url_signing_keys: List of keys used to validate the signed URL hashes. + :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] + :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. + :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy + :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for + the endpoint (if applicable). + :type web_application_firewall_policy_link: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + """ + + _attribute_map = { + 'origin_path': {'key': 'originPath', 'type': 'str'}, + 'content_types_to_compress': {'key': 'contentTypesToCompress', 'type': '[str]'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'is_compression_enabled': {'key': 'isCompressionEnabled', 'type': 'bool'}, + 'is_http_allowed': {'key': 'isHttpAllowed', 'type': 'bool'}, + 'is_https_allowed': {'key': 'isHttpsAllowed', 'type': 'bool'}, + 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, + 'probe_path': {'key': 'probePath', 'type': 'str'}, + 'geo_filters': {'key': 'geoFilters', 'type': '[GeoFilter]'}, + 'default_origin_group': {'key': 'defaultOriginGroup', 'type': 'ResourceReference'}, + 'url_signing_keys': {'key': 'urlSigningKeys', 'type': '[UrlSigningKey]'}, + 'delivery_policy': {'key': 'deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, + 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + } + + def __init__( + self, + *, + origin_path: Optional[str] = None, + content_types_to_compress: Optional[List[str]] = None, + origin_host_header: Optional[str] = None, + is_compression_enabled: Optional[bool] = None, + is_http_allowed: Optional[bool] = None, + is_https_allowed: Optional[bool] = None, + query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, + optimization_type: Optional[Union[str, "OptimizationType"]] = None, + probe_path: Optional[str] = None, + geo_filters: Optional[List["GeoFilter"]] = None, + default_origin_group: Optional["ResourceReference"] = None, + url_signing_keys: Optional[List["UrlSigningKey"]] = None, + delivery_policy: Optional["EndpointPropertiesUpdateParametersDeliveryPolicy"] = None, + web_application_firewall_policy_link: Optional["EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"] = None, + **kwargs + ): + super(EndpointPropertiesUpdateParameters, self).__init__(**kwargs) + self.origin_path = origin_path + self.content_types_to_compress = content_types_to_compress + self.origin_host_header = origin_host_header + self.is_compression_enabled = is_compression_enabled + self.is_http_allowed = is_http_allowed + self.is_https_allowed = is_https_allowed + self.query_string_caching_behavior = query_string_caching_behavior + self.optimization_type = optimization_type + self.probe_path = probe_path + self.geo_filters = geo_filters + self.default_origin_group = default_origin_group + self.url_signing_keys = url_signing_keys + self.delivery_policy = delivery_policy + self.web_application_firewall_policy_link = web_application_firewall_policy_link + + +class EndpointProperties(EndpointPropertiesUpdateParameters): + """The JSON object that contains the properties required to create an endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param origin_path: A directory path on the origin that CDN can use to retrieve content from, + e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param content_types_to_compress: List of content types on which compression applies. The value + should be a valid MIME type. + :type content_types_to_compress: list[str] + :param origin_host_header: The host header value sent to the origin with each request. This + property at Endpoint is only allowed when endpoint uses single origin and can be overridden by + the same property specified at origin.If you leave this blank, the request hostname determines + this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this + host header value to match the origin hostname by default. + :type origin_host_header: str + :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default + value is false. If compression is enabled, content will be served as compressed if user + requests for a compressed version. Content won't be compressed on CDN when requested content is + smaller than 1 byte or larger than 1 MB. + :type is_compression_enabled: bool + :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_http_allowed: bool + :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_https_allowed: bool + :param query_string_caching_behavior: Defines how CDN caches requests that include query + strings. You can ignore any query strings when caching, bypass caching to prevent requests that + contain query strings from being cached, or cache every request with a unique URL. Possible + values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to + optimize for, e.g. Download, Media services. With this information, CDN can apply scenario + driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", + "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the + dynamic content and calculate the most optimal routes for the CDN. This is relative to the + origin path. This property is only relevant when using a single origin. + :type probe_path: str + :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each + geo filter defines an access rule to a specified path or content, e.g. block APAC for path + /pictures/. + :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param default_origin_group: A reference to the origin group. + :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param url_signing_keys: List of keys used to validate the signed URL hashes. + :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] + :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. + :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy + :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for + the endpoint (if applicable). + :type web_application_firewall_policy_link: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. + contoso.azureedge.net. + :vartype host_name: str + :param origins: Required. The source of the content being delivered via CDN. + :type origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin] + :param origin_groups: The origin groups comprising of origins that are used for load balancing + the traffic based on availability. + :type origin_groups: list[~azure.mgmt.cdn.models.DeepCreatedOriginGroup] + :ivar resource_state: Resource status of the endpoint. Possible values include: "Creating", + "Deleting", "Running", "Starting", "Stopped", "Stopping". + :vartype resource_state: str or ~azure.mgmt.cdn.models.EndpointResourceState + :ivar provisioning_state: Provisioning status of the endpoint. + :vartype provisioning_state: str + """ + + _validation = { + 'host_name': {'readonly': True}, + 'origins': {'required': True}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'origin_path': {'key': 'originPath', 'type': 'str'}, + 'content_types_to_compress': {'key': 'contentTypesToCompress', 'type': '[str]'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'is_compression_enabled': {'key': 'isCompressionEnabled', 'type': 'bool'}, + 'is_http_allowed': {'key': 'isHttpAllowed', 'type': 'bool'}, + 'is_https_allowed': {'key': 'isHttpsAllowed', 'type': 'bool'}, + 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, + 'probe_path': {'key': 'probePath', 'type': 'str'}, + 'geo_filters': {'key': 'geoFilters', 'type': '[GeoFilter]'}, + 'default_origin_group': {'key': 'defaultOriginGroup', 'type': 'ResourceReference'}, + 'url_signing_keys': {'key': 'urlSigningKeys', 'type': '[UrlSigningKey]'}, + 'delivery_policy': {'key': 'deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, + 'web_application_firewall_policy_link': {'key': 'webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'origins': {'key': 'origins', 'type': '[DeepCreatedOrigin]'}, + 'origin_groups': {'key': 'originGroups', 'type': '[DeepCreatedOriginGroup]'}, + 'resource_state': {'key': 'resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + origins: List["DeepCreatedOrigin"], + origin_path: Optional[str] = None, + content_types_to_compress: Optional[List[str]] = None, + origin_host_header: Optional[str] = None, + is_compression_enabled: Optional[bool] = None, + is_http_allowed: Optional[bool] = None, + is_https_allowed: Optional[bool] = None, + query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, + optimization_type: Optional[Union[str, "OptimizationType"]] = None, + probe_path: Optional[str] = None, + geo_filters: Optional[List["GeoFilter"]] = None, + default_origin_group: Optional["ResourceReference"] = None, + url_signing_keys: Optional[List["UrlSigningKey"]] = None, + delivery_policy: Optional["EndpointPropertiesUpdateParametersDeliveryPolicy"] = None, + web_application_firewall_policy_link: Optional["EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"] = None, + origin_groups: Optional[List["DeepCreatedOriginGroup"]] = None, + **kwargs + ): + super(EndpointProperties, self).__init__(origin_path=origin_path, content_types_to_compress=content_types_to_compress, origin_host_header=origin_host_header, is_compression_enabled=is_compression_enabled, is_http_allowed=is_http_allowed, is_https_allowed=is_https_allowed, query_string_caching_behavior=query_string_caching_behavior, optimization_type=optimization_type, probe_path=probe_path, geo_filters=geo_filters, default_origin_group=default_origin_group, url_signing_keys=url_signing_keys, delivery_policy=delivery_policy, web_application_firewall_policy_link=web_application_firewall_policy_link, **kwargs) + self.host_name = None + self.origins = origins + self.origin_groups = origin_groups + self.resource_state = None + self.provisioning_state = None + + +class EndpointPropertiesUpdateParametersDeliveryPolicy(msrest.serialization.Model): + """A policy that specifies the delivery rules to be used for an endpoint. + + All required parameters must be populated in order to send to Azure. + + :param description: User-friendly description of the policy. + :type description: str + :param rules: Required. A list of the delivery rules. + :type rules: list[~azure.mgmt.cdn.models.DeliveryRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[DeliveryRule]'}, + } + + def __init__( + self, + *, + rules: List["DeliveryRule"], + description: Optional[str] = None, + **kwargs + ): + super(EndpointPropertiesUpdateParametersDeliveryPolicy, self).__init__(**kwargs) + self.description = description + self.rules = rules + + +class EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink(msrest.serialization.Model): + """Defines the Web Application Firewall policy for the endpoint (if applicable). + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink, self).__init__(**kwargs) + self.id = id + + +class EndpointUpdateParameters(msrest.serialization.Model): + """Properties required to create or update an endpoint. + + :param tags: A set of tags. Endpoint tags. + :type tags: dict[str, str] + :param origin_path: A directory path on the origin that CDN can use to retrieve content from, + e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param content_types_to_compress: List of content types on which compression applies. The value + should be a valid MIME type. + :type content_types_to_compress: list[str] + :param origin_host_header: The host header value sent to the origin with each request. This + property at Endpoint is only allowed when endpoint uses single origin and can be overridden by + the same property specified at origin.If you leave this blank, the request hostname determines + this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this + host header value to match the origin hostname by default. + :type origin_host_header: str + :param is_compression_enabled: Indicates whether content compression is enabled on CDN. Default + value is false. If compression is enabled, content will be served as compressed if user + requests for a compressed version. Content won't be compressed on CDN when requested content is + smaller than 1 byte or larger than 1 MB. + :type is_compression_enabled: bool + :param is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_http_allowed: bool + :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default + value is true. At least one protocol (HTTP or HTTPS) must be allowed. + :type is_https_allowed: bool + :param query_string_caching_behavior: Defines how CDN caches requests that include query + strings. You can ignore any query strings when caching, bypass caching to prevent requests that + contain query strings from being cached, or cache every request with a unique URL. Possible + values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this CDN endpoint to + optimize for, e.g. Download, Media services. With this information, CDN can apply scenario + driven optimization. Possible values include: "GeneralWebDelivery", "GeneralMediaStreaming", + "VideoOnDemandMediaStreaming", "LargeFileDownload", "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param probe_path: Path to a file hosted on the origin which helps accelerate delivery of the + dynamic content and calculate the most optimal routes for the CDN. This is relative to the + origin path. This property is only relevant when using a single origin. + :type probe_path: str + :param geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each + geo filter defines an access rule to a specified path or content, e.g. block APAC for path + /pictures/. + :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param default_origin_group: A reference to the origin group. + :type default_origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param url_signing_keys: List of keys used to validate the signed URL hashes. + :type url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey] + :param delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. + :type delivery_policy: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy + :param web_application_firewall_policy_link: Defines the Web Application Firewall policy for + the endpoint (if applicable). + :type web_application_firewall_policy_link: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, + 'content_types_to_compress': {'key': 'properties.contentTypesToCompress', 'type': '[str]'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'is_compression_enabled': {'key': 'properties.isCompressionEnabled', 'type': 'bool'}, + 'is_http_allowed': {'key': 'properties.isHttpAllowed', 'type': 'bool'}, + 'is_https_allowed': {'key': 'properties.isHttpsAllowed', 'type': 'bool'}, + 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, + 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, + 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, + 'default_origin_group': {'key': 'properties.defaultOriginGroup', 'type': 'ResourceReference'}, + 'url_signing_keys': {'key': 'properties.urlSigningKeys', 'type': '[UrlSigningKey]'}, + 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, + 'web_application_firewall_policy_link': {'key': 'properties.webApplicationFirewallPolicyLink', 'type': 'EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + origin_path: Optional[str] = None, + content_types_to_compress: Optional[List[str]] = None, + origin_host_header: Optional[str] = None, + is_compression_enabled: Optional[bool] = None, + is_http_allowed: Optional[bool] = None, + is_https_allowed: Optional[bool] = None, + query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, + optimization_type: Optional[Union[str, "OptimizationType"]] = None, + probe_path: Optional[str] = None, + geo_filters: Optional[List["GeoFilter"]] = None, + default_origin_group: Optional["ResourceReference"] = None, + url_signing_keys: Optional[List["UrlSigningKey"]] = None, + delivery_policy: Optional["EndpointPropertiesUpdateParametersDeliveryPolicy"] = None, + web_application_firewall_policy_link: Optional["EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"] = None, + **kwargs + ): + super(EndpointUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.origin_path = origin_path + self.content_types_to_compress = content_types_to_compress + self.origin_host_header = origin_host_header + self.is_compression_enabled = is_compression_enabled + self.is_http_allowed = is_http_allowed + self.is_https_allowed = is_https_allowed + self.query_string_caching_behavior = query_string_caching_behavior + self.optimization_type = optimization_type + self.probe_path = probe_path + self.geo_filters = geo_filters + self.default_origin_group = default_origin_group + self.url_signing_keys = url_signing_keys + self.delivery_policy = delivery_policy + self.web_application_firewall_policy_link = web_application_firewall_policy_link + + +class ErrorResponse(msrest.serialization.Model): + """Error response indicates CDN service is not able to process the incoming request. The reason is provided in the error message. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + + +class GeoFilter(msrest.serialization.Model): + """Rules defining user's geo access within a CDN endpoint. + + All required parameters must be populated in order to send to Azure. + + :param relative_path: Required. Relative path applicable to geo filter. (e.g. '/mypictures', + '/mypicture/kitty.jpg', and etc.). + :type relative_path: str + :param action: Required. Action of the geo filter, i.e. allow or block access. Possible values + include: "Block", "Allow". + :type action: str or ~azure.mgmt.cdn.models.GeoFilterActions + :param country_codes: Required. Two letter country codes defining user country access in a geo + filter, e.g. AU, MX, US. + :type country_codes: list[str] + """ + + _validation = { + 'relative_path': {'required': True}, + 'action': {'required': True}, + 'country_codes': {'required': True}, + } + + _attribute_map = { + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'country_codes': {'key': 'countryCodes', 'type': '[str]'}, + } + + def __init__( + self, + *, + relative_path: str, + action: Union[str, "GeoFilterActions"], + country_codes: List[str], + **kwargs + ): + super(GeoFilter, self).__init__(**kwargs) + self.relative_path = relative_path + self.action = action + self.country_codes = country_codes + + +class HeaderActionParameters(msrest.serialization.Model): + """Defines the parameters for the request header action. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters". + :vartype odata_type: str + :param header_action: Required. Action to perform. Possible values include: "Append", + "Overwrite", "Delete". + :type header_action: str or ~azure.mgmt.cdn.models.HeaderAction + :param header_name: Required. Name of the header to modify. + :type header_name: str + :param value: Value for the specified action. + :type value: str + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'header_action': {'required': True}, + 'header_name': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'header_action': {'key': 'headerAction', 'type': 'str'}, + 'header_name': {'key': 'headerName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters" + + def __init__( + self, + *, + header_action: Union[str, "HeaderAction"], + header_name: str, + value: Optional[str] = None, + **kwargs + ): + super(HeaderActionParameters, self).__init__(**kwargs) + self.header_action = header_action + self.header_name = header_name + self.value = value + + +class HealthProbeParameters(msrest.serialization.Model): + """The JSON object that contains the properties to send health probes to origin. + + :param probe_path: The path relative to the origin that is used to determine the health of the + origin. + :type probe_path: str + :param probe_request_type: The type of health probe request that is made. Possible values + include: "NotSet", "GET", "HEAD". + :type probe_request_type: str or ~azure.mgmt.cdn.models.HealthProbeRequestType + :param probe_protocol: Protocol to use for health probe. Possible values include: "NotSet", + "Http", "Https". + :type probe_protocol: str or ~azure.mgmt.cdn.models.ProbeProtocol + :param probe_interval_in_seconds: The number of seconds between health probes.Default is + 240sec. + :type probe_interval_in_seconds: int + """ + + _validation = { + 'probe_interval_in_seconds': {'maximum': 255, 'minimum': 1}, + } + + _attribute_map = { + 'probe_path': {'key': 'probePath', 'type': 'str'}, + 'probe_request_type': {'key': 'probeRequestType', 'type': 'str'}, + 'probe_protocol': {'key': 'probeProtocol', 'type': 'str'}, + 'probe_interval_in_seconds': {'key': 'probeIntervalInSeconds', 'type': 'int'}, + } + + def __init__( + self, + *, + probe_path: Optional[str] = None, + probe_request_type: Optional[Union[str, "HealthProbeRequestType"]] = None, + probe_protocol: Optional[Union[str, "ProbeProtocol"]] = None, + probe_interval_in_seconds: Optional[int] = None, + **kwargs + ): + super(HealthProbeParameters, self).__init__(**kwargs) + self.probe_path = probe_path + self.probe_request_type = probe_request_type + self.probe_protocol = probe_protocol + self.probe_interval_in_seconds = probe_interval_in_seconds + + +class HttpErrorRangeParameters(msrest.serialization.Model): + """The JSON object that represents the range for http status codes. + + :param begin: The inclusive start of the http status code range. + :type begin: int + :param end: The inclusive end of the http status code range. + :type end: int + """ + + _validation = { + 'begin': {'maximum': 999, 'minimum': 100}, + 'end': {'maximum': 999, 'minimum': 100}, + } + + _attribute_map = { + 'begin': {'key': 'begin', 'type': 'int'}, + 'end': {'key': 'end', 'type': 'int'}, + } + + def __init__( + self, + *, + begin: Optional[int] = None, + end: Optional[int] = None, + **kwargs + ): + super(HttpErrorRangeParameters, self).__init__(**kwargs) + self.begin = begin + self.end = end + + +class HttpVersionMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for HttpVersion match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Equal". + :type operator: str or ~azure.mgmt.cdn.models.HttpVersionOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHttpVersionConditionParameters" + + def __init__( + self, + *, + operator: Union[str, "HttpVersionOperator"], + negate_condition: Optional[bool] = None, + match_values: Optional[List[str]] = None, + **kwargs + ): + super(HttpVersionMatchConditionParameters, self).__init__(**kwargs) + self.operator = operator + self.negate_condition = negate_condition + self.match_values = match_values + + +class IpAddressGroup(msrest.serialization.Model): + """CDN Ip address group. + + :param delivery_region: The delivery region of the ip address group. + :type delivery_region: str + :param ipv4_addresses: The list of ip v4 addresses. + :type ipv4_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress] + :param ipv6_addresses: The list of ip v6 addresses. + :type ipv6_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress] + """ + + _attribute_map = { + 'delivery_region': {'key': 'deliveryRegion', 'type': 'str'}, + 'ipv4_addresses': {'key': 'ipv4Addresses', 'type': '[CidrIpAddress]'}, + 'ipv6_addresses': {'key': 'ipv6Addresses', 'type': '[CidrIpAddress]'}, + } + + def __init__( + self, + *, + delivery_region: Optional[str] = None, + ipv4_addresses: Optional[List["CidrIpAddress"]] = None, + ipv6_addresses: Optional[List["CidrIpAddress"]] = None, + **kwargs + ): + super(IpAddressGroup, self).__init__(**kwargs) + self.delivery_region = delivery_region + self.ipv4_addresses = ipv4_addresses + self.ipv6_addresses = ipv6_addresses + + +class IsDeviceMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for IsDevice match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Equal". + :type operator: str or ~azure.mgmt.cdn.models.IsDeviceOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str or + ~azure.mgmt.cdn.models.IsDeviceMatchConditionParametersMatchValuesItem] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleIsDeviceConditionParameters" + + def __init__( + self, + *, + operator: Union[str, "IsDeviceOperator"], + negate_condition: Optional[bool] = None, + match_values: Optional[List[Union[str, "IsDeviceMatchConditionParametersMatchValuesItem"]]] = None, + transforms: Optional[List[Union[str, "Transform"]]] = None, + **kwargs + ): + super(IsDeviceMatchConditionParameters, self).__init__(**kwargs) + self.operator = operator + self.negate_condition = negate_condition + self.match_values = match_values + self.transforms = transforms + + +class KeyVaultCertificateSourceParameters(msrest.serialization.Model): + """Describes the parameters for using a user's KeyVault certificate for securing custom domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters". + :vartype odata_type: str + :param subscription_id: Required. Subscription Id of the user's Key Vault containing the SSL + certificate. + :type subscription_id: str + :param resource_group_name: Required. Resource group of the user's Key Vault containing the SSL + certificate. + :type resource_group_name: str + :param vault_name: Required. The name of the user's Key Vault containing the SSL certificate. + :type vault_name: str + :param secret_name: Required. The name of Key Vault Secret (representing the full certificate + PFX) in Key Vault. + :type secret_name: str + :param secret_version: The version(GUID) of Key Vault Secret in Key Vault. + :type secret_version: str + :param update_rule: Required. Describes the action that shall be taken when the certificate is + updated in Key Vault. Possible values include: "NoAction". + :type update_rule: str or ~azure.mgmt.cdn.models.UpdateRule + :param delete_rule: Required. Describes the action that shall be taken when the certificate is + removed from Key Vault. Possible values include: "NoAction". + :type delete_rule: str or ~azure.mgmt.cdn.models.DeleteRule + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'vault_name': {'required': True}, + 'secret_name': {'required': True}, + 'update_rule': {'required': True}, + 'delete_rule': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'vault_name': {'key': 'vaultName', 'type': 'str'}, + 'secret_name': {'key': 'secretName', 'type': 'str'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + 'update_rule': {'key': 'updateRule', 'type': 'str'}, + 'delete_rule': {'key': 'deleteRule', 'type': 'str'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters" + + def __init__( + self, + *, + subscription_id: str, + resource_group_name: str, + vault_name: str, + secret_name: str, + update_rule: Union[str, "UpdateRule"], + delete_rule: Union[str, "DeleteRule"], + secret_version: Optional[str] = None, + **kwargs + ): + super(KeyVaultCertificateSourceParameters, self).__init__(**kwargs) + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.vault_name = vault_name + self.secret_name = secret_name + self.secret_version = secret_version + self.update_rule = update_rule + self.delete_rule = delete_rule + + +class KeyVaultSigningKeyParameters(msrest.serialization.Model): + """Describes the parameters for using a user's KeyVault for URL Signing Key. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters". + :vartype odata_type: str + :param subscription_id: Required. Subscription Id of the user's Key Vault containing the + secret. + :type subscription_id: str + :param resource_group_name: Required. Resource group of the user's Key Vault containing the + secret. + :type resource_group_name: str + :param vault_name: Required. The name of the user's Key Vault containing the secret. + :type vault_name: str + :param secret_name: Required. The name of secret in Key Vault. + :type secret_name: str + :param secret_version: Required. The version(GUID) of secret in Key Vault. + :type secret_version: str + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'vault_name': {'required': True}, + 'secret_name': {'required': True}, + 'secret_version': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'vault_name': {'key': 'vaultName', 'type': 'str'}, + 'secret_name': {'key': 'secretName', 'type': 'str'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters" + + def __init__( + self, + *, + subscription_id: str, + resource_group_name: str, + vault_name: str, + secret_name: str, + secret_version: str, + **kwargs + ): + super(KeyVaultSigningKeyParameters, self).__init__(**kwargs) + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.vault_name = vault_name + self.secret_name = secret_name + self.secret_version = secret_version + + +class LoadBalancingSettingsParameters(msrest.serialization.Model): + """Round-Robin load balancing settings for a backend pool. + + :param sample_size: The number of samples to consider for load balancing decisions. + :type sample_size: int + :param successful_samples_required: The number of samples within the sample period that must + succeed. + :type successful_samples_required: int + :param additional_latency_in_milliseconds: The additional latency in milliseconds for probes to + fall into the lowest latency bucket. + :type additional_latency_in_milliseconds: int + """ + + _attribute_map = { + 'sample_size': {'key': 'sampleSize', 'type': 'int'}, + 'successful_samples_required': {'key': 'successfulSamplesRequired', 'type': 'int'}, + 'additional_latency_in_milliseconds': {'key': 'additionalLatencyInMilliseconds', 'type': 'int'}, + } + + def __init__( + self, + *, + sample_size: Optional[int] = None, + successful_samples_required: Optional[int] = None, + additional_latency_in_milliseconds: Optional[int] = None, + **kwargs + ): + super(LoadBalancingSettingsParameters, self).__init__(**kwargs) + self.sample_size = sample_size + self.successful_samples_required = successful_samples_required + self.additional_latency_in_milliseconds = additional_latency_in_milliseconds + + +class LoadParameters(msrest.serialization.Model): + """Parameters required for content load. + + All required parameters must be populated in order to send to Azure. + + :param content_paths: Required. The path to the content to be loaded. Path should be a relative + file URL of the origin. + :type content_paths: list[str] + """ + + _validation = { + 'content_paths': {'required': True}, + } + + _attribute_map = { + 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + } + + def __init__( + self, + *, + content_paths: List[str], + **kwargs + ): + super(LoadParameters, self).__init__(**kwargs) + self.content_paths = content_paths + + +class ManagedCertificate(Certificate): + """Managed Certificate used for https. + + :param subject: Subject name in the certificate. + :type subject: str + :param expiration_date: Certificate expiration date. + :type expiration_date: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str + """ + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + } + + def __init__( + self, + *, + subject: Optional[str] = None, + expiration_date: Optional[str] = None, + thumbprint: Optional[str] = None, + **kwargs + ): + super(ManagedCertificate, self).__init__(subject=subject, expiration_date=expiration_date, thumbprint=thumbprint, **kwargs) + + +class ManagedCertificateParameters(SecretParameters, Certificate): + """Managed Certificate used for https. + + All required parameters must be populated in order to send to Azure. + + :param subject: Subject name in the certificate. + :type subject: str + :param expiration_date: Certificate expiration date. + :type expiration_date: str + :param thumbprint: Certificate thumbprint. + :type thumbprint: str + :param type: Required. The type of the Secret to create.Constant filled by server. Possible + values include: "UrlSigningKey", "CustomerCertificate", "ManagedCertificate". + :type type: str or ~azure.mgmt.cdn.models.SecretType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + subject: Optional[str] = None, + expiration_date: Optional[str] = None, + thumbprint: Optional[str] = None, + **kwargs + ): + super(ManagedCertificateParameters, self).__init__(subject=subject, expiration_date=expiration_date, thumbprint=thumbprint, **kwargs) + self.subject = subject + self.expiration_date = expiration_date + self.thumbprint = thumbprint + self.type = 'ManagedCertificate' # type: str + self.type = 'ManagedCertificate' # type: str + + +class ManagedRuleDefinition(msrest.serialization.Model): + """Describes a managed rule definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar rule_id: Identifier for the managed rule. + :vartype rule_id: str + :ivar description: Describes the functionality of the managed rule. + :vartype description: str + """ + + _validation = { + 'rule_id': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleDefinition, self).__init__(**kwargs) + self.rule_id = None + self.description = None + + +class ManagedRuleGroupDefinition(msrest.serialization.Model): + """Describes a managed rule group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar rule_group_name: Name of the managed rule group. + :vartype rule_group_name: str + :ivar description: Description of the managed rule group. + :vartype description: str + :ivar rules: List of rules within the managed rule group. + :vartype rules: list[~azure.mgmt.cdn.models.ManagedRuleDefinition] + """ + + _validation = { + 'rule_group_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rules': {'readonly': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ManagedRuleDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleGroupDefinition, self).__init__(**kwargs) + self.rule_group_name = None + self.description = None + self.rules = None + + +class ManagedRuleGroupOverride(msrest.serialization.Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. Describes the managed rule group within the rule set to + override. + :type rule_group_name: str + :param rules: List of rules that will be disabled. If none specified, all rules in the group + will be disabled. + :type rules: list[~azure.mgmt.cdn.models.ManagedRuleOverride] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ManagedRuleOverride]'}, + } + + def __init__( + self, + *, + rule_group_name: str, + rules: Optional[List["ManagedRuleOverride"]] = None, + **kwargs + ): + super(ManagedRuleGroupOverride, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules + + +class ManagedRuleOverride(msrest.serialization.Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. Identifier for the managed rule. + :type rule_id: str + :param enabled_state: Describes if the managed rule is in enabled or disabled state. Defaults + to Disabled if not specified. Possible values include: "Disabled", "Enabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.ManagedRuleEnabledState + :param action: Describes the override action to be applied when rule matches. Possible values + include: "Allow", "Block", "Log", "Redirect". + :type action: str or ~azure.mgmt.cdn.models.ActionType + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + *, + rule_id: str, + enabled_state: Optional[Union[str, "ManagedRuleEnabledState"]] = None, + action: Optional[Union[str, "ActionType"]] = None, + **kwargs + ): + super(ManagedRuleOverride, self).__init__(**kwargs) + self.rule_id = rule_id + self.enabled_state = enabled_state + self.action = action + + +class ManagedRuleSet(msrest.serialization.Model): + """Defines a managed rule set. + + All required parameters must be populated in order to send to Azure. + + :param rule_set_type: Required. Defines the rule set type to use. + :type rule_set_type: str + :param rule_set_version: Required. Defines the version of the rule set to use. + :type rule_set_version: str + :param anomaly_score: Verizon only : If the rule set supports anomaly detection mode, this + describes the threshold for blocking requests. + :type anomaly_score: int + :param rule_group_overrides: Defines the rule overrides to apply to the rule set. + :type rule_group_overrides: list[~azure.mgmt.cdn.models.ManagedRuleGroupOverride] + """ + + _validation = { + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'anomaly_score': {'maximum': 20, 'minimum': 0}, + } + + _attribute_map = { + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'anomaly_score': {'key': 'anomalyScore', 'type': 'int'}, + 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[ManagedRuleGroupOverride]'}, + } + + def __init__( + self, + *, + rule_set_type: str, + rule_set_version: str, + anomaly_score: Optional[int] = None, + rule_group_overrides: Optional[List["ManagedRuleGroupOverride"]] = None, + **kwargs + ): + super(ManagedRuleSet, self).__init__(**kwargs) + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.anomaly_score = anomaly_score + self.rule_group_overrides = rule_group_overrides + + +class ManagedRuleSetDefinition(Resource): + """Describes a managed rule set definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param sku: The pricing tier (defines a CDN provider, feature list and rate) of the + CdnWebApplicationFirewallPolicy. + :type sku: ~azure.mgmt.cdn.models.Sku + :ivar provisioning_state: Provisioning state of the managed rule set. + :vartype provisioning_state: str + :ivar rule_set_type: Type of the managed rule set. + :vartype rule_set_type: str + :ivar rule_set_version: Version of the managed rule set type. + :vartype rule_set_version: str + :ivar rule_groups: Rule groups of the managed rule set. + :vartype rule_groups: list[~azure.mgmt.cdn.models.ManagedRuleGroupDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'rule_set_type': {'readonly': True}, + 'rule_set_version': {'readonly': True}, + 'rule_groups': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ManagedRuleGroupDefinition]'}, + } + + def __init__( + self, + *, + sku: Optional["Sku"] = None, + **kwargs + ): + super(ManagedRuleSetDefinition, self).__init__(**kwargs) + self.sku = sku + self.provisioning_state = None + self.rule_set_type = None + self.rule_set_version = None + self.rule_groups = None + + +class ManagedRuleSetDefinitionList(msrest.serialization.Model): + """List of managed rule set definitions available for use in a policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of managed rule set definitions. + :vartype value: list[~azure.mgmt.cdn.models.ManagedRuleSetDefinition] + :param next_link: URL to retrieve next set of managed rule set definitions. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagedRuleSetDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(ManagedRuleSetDefinitionList, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class ManagedRuleSetList(msrest.serialization.Model): + """Defines the list of managed rule sets for the policy. + + :param managed_rule_sets: List of rule sets. + :type managed_rule_sets: list[~azure.mgmt.cdn.models.ManagedRuleSet] + """ + + _attribute_map = { + 'managed_rule_sets': {'key': 'managedRuleSets', 'type': '[ManagedRuleSet]'}, + } + + def __init__( + self, + *, + managed_rule_sets: Optional[List["ManagedRuleSet"]] = None, + **kwargs + ): + super(ManagedRuleSetList, self).__init__(**kwargs) + self.managed_rule_sets = managed_rule_sets + + +class MatchCondition(msrest.serialization.Model): + """Define match conditions. + + All required parameters must be populated in order to send to Azure. + + :param match_variable: Required. Match variable to compare against. Possible values include: + "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", "RequestUri", "RequestHeader", + "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", "UrlFileName", "HttpVersion", + "Cookies", "IsDevice", "RemoteAddr", "SocketAddr". + :type match_variable: str or ~azure.mgmt.cdn.models.MatchVariable + :param selector: Selector can used to match a specific key for QueryString, Cookies, + RequestHeader or PostArgs. + :type selector: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "IPMatch", "GeoMatch", "Equal", "Contains", "LessThan", "GreaterThan", "LessThanOrEqual", + "GreaterThanOrEqual", "BeginsWith", "EndsWith", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.Operator + :param negate_condition: Describes if the result of this condition should be negated. + :type negate_condition: bool + :param match_value: Required. List of possible match values. + :type match_value: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.TransformType] + """ + + _validation = { + 'match_variable': {'required': True}, + 'operator': {'required': True}, + 'match_value': {'required': True}, + } + + _attribute_map = { + 'match_variable': {'key': 'matchVariable', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_value': {'key': 'matchValue', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + def __init__( + self, + *, + match_variable: Union[str, "MatchVariable"], + operator: Union[str, "Operator"], + match_value: List[str], + selector: Optional[str] = None, + negate_condition: Optional[bool] = None, + transforms: Optional[List[Union[str, "TransformType"]]] = None, + **kwargs + ): + super(MatchCondition, self).__init__(**kwargs) + self.match_variable = match_variable + self.selector = selector + self.operator = operator + self.negate_condition = negate_condition + self.match_value = match_value + self.transforms = transforms + + +class MetricsResponse(msrest.serialization.Model): + """Metrics Response. + + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param granularity: Possible values include: "PT5M", "PT1H", "P1D". + :type granularity: str or ~azure.mgmt.cdn.models.MetricsResponseGranularity + :param series: + :type series: list[~azure.mgmt.cdn.models.MetricsResponseSeriesItem] + """ + + _attribute_map = { + 'date_time_begin': {'key': 'dateTimeBegin', 'type': 'iso-8601'}, + 'date_time_end': {'key': 'dateTimeEnd', 'type': 'iso-8601'}, + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'series': {'key': 'series', 'type': '[MetricsResponseSeriesItem]'}, + } + + def __init__( + self, + *, + date_time_begin: Optional[datetime.datetime] = None, + date_time_end: Optional[datetime.datetime] = None, + granularity: Optional[Union[str, "MetricsResponseGranularity"]] = None, + series: Optional[List["MetricsResponseSeriesItem"]] = None, + **kwargs + ): + super(MetricsResponse, self).__init__(**kwargs) + self.date_time_begin = date_time_begin + self.date_time_end = date_time_end + self.granularity = granularity + self.series = series + + +class MetricsResponseSeriesItem(msrest.serialization.Model): + """MetricsResponseSeriesItem. + + :param metric: + :type metric: str + :param unit: Possible values include: "count", "bytes", "bitsPerSecond". + :type unit: str or ~azure.mgmt.cdn.models.MetricsResponseSeriesItemUnit + :param groups: + :type groups: list[~azure.mgmt.cdn.models.MetricsResponseSeriesPropertiesItemsItem] + :param data: + :type data: + list[~azure.mgmt.cdn.models.Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems] + """ + + _attribute_map = { + 'metric': {'key': 'metric', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[MetricsResponseSeriesPropertiesItemsItem]'}, + 'data': {'key': 'data', 'type': '[Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems]'}, + } + + def __init__( + self, + *, + metric: Optional[str] = None, + unit: Optional[Union[str, "MetricsResponseSeriesItemUnit"]] = None, + groups: Optional[List["MetricsResponseSeriesPropertiesItemsItem"]] = None, + data: Optional[List["Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems"]] = None, + **kwargs + ): + super(MetricsResponseSeriesItem, self).__init__(**kwargs) + self.metric = metric + self.unit = unit + self.groups = groups + self.data = data + + +class MetricsResponseSeriesPropertiesItemsItem(msrest.serialization.Model): + """MetricsResponseSeriesPropertiesItemsItem. + + :param name: + :type name: str + :param value: + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(MetricsResponseSeriesPropertiesItemsItem, self).__init__(**kwargs) + self.name = name + self.value = value + + +class Operation(msrest.serialization.Model): + """CDN REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.cdn.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + *, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Service provider: Microsoft.Cdn. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Profile, endpoint, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class OperationsListResult(msrest.serialization.Model): + """Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of CDN operations supported by the CDN resource provider. + :vartype value: list[~azure.mgmt.cdn.models.Operation] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class Origin(ProxyResource): + """CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the configured origins. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param enabled: Origin is enabled for load balancing or not. + :type enabled: bool + :param private_link_alias: The Alias of the Private Link resource. Populating this optional + field indicates that this origin 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 + :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 + :ivar resource_state: Resource status of the origin. Possible values include: "Creating", + "Active", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState + :ivar provisioning_state: Provisioning status of the origin. + :vartype provisioning_state: 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.cdn.models.PrivateEndpointStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'weight': {'key': 'properties.weight', 'type': 'int'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, + 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_status': {'key': 'properties.privateEndpointStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_name: Optional[str] = None, + http_port: Optional[int] = None, + https_port: Optional[int] = None, + origin_host_header: Optional[str] = None, + priority: Optional[int] = None, + weight: Optional[int] = None, + enabled: Optional[bool] = None, + private_link_alias: Optional[str] = None, + private_link_resource_id: Optional[str] = None, + private_link_location: Optional[str] = None, + private_link_approval_message: Optional[str] = None, + **kwargs + ): + super(Origin, self).__init__(**kwargs) + self.host_name = host_name + self.http_port = http_port + self.https_port = https_port + self.origin_host_header = origin_host_header + self.priority = priority + self.weight = weight + self.enabled = enabled + 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_link_approval_message = private_link_approval_message + self.resource_state = None + self.provisioning_state = None + self.private_endpoint_status = None + + +class OriginGroup(ProxyResource): + """Origin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param origins: The source of the content being delivered via CDN within given origin group. + :type origins: list[~azure.mgmt.cdn.models.ResourceReference] + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :ivar resource_state: Resource status of the origin group. Possible values include: "Creating", + "Active", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginGroupResourceState + :ivar provisioning_state: Provisioning status of the origin group. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + health_probe_settings: Optional["HealthProbeParameters"] = None, + origins: Optional[List["ResourceReference"]] = None, + traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, + response_based_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + **kwargs + ): + super(OriginGroup, self).__init__(**kwargs) + self.health_probe_settings = health_probe_settings + self.origins = origins + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes + self.response_based_origin_error_detection_settings = response_based_origin_error_detection_settings + self.resource_state = None + self.provisioning_state = None + + +class OriginGroupListResult(msrest.serialization.Model): + """Result of the request to list origin groups. It contains a list of origin groups objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of CDN origin groups within an endpoint. + :vartype value: list[~azure.mgmt.cdn.models.OriginGroup] + :param next_link: URL to get the next set of origin objects if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OriginGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(OriginGroupListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class OriginGroupOverrideAction(DeliveryRuleAction): + """Defines the origin group override action for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the action for the delivery rule.Constant filled by server. + Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.OriginGroupOverrideActionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'OriginGroupOverrideActionParameters'}, + } + + def __init__( + self, + *, + parameters: "OriginGroupOverrideActionParameters", + **kwargs + ): + super(OriginGroupOverrideAction, self).__init__(**kwargs) + self.name = 'OriginGroupOverride' # type: str + self.parameters = parameters + + +class OriginGroupOverrideActionParameters(msrest.serialization.Model): + """Defines the parameters for the origin group override action. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleOriginGroupOverrideActionParameters". + :vartype odata_type: str + :param origin_group: Required. defines the OriginGroup that would override the + DefaultOriginGroup. + :type origin_group: ~azure.mgmt.cdn.models.ResourceReference + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'origin_group': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'origin_group': {'key': 'originGroup', 'type': 'ResourceReference'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleOriginGroupOverrideActionParameters" + + def __init__( + self, + *, + origin_group: "ResourceReference", + **kwargs + ): + super(OriginGroupOverrideActionParameters, self).__init__(**kwargs) + self.origin_group = origin_group + + +class OriginGroupUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the origin group. + + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param origins: The source of the content being delivered via CDN within given origin group. + :type origins: list[~azure.mgmt.cdn.models.ResourceReference] + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + """ + + _validation = { + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + } + + _attribute_map = { + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'origins': {'key': 'origins', 'type': '[ResourceReference]'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_origin_error_detection_settings': {'key': 'responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + } + + def __init__( + self, + *, + health_probe_settings: Optional["HealthProbeParameters"] = None, + origins: Optional[List["ResourceReference"]] = None, + traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, + response_based_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + **kwargs + ): + super(OriginGroupUpdatePropertiesParameters, self).__init__(**kwargs) + self.health_probe_settings = health_probe_settings + self.origins = origins + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes + self.response_based_origin_error_detection_settings = response_based_origin_error_detection_settings + + +class OriginGroupProperties(OriginGroupUpdatePropertiesParameters): + """The JSON object that contains the properties of the origin group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param origins: The source of the content being delivered via CDN within given origin group. + :type origins: list[~azure.mgmt.cdn.models.ResourceReference] + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :ivar resource_state: Resource status of the origin group. Possible values include: "Creating", + "Active", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginGroupResourceState + :ivar provisioning_state: Provisioning status of the origin group. + :vartype provisioning_state: str + """ + + _validation = { + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'origins': {'key': 'origins', 'type': '[ResourceReference]'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_origin_error_detection_settings': {'key': 'responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'resource_state': {'key': 'resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + health_probe_settings: Optional["HealthProbeParameters"] = None, + origins: Optional[List["ResourceReference"]] = None, + traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, + response_based_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + **kwargs + ): + super(OriginGroupProperties, self).__init__(health_probe_settings=health_probe_settings, origins=origins, traffic_restoration_time_to_healed_or_new_endpoints_in_minutes=traffic_restoration_time_to_healed_or_new_endpoints_in_minutes, response_based_origin_error_detection_settings=response_based_origin_error_detection_settings, **kwargs) + self.resource_state = None + self.provisioning_state = None + + +class OriginGroupUpdateParameters(msrest.serialization.Model): + """Origin group properties needed for origin group creation or update. + + :param health_probe_settings: Health probe settings to the origin that is used to determine the + health of the origin. + :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters + :param origins: The source of the content being delivered via CDN within given origin group. + :type origins: list[~azure.mgmt.cdn.models.ResourceReference] + :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift + the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new + endpoint is added. Default is 10 mins. This property is currently not supported. + :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int + :param response_based_origin_error_detection_settings: The JSON object that contains the + properties to determine origin health using real requests/responses. This property is currently + not supported. + :type response_based_origin_error_detection_settings: + ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + """ + + _validation = { + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + } + + _attribute_map = { + 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, + 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, + 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + } + + def __init__( + self, + *, + health_probe_settings: Optional["HealthProbeParameters"] = None, + origins: Optional[List["ResourceReference"]] = None, + traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, + response_based_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + **kwargs + ): + super(OriginGroupUpdateParameters, self).__init__(**kwargs) + self.health_probe_settings = health_probe_settings + self.origins = origins + self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes + self.response_based_origin_error_detection_settings = response_based_origin_error_detection_settings + + +class OriginListResult(msrest.serialization.Model): + """Result of the request to list origins. It contains a list of origin objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of CDN origins within an endpoint. + :vartype value: list[~azure.mgmt.cdn.models.Origin] + :param next_link: URL to get the next set of origin objects if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Origin]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(OriginListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class OriginUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the origin. + + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param enabled: Origin is enabled for load balancing or not. + :type enabled: bool + :param private_link_alias: The Alias of the Private Link resource. Populating this optional + field indicates that this origin 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 + :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 + """ + + _validation = { + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + } + + _attribute_map = { + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'http_port': {'key': 'httpPort', 'type': 'int'}, + 'https_port': {'key': 'httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, + 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + host_name: Optional[str] = None, + http_port: Optional[int] = None, + https_port: Optional[int] = None, + origin_host_header: Optional[str] = None, + priority: Optional[int] = None, + weight: Optional[int] = None, + enabled: Optional[bool] = None, + private_link_alias: Optional[str] = None, + private_link_resource_id: Optional[str] = None, + private_link_location: Optional[str] = None, + private_link_approval_message: Optional[str] = None, + **kwargs + ): + super(OriginUpdatePropertiesParameters, self).__init__(**kwargs) + self.host_name = host_name + self.http_port = http_port + self.https_port = https_port + self.origin_host_header = origin_host_header + self.priority = priority + self.weight = weight + self.enabled = enabled + 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_link_approval_message = private_link_approval_message + + +class OriginProperties(OriginUpdatePropertiesParameters): + """The JSON object that contains the properties of the origin. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param enabled: Origin is enabled for load balancing or not. + :type enabled: bool + :param private_link_alias: The Alias of the Private Link resource. Populating this optional + field indicates that this origin 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 + :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 + :ivar resource_state: Resource status of the origin. Possible values include: "Creating", + "Active", "Deleting". + :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState + :ivar provisioning_state: Provisioning status of the origin. + :vartype provisioning_state: 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.cdn.models.PrivateEndpointStatus + """ + + _validation = { + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_status': {'readonly': True}, + } + + _attribute_map = { + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'http_port': {'key': 'httpPort', 'type': 'int'}, + 'https_port': {'key': 'httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, + 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, + 'resource_state': {'key': 'resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint_status': {'key': 'privateEndpointStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + host_name: Optional[str] = None, + http_port: Optional[int] = None, + https_port: Optional[int] = None, + origin_host_header: Optional[str] = None, + priority: Optional[int] = None, + weight: Optional[int] = None, + enabled: Optional[bool] = None, + private_link_alias: Optional[str] = None, + private_link_resource_id: Optional[str] = None, + private_link_location: Optional[str] = None, + private_link_approval_message: Optional[str] = None, + **kwargs + ): + super(OriginProperties, self).__init__(host_name=host_name, http_port=http_port, https_port=https_port, origin_host_header=origin_host_header, priority=priority, weight=weight, enabled=enabled, private_link_alias=private_link_alias, private_link_resource_id=private_link_resource_id, private_link_location=private_link_location, private_link_approval_message=private_link_approval_message, **kwargs) + self.resource_state = None + self.provisioning_state = None + self.private_endpoint_status = None + + +class OriginUpdateParameters(msrest.serialization.Model): + """Origin properties needed for origin update. + + :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses + are supported.This should be unique across all origins in an endpoint. + :type host_name: str + :param http_port: The value of the HTTP port. Must be between 1 and 65535. + :type http_port: int + :param https_port: The value of the HTTPS port. Must be between 1 and 65535. + :type https_port: int + :param origin_host_header: The host header value sent to the origin with each request. If you + leave this blank, the request hostname determines this value. Azure CDN origins, such as Web + Apps, Blob Storage, and Cloud Services require this host header value to match the origin + hostname by default. This overrides the host header defined at Endpoint. + :type origin_host_header: str + :param priority: Priority of origin in given origin group for load balancing. Higher priorities + will not be used for load balancing if any lower priority origin is healthy.Must be between 1 + and 5. + :type priority: int + :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 + and 1000. + :type weight: int + :param enabled: Origin is enabled for load balancing or not. + :type enabled: bool + :param private_link_alias: The Alias of the Private Link resource. Populating this optional + field indicates that this origin 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 + :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 + """ + + _validation = { + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + 'priority': {'maximum': 5, 'minimum': 1}, + 'weight': {'maximum': 1000, 'minimum': 1}, + } + + _attribute_map = { + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'weight': {'key': 'properties.weight', 'type': 'int'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, + 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + host_name: Optional[str] = None, + http_port: Optional[int] = None, + https_port: Optional[int] = None, + origin_host_header: Optional[str] = None, + priority: Optional[int] = None, + weight: Optional[int] = None, + enabled: Optional[bool] = None, + private_link_alias: Optional[str] = None, + private_link_resource_id: Optional[str] = None, + private_link_location: Optional[str] = None, + private_link_approval_message: Optional[str] = None, + **kwargs + ): + super(OriginUpdateParameters, self).__init__(**kwargs) + self.host_name = host_name + self.http_port = http_port + self.https_port = https_port + self.origin_host_header = origin_host_header + self.priority = priority + self.weight = weight + self.enabled = enabled + 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_link_approval_message = private_link_approval_message + + +class PolicySettings(msrest.serialization.Model): + """Defines contents of a web application firewall global configuration. + + :param enabled_state: describes if the policy is in enabled state or disabled state. Possible + values include: "Disabled", "Enabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.PolicyEnabledState + :param mode: Describes if it is in detection mode or prevention mode at policy level. Possible + values include: "Prevention", "Detection". + :type mode: str or ~azure.mgmt.cdn.models.PolicyMode + :param default_redirect_url: If action type is redirect, this field represents the default + redirect URL for the client. + :type default_redirect_url: str + :param default_custom_block_response_status_code: If the action type is block, this field + defines the default customer overridable http response status code. Possible values include: + 200, 403, 405, 406, 429. + :type default_custom_block_response_status_code: str or ~azure.mgmt.cdn.models.Enum47 + :param default_custom_block_response_body: If the action type is block, customer can override + the response body. The body must be specified in base64 encoding. + :type default_custom_block_response_body: str + """ + + _validation = { + 'default_custom_block_response_body': {'pattern': r'^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$'}, + } + + _attribute_map = { + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'default_redirect_url': {'key': 'defaultRedirectUrl', 'type': 'str'}, + 'default_custom_block_response_status_code': {'key': 'defaultCustomBlockResponseStatusCode', 'type': 'int'}, + 'default_custom_block_response_body': {'key': 'defaultCustomBlockResponseBody', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled_state: Optional[Union[str, "PolicyEnabledState"]] = None, + mode: Optional[Union[str, "PolicyMode"]] = None, + default_redirect_url: Optional[str] = None, + default_custom_block_response_status_code: Optional[Union[int, "Enum47"]] = None, + default_custom_block_response_body: Optional[str] = None, + **kwargs + ): + super(PolicySettings, self).__init__(**kwargs) + self.enabled_state = enabled_state + self.mode = mode + self.default_redirect_url = default_redirect_url + self.default_custom_block_response_status_code = default_custom_block_response_status_code + self.default_custom_block_response_body = default_custom_block_response_body + + +class PostArgsMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for PostArgs match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters". + :vartype odata_type: str + :param selector: Name of PostArg to be matched. + :type selector: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.PostArgsOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters" + + def __init__( + self, + *, + operator: Union[str, "PostArgsOperator"], + selector: Optional[str] = None, + negate_condition: Optional[bool] = None, + match_values: Optional[List[str]] = None, + transforms: Optional[List[Union[str, "Transform"]]] = None, + **kwargs + ): + super(PostArgsMatchConditionParameters, self).__init__(**kwargs) + self.selector = selector + self.operator = operator + self.negate_condition = negate_condition + self.match_values = match_values + self.transforms = transforms + + +class Profile(TrackedResource): + """CDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and pricing tier. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param sku: Required. The pricing tier (defines a CDN provider, feature list and rate) of the + CDN profile. + :type sku: ~azure.mgmt.cdn.models.Sku + :ivar resource_state: Resource status of the profile. Possible values include: "Creating", + "Active", "Deleting", "Disabled". + :vartype resource_state: str or ~azure.mgmt.cdn.models.ProfileResourceState + :ivar provisioning_state: Provisioning status of the profile. + :vartype provisioning_state: str + :ivar frontdoor_id: The Id of the frontdoor. + :vartype frontdoor_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'sku': {'required': True}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'frontdoor_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'frontdoor_id': {'key': 'properties.frontdoorId', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + sku: "Sku", + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Profile, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.resource_state = None + self.provisioning_state = None + self.frontdoor_id = None + + +class ProfileListResult(msrest.serialization.Model): + """Result of the request to list profiles. It contains a list of profile objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of CDN profiles within a resource group. + :vartype value: list[~azure.mgmt.cdn.models.Profile] + :param next_link: URL to get the next set of profile objects if there are any. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Profile]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(ProfileListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class ProfileUpdateParameters(msrest.serialization.Model): + """Properties required to update a profile. + + :param tags: A set of tags. Profile tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ProfileUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class PurgeParameters(msrest.serialization.Model): + """Parameters required for content purge. + + All required parameters must be populated in order to send to Azure. + + :param content_paths: Required. The path to the content to be purged. Can describe a file path + or a wild card directory. + :type content_paths: list[str] + """ + + _validation = { + 'content_paths': {'required': True}, + } + + _attribute_map = { + 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + } + + def __init__( + self, + *, + content_paths: List[str], + **kwargs + ): + super(PurgeParameters, self).__init__(**kwargs) + self.content_paths = content_paths + + +class QueryStringMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for QueryString match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.QueryStringOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters" + + def __init__( + self, + *, + operator: Union[str, "QueryStringOperator"], + negate_condition: Optional[bool] = None, + match_values: Optional[List[str]] = None, + transforms: Optional[List[Union[str, "Transform"]]] = None, + **kwargs + ): + super(QueryStringMatchConditionParameters, self).__init__(**kwargs) + self.operator = operator + self.negate_condition = negate_condition + self.match_values = match_values + self.transforms = transforms + + +class RankingsResponse(msrest.serialization.Model): + """Rankings Response. + + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param tables: + :type tables: list[~azure.mgmt.cdn.models.RankingsResponseTablesItem] + """ + + _attribute_map = { + 'date_time_begin': {'key': 'dateTimeBegin', 'type': 'iso-8601'}, + 'date_time_end': {'key': 'dateTimeEnd', 'type': 'iso-8601'}, + 'tables': {'key': 'tables', 'type': '[RankingsResponseTablesItem]'}, + } + + def __init__( + self, + *, + date_time_begin: Optional[datetime.datetime] = None, + date_time_end: Optional[datetime.datetime] = None, + tables: Optional[List["RankingsResponseTablesItem"]] = None, + **kwargs + ): + super(RankingsResponse, self).__init__(**kwargs) + self.date_time_begin = date_time_begin + self.date_time_end = date_time_end + self.tables = tables + + +class RankingsResponseTablesItem(msrest.serialization.Model): + """RankingsResponseTablesItem. + + :param ranking: + :type ranking: str + :param data: + :type data: list[~azure.mgmt.cdn.models.RankingsResponseTablesPropertiesItemsItem] + """ + + _attribute_map = { + 'ranking': {'key': 'ranking', 'type': 'str'}, + 'data': {'key': 'data', 'type': '[RankingsResponseTablesPropertiesItemsItem]'}, + } + + def __init__( + self, + *, + ranking: Optional[str] = None, + data: Optional[List["RankingsResponseTablesPropertiesItemsItem"]] = None, + **kwargs + ): + super(RankingsResponseTablesItem, self).__init__(**kwargs) + self.ranking = ranking + self.data = data + + +class RankingsResponseTablesPropertiesItemsItem(msrest.serialization.Model): + """RankingsResponseTablesPropertiesItemsItem. + + :param name: + :type name: str + :param metrics: + :type metrics: list[~azure.mgmt.cdn.models.RankingsResponseTablesPropertiesItemsMetricsItem] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'metrics': {'key': 'metrics', 'type': '[RankingsResponseTablesPropertiesItemsMetricsItem]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + metrics: Optional[List["RankingsResponseTablesPropertiesItemsMetricsItem"]] = None, + **kwargs + ): + super(RankingsResponseTablesPropertiesItemsItem, self).__init__(**kwargs) + self.name = name + self.metrics = metrics + + +class RankingsResponseTablesPropertiesItemsMetricsItem(msrest.serialization.Model): + """RankingsResponseTablesPropertiesItemsMetricsItem. + + :param metric: + :type metric: str + :param value: + :type value: long + :param percentage: + :type percentage: float + """ + + _attribute_map = { + 'metric': {'key': 'metric', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'long'}, + 'percentage': {'key': 'percentage', 'type': 'float'}, + } + + def __init__( + self, + *, + metric: Optional[str] = None, + value: Optional[int] = None, + percentage: Optional[float] = None, + **kwargs + ): + super(RankingsResponseTablesPropertiesItemsMetricsItem, self).__init__(**kwargs) + self.metric = metric + self.value = value + self.percentage = percentage + + +class RateLimitRule(CustomRule): + """Defines a rate limiting rule that can be included in a waf policy. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Defines the name of the custom rule. + :type name: str + :param enabled_state: Describes if the custom rule is in enabled or disabled state. Defaults to + Enabled if not specified. Possible values include: "Disabled", "Enabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.CustomRuleEnabledState + :param priority: Required. Defines in what order this rule be evaluated in the overall list of + custom rules. + :type priority: int + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.cdn.models.MatchCondition] + :param action: Required. Describes what action to be applied when rule matches. Possible values + include: "Allow", "Block", "Log", "Redirect". + :type action: str or ~azure.mgmt.cdn.models.ActionType + :param rate_limit_threshold: Required. Defines rate limit threshold. + :type rate_limit_threshold: int + :param rate_limit_duration_in_minutes: Required. Defines rate limit duration. Default is 1 + minute. + :type rate_limit_duration_in_minutes: int + """ + + _validation = { + 'name': {'required': True}, + 'priority': {'required': True, 'maximum': 1000, 'minimum': 0}, + 'match_conditions': {'required': True}, + 'action': {'required': True}, + 'rate_limit_threshold': {'required': True, 'minimum': 0}, + 'rate_limit_duration_in_minutes': {'required': True, 'maximum': 60, 'minimum': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, + 'action': {'key': 'action', 'type': 'str'}, + 'rate_limit_threshold': {'key': 'rateLimitThreshold', 'type': 'int'}, + 'rate_limit_duration_in_minutes': {'key': 'rateLimitDurationInMinutes', 'type': 'int'}, + } + + def __init__( + self, + *, + name: str, + priority: int, + match_conditions: List["MatchCondition"], + action: Union[str, "ActionType"], + rate_limit_threshold: int, + rate_limit_duration_in_minutes: int, + enabled_state: Optional[Union[str, "CustomRuleEnabledState"]] = None, + **kwargs + ): + super(RateLimitRule, self).__init__(name=name, enabled_state=enabled_state, priority=priority, match_conditions=match_conditions, action=action, **kwargs) + self.rate_limit_threshold = rate_limit_threshold + self.rate_limit_duration_in_minutes = rate_limit_duration_in_minutes + + +class RateLimitRuleList(msrest.serialization.Model): + """Defines contents of rate limit rules. + + :param rules: List of rules. + :type rules: list[~azure.mgmt.cdn.models.RateLimitRule] + """ + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[RateLimitRule]'}, + } + + def __init__( + self, + *, + rules: Optional[List["RateLimitRule"]] = None, + **kwargs + ): + super(RateLimitRuleList, self).__init__(**kwargs) + self.rules = rules + + +class RemoteAddressMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RemoteAddress match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "IPMatch", "GeoMatch". + :type operator: str or ~azure.mgmt.cdn.models.RemoteAddressOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: 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 match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters" + + def __init__( + self, + *, + operator: Union[str, "RemoteAddressOperator"], + negate_condition: Optional[bool] = None, + match_values: Optional[List[str]] = None, + transforms: Optional[List[Union[str, "Transform"]]] = None, + **kwargs + ): + super(RemoteAddressMatchConditionParameters, self).__init__(**kwargs) + self.operator = operator + self.negate_condition = negate_condition + self.match_values = match_values + self.transforms = transforms + + +class RequestBodyMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RequestBody match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.RequestBodyOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters" + + def __init__( + self, + *, + operator: Union[str, "RequestBodyOperator"], + negate_condition: Optional[bool] = None, + match_values: Optional[List[str]] = None, + transforms: Optional[List[Union[str, "Transform"]]] = None, + **kwargs + ): + super(RequestBodyMatchConditionParameters, self).__init__(**kwargs) + self.operator = operator + self.negate_condition = negate_condition + self.match_values = match_values + self.transforms = transforms + + +class RequestHeaderMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RequestHeader match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters". + :vartype odata_type: str + :param selector: Name of Header to be matched. + :type selector: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.RequestHeaderOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters" + + def __init__( + self, + *, + operator: Union[str, "RequestHeaderOperator"], + selector: Optional[str] = None, + negate_condition: Optional[bool] = None, + match_values: Optional[List[str]] = None, + transforms: Optional[List[Union[str, "Transform"]]] = None, + **kwargs + ): + super(RequestHeaderMatchConditionParameters, self).__init__(**kwargs) + self.selector = selector + self.operator = operator + self.negate_condition = negate_condition + self.match_values = match_values + self.transforms = transforms + + +class RequestMethodMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RequestMethod match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Equal". + :type operator: str or ~azure.mgmt.cdn.models.RequestMethodOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str or + ~azure.mgmt.cdn.models.RequestMethodMatchConditionParametersMatchValuesItem] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters" + + def __init__( + self, + *, + operator: Union[str, "RequestMethodOperator"], + negate_condition: Optional[bool] = None, + match_values: Optional[List[Union[str, "RequestMethodMatchConditionParametersMatchValuesItem"]]] = None, + **kwargs + ): + super(RequestMethodMatchConditionParameters, self).__init__(**kwargs) + self.operator = operator + self.negate_condition = negate_condition + self.match_values = match_values + + +class RequestSchemeMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RequestScheme match conditions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters". + :vartype odata_type: str + :ivar operator: Required. Describes operator to be matched. Default value: "Equal". + :vartype operator: str + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str or + ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParametersMatchValuesItem] + """ + + _validation = { + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + } + + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters" + operator = "Equal" + + def __init__( + self, + *, + negate_condition: Optional[bool] = None, + match_values: Optional[List[Union[str, "RequestSchemeMatchConditionParametersMatchValuesItem"]]] = None, **kwargs ): - super(OriginGroupListResult, self).__init__(**kwargs) - self.value = None - self.next_link = next_link + super(RequestSchemeMatchConditionParameters, self).__init__(**kwargs) + self.negate_condition = negate_condition + self.match_values = match_values -class OriginGroupUpdatePropertiesParameters(msrest.serialization.Model): - """The JSON object that contains the properties of the origin group. +class RequestUriMatchConditionParameters(msrest.serialization.Model): + """Defines the parameters for RequestUri match conditions. - :param health_probe_settings: Health probe settings to the origin that is used to determine the - health of the origin. - :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters - :param origins: The source of the content being delivered via CDN within given origin group. - :type origins: list[~azure.mgmt.cdn.models.ResourceReference] - :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift - the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new - endpoint is added. Default is 10 mins. This property is currently not supported. - :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int - :param response_based_origin_error_detection_settings: The JSON object that contains the - properties to determine origin health using real requests/responses. This property is currently - not supported. - :type response_based_origin_error_detection_settings: - ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odata_type: Required. Default value: + "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters". + :vartype odata_type: str + :param operator: Required. Describes operator to be matched. Possible values include: "Any", + "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", + "GreaterThanOrEqual", "RegEx". + :type operator: str or ~azure.mgmt.cdn.models.RequestUriOperator + :param negate_condition: Describes if this is negate condition or not. + :type negate_condition: bool + :param match_values: The match value for the condition of the delivery rule. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] """ _validation = { - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + 'odata_type': {'required': True, 'constant': True}, + 'operator': {'required': True}, } _attribute_map = { - 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, - 'origins': {'key': 'origins', 'type': '[ResourceReference]'}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, - 'response_based_origin_error_detection_settings': {'key': 'responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, } + odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters" + def __init__( self, *, - health_probe_settings: Optional["HealthProbeParameters"] = None, - origins: Optional[List["ResourceReference"]] = None, - traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, - response_based_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + operator: Union[str, "RequestUriOperator"], + negate_condition: Optional[bool] = None, + match_values: Optional[List[str]] = None, + transforms: Optional[List[Union[str, "Transform"]]] = None, **kwargs ): - super(OriginGroupUpdatePropertiesParameters, self).__init__(**kwargs) - self.health_probe_settings = health_probe_settings - self.origins = origins - self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes - self.response_based_origin_error_detection_settings = response_based_origin_error_detection_settings + super(RequestUriMatchConditionParameters, self).__init__(**kwargs) + self.operator = operator + self.negate_condition = negate_condition + self.match_values = match_values + self.transforms = transforms -class OriginGroupProperties(OriginGroupUpdatePropertiesParameters): - """The JSON object that contains the properties of the origin group. +class ResourceReference(msrest.serialization.Model): + """Reference to another resource. - Variables are only populated by the server, and will be ignored when sending a request. + :param id: Resource ID. + :type id: str + """ - :param health_probe_settings: Health probe settings to the origin that is used to determine the - health of the origin. - :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters - :param origins: The source of the content being delivered via CDN within given origin group. - :type origins: list[~azure.mgmt.cdn.models.ResourceReference] - :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift - the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new - endpoint is added. Default is 10 mins. This property is currently not supported. - :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int - :param response_based_origin_error_detection_settings: The JSON object that contains the - properties to determine origin health using real requests/responses. This property is currently - not supported. - :type response_based_origin_error_detection_settings: - ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters - :ivar resource_state: Resource status of the origin group. Possible values include: "Creating", - "Active", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginGroupResourceState - :ivar provisioning_state: Provisioning status of the origin group. - :vartype provisioning_state: str + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(ResourceReference, self).__init__(**kwargs) + self.id = id + + +class ResourcesResponse(msrest.serialization.Model): + """Resources Response. + + :param endpoints: + :type endpoints: list[~azure.mgmt.cdn.models.ResourcesResponseEndpointsItem] + :param custom_domains: + :type custom_domains: list[~azure.mgmt.cdn.models.ResourcesResponseCustomDomainsItem] """ - _validation = { - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, - 'resource_state': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + _attribute_map = { + 'endpoints': {'key': 'endpoints', 'type': '[ResourcesResponseEndpointsItem]'}, + 'custom_domains': {'key': 'customDomains', 'type': '[ResourcesResponseCustomDomainsItem]'}, } + def __init__( + self, + *, + endpoints: Optional[List["ResourcesResponseEndpointsItem"]] = None, + custom_domains: Optional[List["ResourcesResponseCustomDomainsItem"]] = None, + **kwargs + ): + super(ResourcesResponse, self).__init__(**kwargs) + self.endpoints = endpoints + self.custom_domains = custom_domains + + +class ResourcesResponseCustomDomainsItem(msrest.serialization.Model): + """ResourcesResponseCustomDomainsItem. + + :param id: + :type id: str + :param name: + :type name: str + :param endpoint_id: + :type endpoint_id: str + :param history: + :type history: bool + """ + _attribute_map = { - 'health_probe_settings': {'key': 'healthProbeSettings', 'type': 'HealthProbeParameters'}, - 'origins': {'key': 'origins', 'type': '[ResourceReference]'}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, - 'response_based_origin_error_detection_settings': {'key': 'responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, - 'resource_state': {'key': 'resourceState', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, + 'history': {'key': 'history', 'type': 'bool'}, } def __init__( self, *, - health_probe_settings: Optional["HealthProbeParameters"] = None, - origins: Optional[List["ResourceReference"]] = None, - traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, - response_based_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + id: Optional[str] = None, + name: Optional[str] = None, + endpoint_id: Optional[str] = None, + history: Optional[bool] = None, **kwargs ): - super(OriginGroupProperties, self).__init__(health_probe_settings=health_probe_settings, origins=origins, traffic_restoration_time_to_healed_or_new_endpoints_in_minutes=traffic_restoration_time_to_healed_or_new_endpoints_in_minutes, response_based_origin_error_detection_settings=response_based_origin_error_detection_settings, **kwargs) - self.resource_state = None - self.provisioning_state = None + super(ResourcesResponseCustomDomainsItem, self).__init__(**kwargs) + self.id = id + self.name = name + self.endpoint_id = endpoint_id + self.history = history -class OriginGroupUpdateParameters(msrest.serialization.Model): - """Origin group properties needed for origin group creation or update. +class ResourcesResponseEndpointsItem(msrest.serialization.Model): + """ResourcesResponseEndpointsItem. - :param health_probe_settings: Health probe settings to the origin that is used to determine the - health of the origin. - :type health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters - :param origins: The source of the content being delivered via CDN within given origin group. - :type origins: list[~azure.mgmt.cdn.models.ResourceReference] - :param traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift - the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new - endpoint is added. Default is 10 mins. This property is currently not supported. - :type traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int - :param response_based_origin_error_detection_settings: The JSON object that contains the - properties to determine origin health using real requests/responses. This property is currently - not supported. - :type response_based_origin_error_detection_settings: - ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters + :param id: + :type id: str + :param name: + :type name: str + :param history: + :type history: bool + :param custom_domains: + :type custom_domains: + list[~azure.mgmt.cdn.models.ResourcesResponseEndpointsPropertiesItemsItem] """ - _validation = { - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'history': {'key': 'history', 'type': 'bool'}, + 'custom_domains': {'key': 'customDomains', 'type': '[ResourcesResponseEndpointsPropertiesItemsItem]'}, } + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + history: Optional[bool] = None, + custom_domains: Optional[List["ResourcesResponseEndpointsPropertiesItemsItem"]] = None, + **kwargs + ): + super(ResourcesResponseEndpointsItem, self).__init__(**kwargs) + self.id = id + self.name = name + self.history = history + self.custom_domains = custom_domains + + +class ResourcesResponseEndpointsPropertiesItemsItem(msrest.serialization.Model): + """ResourcesResponseEndpointsPropertiesItemsItem. + + :param id: + :type id: str + :param name: + :type name: str + :param endpoint_id: + :type endpoint_id: str + :param history: + :type history: bool + """ + _attribute_map = { - 'health_probe_settings': {'key': 'properties.healthProbeSettings', 'type': 'HealthProbeParameters'}, - 'origins': {'key': 'properties.origins', 'type': '[ResourceReference]'}, - 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'key': 'properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes', 'type': 'int'}, - 'response_based_origin_error_detection_settings': {'key': 'properties.responseBasedOriginErrorDetectionSettings', 'type': 'ResponseBasedOriginErrorDetectionParameters'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, + 'history': {'key': 'history', 'type': 'bool'}, } def __init__( self, *, - health_probe_settings: Optional["HealthProbeParameters"] = None, - origins: Optional[List["ResourceReference"]] = None, - traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None, - response_based_origin_error_detection_settings: Optional["ResponseBasedOriginErrorDetectionParameters"] = None, + id: Optional[str] = None, + name: Optional[str] = None, + endpoint_id: Optional[str] = None, + history: Optional[bool] = None, **kwargs ): - super(OriginGroupUpdateParameters, self).__init__(**kwargs) - self.health_probe_settings = health_probe_settings - self.origins = origins - self.traffic_restoration_time_to_healed_or_new_endpoints_in_minutes = traffic_restoration_time_to_healed_or_new_endpoints_in_minutes - self.response_based_origin_error_detection_settings = response_based_origin_error_detection_settings + super(ResourcesResponseEndpointsPropertiesItemsItem, self).__init__(**kwargs) + self.id = id + self.name = name + self.endpoint_id = endpoint_id + self.history = history + + +class ResourceUsage(msrest.serialization.Model): + """Output of check resource usage API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: Resource type for which the usage is provided. + :vartype resource_type: str + :ivar unit: Unit of the usage. e.g. Count. + :vartype unit: str + :ivar current_value: Actual value of usage on the specified resource type. + :vartype current_value: int + :ivar limit: Quota of the specified resource type. + :vartype limit: int + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceUsage, self).__init__(**kwargs) + self.resource_type = None + self.unit = None + self.current_value = None + self.limit = None -class OriginListResult(msrest.serialization.Model): - """Result of the request to list origins. It contains a list of origin objects and a URL link to get the next set of results. +class ResourceUsageListResult(msrest.serialization.Model): + """Output of check resource usage API. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of CDN origins within an endpoint. - :vartype value: list[~azure.mgmt.cdn.models.Origin] - :param next_link: URL to get the next set of origin objects if there are any. + :ivar value: List of resource usages. + :vartype value: list[~azure.mgmt.cdn.models.ResourceUsage] + :param next_link: URL to get the next set of custom domain objects if there are any. :type next_link: str """ @@ -3731,7 +7069,7 @@ class OriginListResult(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[Origin]'}, + 'value': {'key': 'value', 'type': '[ResourceUsage]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -3741,465 +7079,591 @@ def __init__( next_link: Optional[str] = None, **kwargs ): - super(OriginListResult, self).__init__(**kwargs) + super(ResourceUsageListResult, self).__init__(**kwargs) self.value = None self.next_link = next_link -class OriginUpdatePropertiesParameters(msrest.serialization.Model): - """The JSON object that contains the properties of the origin. +class ResponseBasedOriginErrorDetectionParameters(msrest.serialization.Model): + """The JSON object that contains the properties to determine origin health using real requests/responses. - :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses - are supported.This should be unique across all origins in an endpoint. - :type host_name: str - :param http_port: The value of the HTTP port. Must be between 1 and 65535. - :type http_port: int - :param https_port: The value of the HTTPS port. Must be between 1 and 65535. - :type https_port: int - :param origin_host_header: The host header value sent to the origin with each request. If you - leave this blank, the request hostname determines this value. Azure CDN origins, such as Web - Apps, Blob Storage, and Cloud Services require this host header value to match the origin - hostname by default. This overrides the host header defined at Endpoint. - :type origin_host_header: str - :param priority: Priority of origin in given origin group for load balancing. Higher priorities - will not be used for load balancing if any lower priority origin is healthy.Must be between 1 - and 5. - :type priority: int - :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 - and 1000. - :type weight: int - :param enabled: Origin is enabled for load balancing or not. - :type enabled: bool - :param private_link_alias: The Alias of the Private Link resource. Populating this optional - field indicates that this origin 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 - :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 response_based_detected_error_types: Type of response errors for real user requests for + which origin will be deemed unhealthy. Possible values include: "None", "TcpErrorsOnly", + "TcpAndHttpErrors". + :type response_based_detected_error_types: str or + ~azure.mgmt.cdn.models.ResponseBasedDetectedErrorTypes + :param response_based_failover_threshold_percentage: The percentage of failed requests in the + sample where failover should trigger. + :type response_based_failover_threshold_percentage: int + :param http_error_ranges: The list of Http status code ranges that are considered as server + errors for origin and it is marked as unhealthy. + :type http_error_ranges: list[~azure.mgmt.cdn.models.HttpErrorRangeParameters] """ _validation = { - 'http_port': {'maximum': 65535, 'minimum': 1}, - 'https_port': {'maximum': 65535, 'minimum': 1}, - 'priority': {'maximum': 5, 'minimum': 1}, - 'weight': {'maximum': 1000, 'minimum': 1}, + 'response_based_failover_threshold_percentage': {'maximum': 100, 'minimum': 0}, } _attribute_map = { - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'http_port': {'key': 'httpPort', 'type': 'int'}, - 'https_port': {'key': 'httpsPort', 'type': 'int'}, - 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'weight': {'key': 'weight', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, - 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, - 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, - 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, + 'response_based_detected_error_types': {'key': 'responseBasedDetectedErrorTypes', 'type': 'str'}, + 'response_based_failover_threshold_percentage': {'key': 'responseBasedFailoverThresholdPercentage', 'type': 'int'}, + 'http_error_ranges': {'key': 'httpErrorRanges', 'type': '[HttpErrorRangeParameters]'}, } def __init__( self, *, - host_name: Optional[str] = None, - http_port: Optional[int] = None, - https_port: Optional[int] = None, - origin_host_header: Optional[str] = None, - priority: Optional[int] = None, - weight: Optional[int] = None, - enabled: Optional[bool] = None, - private_link_alias: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - private_link_location: Optional[str] = None, - private_link_approval_message: Optional[str] = None, + response_based_detected_error_types: Optional[Union[str, "ResponseBasedDetectedErrorTypes"]] = None, + response_based_failover_threshold_percentage: Optional[int] = None, + http_error_ranges: Optional[List["HttpErrorRangeParameters"]] = None, **kwargs ): - super(OriginUpdatePropertiesParameters, self).__init__(**kwargs) - self.host_name = host_name - self.http_port = http_port - self.https_port = https_port - self.origin_host_header = origin_host_header - self.priority = priority - self.weight = weight - self.enabled = enabled - 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_link_approval_message = private_link_approval_message + super(ResponseBasedOriginErrorDetectionParameters, self).__init__(**kwargs) + self.response_based_detected_error_types = response_based_detected_error_types + self.response_based_failover_threshold_percentage = response_based_failover_threshold_percentage + self.http_error_ranges = http_error_ranges -class OriginProperties(OriginUpdatePropertiesParameters): - """The JSON object that contains the properties of the origin. +class Route(ProxyResource): + """Friendly Routes name mapping to the any Routes or secret related information. Variables are only populated by the server, and will be ignored when sending a request. - :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses - are supported.This should be unique across all origins in an endpoint. - :type host_name: str - :param http_port: The value of the HTTP port. Must be between 1 and 65535. - :type http_port: int - :param https_port: The value of the HTTPS port. Must be between 1 and 65535. - :type https_port: int - :param origin_host_header: The host header value sent to the origin with each request. If you - leave this blank, the request hostname determines this value. Azure CDN origins, such as Web - Apps, Blob Storage, and Cloud Services require this host header value to match the origin - hostname by default. This overrides the host header defined at Endpoint. - :type origin_host_header: str - :param priority: Priority of origin in given origin group for load balancing. Higher priorities - will not be used for load balancing if any lower priority origin is healthy.Must be between 1 - and 5. - :type priority: int - :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 - and 1000. - :type weight: int - :param enabled: Origin is enabled for load balancing or not. - :type enabled: bool - :param private_link_alias: The Alias of the Private Link resource. Populating this optional - field indicates that this origin 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 - :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 - :ivar resource_state: Resource status of the origin. Possible values include: "Creating", - "Active", "Deleting". - :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState - :ivar provisioning_state: Provisioning status of the origin. - :vartype provisioning_state: 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.cdn.models.PrivateEndpointStatus + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param custom_domains: Domains referenced by this endpoint. + :type custom_domains: list[~azure.mgmt.cdn.models.ResourceReference] + :param origin_group: A reference to the origin group. + :type origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param origin_path: A directory path on the origin that AzureFrontDoor can use to retrieve + content from, e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param rule_sets: rule sets referenced by this endpoint. + :type rule_sets: list[~azure.mgmt.cdn.models.ResourceReference] + :param supported_protocols: List of supported protocols for this route. + :type supported_protocols: list[str or ~azure.mgmt.cdn.models.AFDEndpointProtocols] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param compression_settings: compression settings. + :type compression_settings: object + :param query_string_caching_behavior: Defines how AzureFrontDoor caches requests that include + query strings. You can ignore any query strings when caching, bypass caching to prevent + requests that contain query strings from being cached, or cache every request with a unique + URL. Possible values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this AzureFrontDoor + endpoint to optimize for, e.g. Download, Media services. With this information, AzureFrontDoor + can apply scenario driven optimization. Possible values include: "GeneralWebDelivery", + "GeneralMediaStreaming", "VideoOnDemandMediaStreaming", "LargeFileDownload", + "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param forwarding_protocol: Protocol this rule will use when forwarding traffic to backends. + Possible values include: "HttpOnly", "HttpsOnly", "MatchRequest". + :type forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol + :param link_to_default_domain: whether this route will be linked to the default endpoint + domain. Possible values include: "Enabled", "Disabled". + :type link_to_default_domain: str or ~azure.mgmt.cdn.models.LinkToDefaultDomain + :param https_redirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note + that this is a easy way to set up this rule and it will be the first rule that gets executed. + Possible values include: "Enabled", "Disabled". + :type https_redirect: str or ~azure.mgmt.cdn.models.HttpsRedirect + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'http_port': {'maximum': 65535, 'minimum': 1}, - 'https_port': {'maximum': 65535, 'minimum': 1}, - 'priority': {'maximum': 5, 'minimum': 1}, - 'weight': {'maximum': 1000, 'minimum': 1}, - 'resource_state': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, - 'private_endpoint_status': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'http_port': {'key': 'httpPort', 'type': 'int'}, - 'https_port': {'key': 'httpsPort', 'type': 'int'}, - 'origin_host_header': {'key': 'originHostHeader', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'weight': {'key': 'weight', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, - 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, - 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, - 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, - 'resource_state': {'key': 'resourceState', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'private_endpoint_status': {'key': 'privateEndpointStatus', 'type': 'str'}, - } - - def __init__( - self, - *, - host_name: Optional[str] = None, - http_port: Optional[int] = None, - https_port: Optional[int] = None, - origin_host_header: Optional[str] = None, - priority: Optional[int] = None, - weight: Optional[int] = None, - enabled: Optional[bool] = None, - private_link_alias: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - private_link_location: Optional[str] = None, - private_link_approval_message: Optional[str] = None, - **kwargs - ): - super(OriginProperties, self).__init__(host_name=host_name, http_port=http_port, https_port=https_port, origin_host_header=origin_host_header, priority=priority, weight=weight, enabled=enabled, private_link_alias=private_link_alias, private_link_resource_id=private_link_resource_id, private_link_location=private_link_location, private_link_approval_message=private_link_approval_message, **kwargs) - self.resource_state = None - self.provisioning_state = None - self.private_endpoint_status = None - - -class OriginUpdateParameters(msrest.serialization.Model): - """Origin properties needed for origin update. - - :param host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses - are supported.This should be unique across all origins in an endpoint. - :type host_name: str - :param http_port: The value of the HTTP port. Must be between 1 and 65535. - :type http_port: int - :param https_port: The value of the HTTPS port. Must be between 1 and 65535. - :type https_port: int - :param origin_host_header: The host header value sent to the origin with each request. If you - leave this blank, the request hostname determines this value. Azure CDN origins, such as Web - Apps, Blob Storage, and Cloud Services require this host header value to match the origin - hostname by default. This overrides the host header defined at Endpoint. - :type origin_host_header: str - :param priority: Priority of origin in given origin group for load balancing. Higher priorities - will not be used for load balancing if any lower priority origin is healthy.Must be between 1 - and 5. - :type priority: int - :param weight: Weight of the origin in given origin group for load balancing. Must be between 1 - and 1000. - :type weight: int - :param enabled: Origin is enabled for load balancing or not. - :type enabled: bool - :param private_link_alias: The Alias of the Private Link resource. Populating this optional - field indicates that this origin 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 - :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 + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[ResourceReference]'}, + 'origin_group': {'key': 'properties.originGroup', 'type': 'ResourceReference'}, + 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, + 'rule_sets': {'key': 'properties.ruleSets', 'type': '[ResourceReference]'}, + 'supported_protocols': {'key': 'properties.supportedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'properties.patternsToMatch', 'type': '[str]'}, + 'compression_settings': {'key': 'properties.compressionSettings', 'type': 'object'}, + 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, + 'forwarding_protocol': {'key': 'properties.forwardingProtocol', 'type': 'str'}, + 'link_to_default_domain': {'key': 'properties.linkToDefaultDomain', 'type': 'str'}, + 'https_redirect': {'key': 'properties.httpsRedirect', 'type': 'str'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + custom_domains: Optional[List["ResourceReference"]] = None, + origin_group: Optional["ResourceReference"] = None, + origin_path: Optional[str] = None, + rule_sets: Optional[List["ResourceReference"]] = None, + supported_protocols: Optional[List[Union[str, "AFDEndpointProtocols"]]] = None, + patterns_to_match: Optional[List[str]] = None, + compression_settings: Optional[object] = None, + query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, + optimization_type: Optional[Union[str, "OptimizationType"]] = None, + forwarding_protocol: Optional[Union[str, "ForwardingProtocol"]] = None, + link_to_default_domain: Optional[Union[str, "LinkToDefaultDomain"]] = None, + https_redirect: Optional[Union[str, "HttpsRedirect"]] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, + **kwargs + ): + super(Route, self).__init__(**kwargs) + self.custom_domains = custom_domains + self.origin_group = origin_group + self.origin_path = origin_path + self.rule_sets = rule_sets + self.supported_protocols = supported_protocols + self.patterns_to_match = patterns_to_match + self.compression_settings = compression_settings + self.query_string_caching_behavior = query_string_caching_behavior + self.optimization_type = optimization_type + self.forwarding_protocol = forwarding_protocol + self.link_to_default_domain = link_to_default_domain + self.https_redirect = https_redirect + self.enabled_state = enabled_state + self.provisioning_state = None + self.deployment_status = None + + +class RouteListResult(msrest.serialization.Model): + """Result of the request to list routes. It contains a list of route objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of AzureFrontDoor routes within a profile. + :vartype value: list[~azure.mgmt.cdn.models.Route] + :param next_link: URL to get the next set of route objects if there are any. + :type next_link: str """ _validation = { - 'http_port': {'maximum': 65535, 'minimum': 1}, - 'https_port': {'maximum': 65535, 'minimum': 1}, - 'priority': {'maximum': 5, 'minimum': 1}, - 'weight': {'maximum': 1000, 'minimum': 1}, + 'value': {'readonly': True}, } _attribute_map = { - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, - 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, - 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, - 'priority': {'key': 'properties.priority', 'type': 'int'}, - 'weight': {'key': 'properties.weight', 'type': 'int'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'private_link_alias': {'key': 'properties.privateLinkAlias', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'private_link_location': {'key': 'properties.privateLinkLocation', 'type': 'str'}, - 'private_link_approval_message': {'key': 'properties.privateLinkApprovalMessage', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Route]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - host_name: Optional[str] = None, - http_port: Optional[int] = None, - https_port: Optional[int] = None, - origin_host_header: Optional[str] = None, - priority: Optional[int] = None, - weight: Optional[int] = None, - enabled: Optional[bool] = None, - private_link_alias: Optional[str] = None, - private_link_resource_id: Optional[str] = None, - private_link_location: Optional[str] = None, - private_link_approval_message: Optional[str] = None, + next_link: Optional[str] = None, **kwargs ): - super(OriginUpdateParameters, self).__init__(**kwargs) - self.host_name = host_name - self.http_port = http_port - self.https_port = https_port - self.origin_host_header = origin_host_header - self.priority = priority - self.weight = weight - self.enabled = enabled - 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_link_approval_message = private_link_approval_message + super(RouteListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link -class PolicySettings(msrest.serialization.Model): - """Defines contents of a web application firewall global configuration. +class RouteUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the domain to create. - :param enabled_state: describes if the policy is in enabled state or disabled state. Possible - values include: "Disabled", "Enabled". - :type enabled_state: str or ~azure.mgmt.cdn.models.PolicyEnabledState - :param mode: Describes if it is in detection mode or prevention mode at policy level. Possible - values include: "Prevention", "Detection". - :type mode: str or ~azure.mgmt.cdn.models.PolicyMode - :param default_redirect_url: If action type is redirect, this field represents the default - redirect URL for the client. - :type default_redirect_url: str - :param default_custom_block_response_status_code: If the action type is block, this field - defines the default customer overridable http response status code. Possible values include: - 200, 403, 405, 406, 429. - :type default_custom_block_response_status_code: str or ~azure.mgmt.cdn.models.Enum16 - :param default_custom_block_response_body: If the action type is block, customer can override - the response body. The body must be specified in base64 encoding. - :type default_custom_block_response_body: str + :param custom_domains: Domains referenced by this endpoint. + :type custom_domains: list[~azure.mgmt.cdn.models.ResourceReference] + :param origin_group: A reference to the origin group. + :type origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param origin_path: A directory path on the origin that AzureFrontDoor can use to retrieve + content from, e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param rule_sets: rule sets referenced by this endpoint. + :type rule_sets: list[~azure.mgmt.cdn.models.ResourceReference] + :param supported_protocols: List of supported protocols for this route. + :type supported_protocols: list[str or ~azure.mgmt.cdn.models.AFDEndpointProtocols] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param compression_settings: compression settings. + :type compression_settings: object + :param query_string_caching_behavior: Defines how AzureFrontDoor caches requests that include + query strings. You can ignore any query strings when caching, bypass caching to prevent + requests that contain query strings from being cached, or cache every request with a unique + URL. Possible values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this AzureFrontDoor + endpoint to optimize for, e.g. Download, Media services. With this information, AzureFrontDoor + can apply scenario driven optimization. Possible values include: "GeneralWebDelivery", + "GeneralMediaStreaming", "VideoOnDemandMediaStreaming", "LargeFileDownload", + "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param forwarding_protocol: Protocol this rule will use when forwarding traffic to backends. + Possible values include: "HttpOnly", "HttpsOnly", "MatchRequest". + :type forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol + :param link_to_default_domain: whether this route will be linked to the default endpoint + domain. Possible values include: "Enabled", "Disabled". + :type link_to_default_domain: str or ~azure.mgmt.cdn.models.LinkToDefaultDomain + :param https_redirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note + that this is a easy way to set up this rule and it will be the first rule that gets executed. + Possible values include: "Enabled", "Disabled". + :type https_redirect: str or ~azure.mgmt.cdn.models.HttpsRedirect + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState """ - _validation = { - 'default_custom_block_response_body': {'pattern': r'^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$'}, - } - _attribute_map = { + 'custom_domains': {'key': 'customDomains', 'type': '[ResourceReference]'}, + 'origin_group': {'key': 'originGroup', 'type': 'ResourceReference'}, + 'origin_path': {'key': 'originPath', 'type': 'str'}, + 'rule_sets': {'key': 'ruleSets', 'type': '[ResourceReference]'}, + 'supported_protocols': {'key': 'supportedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'patternsToMatch', 'type': '[str]'}, + 'compression_settings': {'key': 'compressionSettings', 'type': 'object'}, + 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, + 'forwarding_protocol': {'key': 'forwardingProtocol', 'type': 'str'}, + 'link_to_default_domain': {'key': 'linkToDefaultDomain', 'type': 'str'}, + 'https_redirect': {'key': 'httpsRedirect', 'type': 'str'}, 'enabled_state': {'key': 'enabledState', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'default_redirect_url': {'key': 'defaultRedirectUrl', 'type': 'str'}, - 'default_custom_block_response_status_code': {'key': 'defaultCustomBlockResponseStatusCode', 'type': 'int'}, - 'default_custom_block_response_body': {'key': 'defaultCustomBlockResponseBody', 'type': 'str'}, } def __init__( self, *, - enabled_state: Optional[Union[str, "PolicyEnabledState"]] = None, - mode: Optional[Union[str, "PolicyMode"]] = None, - default_redirect_url: Optional[str] = None, - default_custom_block_response_status_code: Optional[Union[int, "Enum16"]] = None, - default_custom_block_response_body: Optional[str] = None, + custom_domains: Optional[List["ResourceReference"]] = None, + origin_group: Optional["ResourceReference"] = None, + origin_path: Optional[str] = None, + rule_sets: Optional[List["ResourceReference"]] = None, + supported_protocols: Optional[List[Union[str, "AFDEndpointProtocols"]]] = None, + patterns_to_match: Optional[List[str]] = None, + compression_settings: Optional[object] = None, + query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, + optimization_type: Optional[Union[str, "OptimizationType"]] = None, + forwarding_protocol: Optional[Union[str, "ForwardingProtocol"]] = None, + link_to_default_domain: Optional[Union[str, "LinkToDefaultDomain"]] = None, + https_redirect: Optional[Union[str, "HttpsRedirect"]] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(PolicySettings, self).__init__(**kwargs) + super(RouteUpdatePropertiesParameters, self).__init__(**kwargs) + self.custom_domains = custom_domains + self.origin_group = origin_group + self.origin_path = origin_path + self.rule_sets = rule_sets + self.supported_protocols = supported_protocols + self.patterns_to_match = patterns_to_match + self.compression_settings = compression_settings + self.query_string_caching_behavior = query_string_caching_behavior + self.optimization_type = optimization_type + self.forwarding_protocol = forwarding_protocol + self.link_to_default_domain = link_to_default_domain + self.https_redirect = https_redirect self.enabled_state = enabled_state - self.mode = mode - self.default_redirect_url = default_redirect_url - self.default_custom_block_response_status_code = default_custom_block_response_status_code - self.default_custom_block_response_body = default_custom_block_response_body -class PostArgsMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for PostArgs match conditions. +class RouteProperties(AFDStateProperties, RouteUpdatePropertiesParameters): + """The JSON object that contains the properties of the Routes to create. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters". - :vartype odata_type: str - :param selector: Name of PostArg to be matched. - :type selector: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.PostArgsOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :param custom_domains: Domains referenced by this endpoint. + :type custom_domains: list[~azure.mgmt.cdn.models.ResourceReference] + :param origin_group: A reference to the origin group. + :type origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param origin_path: A directory path on the origin that AzureFrontDoor can use to retrieve + content from, e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param rule_sets: rule sets referenced by this endpoint. + :type rule_sets: list[~azure.mgmt.cdn.models.ResourceReference] + :param supported_protocols: List of supported protocols for this route. + :type supported_protocols: list[str or ~azure.mgmt.cdn.models.AFDEndpointProtocols] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param compression_settings: compression settings. + :type compression_settings: object + :param query_string_caching_behavior: Defines how AzureFrontDoor caches requests that include + query strings. You can ignore any query strings when caching, bypass caching to prevent + requests that contain query strings from being cached, or cache every request with a unique + URL. Possible values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this AzureFrontDoor + endpoint to optimize for, e.g. Download, Media services. With this information, AzureFrontDoor + can apply scenario driven optimization. Possible values include: "GeneralWebDelivery", + "GeneralMediaStreaming", "VideoOnDemandMediaStreaming", "LargeFileDownload", + "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param forwarding_protocol: Protocol this rule will use when forwarding traffic to backends. + Possible values include: "HttpOnly", "HttpsOnly", "MatchRequest". + :type forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol + :param link_to_default_domain: whether this route will be linked to the default endpoint + domain. Possible values include: "Enabled", "Disabled". + :type link_to_default_domain: str or ~azure.mgmt.cdn.models.LinkToDefaultDomain + :param https_redirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note + that this is a easy way to set up this rule and it will be the first rule that gets executed. + Possible values include: "Enabled", "Disabled". + :type https_redirect: str or ~azure.mgmt.cdn.models.HttpsRedirect + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'selector': {'key': 'selector', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'custom_domains': {'key': 'customDomains', 'type': '[ResourceReference]'}, + 'origin_group': {'key': 'originGroup', 'type': 'ResourceReference'}, + 'origin_path': {'key': 'originPath', 'type': 'str'}, + 'rule_sets': {'key': 'ruleSets', 'type': '[ResourceReference]'}, + 'supported_protocols': {'key': 'supportedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'patternsToMatch', 'type': '[str]'}, + 'compression_settings': {'key': 'compressionSettings', 'type': 'object'}, + 'query_string_caching_behavior': {'key': 'queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'optimizationType', 'type': 'str'}, + 'forwarding_protocol': {'key': 'forwardingProtocol', 'type': 'str'}, + 'link_to_default_domain': {'key': 'linkToDefaultDomain', 'type': 'str'}, + 'https_redirect': {'key': 'httpsRedirect', 'type': 'str'}, + 'enabled_state': {'key': 'enabledState', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRulePostArgsConditionParameters" + def __init__( + self, + *, + custom_domains: Optional[List["ResourceReference"]] = None, + origin_group: Optional["ResourceReference"] = None, + origin_path: Optional[str] = None, + rule_sets: Optional[List["ResourceReference"]] = None, + supported_protocols: Optional[List[Union[str, "AFDEndpointProtocols"]]] = None, + patterns_to_match: Optional[List[str]] = None, + compression_settings: Optional[object] = None, + query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, + optimization_type: Optional[Union[str, "OptimizationType"]] = None, + forwarding_protocol: Optional[Union[str, "ForwardingProtocol"]] = None, + link_to_default_domain: Optional[Union[str, "LinkToDefaultDomain"]] = None, + https_redirect: Optional[Union[str, "HttpsRedirect"]] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, + **kwargs + ): + super(RouteProperties, self).__init__(custom_domains=custom_domains, origin_group=origin_group, origin_path=origin_path, rule_sets=rule_sets, supported_protocols=supported_protocols, patterns_to_match=patterns_to_match, compression_settings=compression_settings, query_string_caching_behavior=query_string_caching_behavior, optimization_type=optimization_type, forwarding_protocol=forwarding_protocol, link_to_default_domain=link_to_default_domain, https_redirect=https_redirect, enabled_state=enabled_state, **kwargs) + self.custom_domains = custom_domains + self.origin_group = origin_group + self.origin_path = origin_path + self.rule_sets = rule_sets + self.supported_protocols = supported_protocols + self.patterns_to_match = patterns_to_match + self.compression_settings = compression_settings + self.query_string_caching_behavior = query_string_caching_behavior + self.optimization_type = optimization_type + self.forwarding_protocol = forwarding_protocol + self.link_to_default_domain = link_to_default_domain + self.https_redirect = https_redirect + self.enabled_state = enabled_state + self.provisioning_state = None + self.deployment_status = None + + +class RouteUpdateParameters(msrest.serialization.Model): + """The domain JSON object required for domain creation or update. + + :param custom_domains: Domains referenced by this endpoint. + :type custom_domains: list[~azure.mgmt.cdn.models.ResourceReference] + :param origin_group: A reference to the origin group. + :type origin_group: ~azure.mgmt.cdn.models.ResourceReference + :param origin_path: A directory path on the origin that AzureFrontDoor can use to retrieve + content from, e.g. contoso.cloudapp.net/originpath. + :type origin_path: str + :param rule_sets: rule sets referenced by this endpoint. + :type rule_sets: list[~azure.mgmt.cdn.models.ResourceReference] + :param supported_protocols: List of supported protocols for this route. + :type supported_protocols: list[str or ~azure.mgmt.cdn.models.AFDEndpointProtocols] + :param patterns_to_match: The route patterns of the rule. + :type patterns_to_match: list[str] + :param compression_settings: compression settings. + :type compression_settings: object + :param query_string_caching_behavior: Defines how AzureFrontDoor caches requests that include + query strings. You can ignore any query strings when caching, bypass caching to prevent + requests that contain query strings from being cached, or cache every request with a unique + URL. Possible values include: "IgnoreQueryString", "BypassCaching", "UseQueryString", "NotSet". + :type query_string_caching_behavior: str or ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this AzureFrontDoor + endpoint to optimize for, e.g. Download, Media services. With this information, AzureFrontDoor + can apply scenario driven optimization. Possible values include: "GeneralWebDelivery", + "GeneralMediaStreaming", "VideoOnDemandMediaStreaming", "LargeFileDownload", + "DynamicSiteAcceleration". + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param forwarding_protocol: Protocol this rule will use when forwarding traffic to backends. + Possible values include: "HttpOnly", "HttpsOnly", "MatchRequest". + :type forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol + :param link_to_default_domain: whether this route will be linked to the default endpoint + domain. Possible values include: "Enabled", "Disabled". + :type link_to_default_domain: str or ~azure.mgmt.cdn.models.LinkToDefaultDomain + :param https_redirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note + that this is a easy way to set up this rule and it will be the first rule that gets executed. + Possible values include: "Enabled", "Disabled". + :type https_redirect: str or ~azure.mgmt.cdn.models.HttpsRedirect + :param enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or + 'Disabled'. Possible values include: "Enabled", "Disabled". + :type enabled_state: str or ~azure.mgmt.cdn.models.EnabledState + """ + + _attribute_map = { + 'custom_domains': {'key': 'properties.customDomains', 'type': '[ResourceReference]'}, + 'origin_group': {'key': 'properties.originGroup', 'type': 'ResourceReference'}, + 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, + 'rule_sets': {'key': 'properties.ruleSets', 'type': '[ResourceReference]'}, + 'supported_protocols': {'key': 'properties.supportedProtocols', 'type': '[str]'}, + 'patterns_to_match': {'key': 'properties.patternsToMatch', 'type': '[str]'}, + 'compression_settings': {'key': 'properties.compressionSettings', 'type': 'object'}, + 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'str'}, + 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, + 'forwarding_protocol': {'key': 'properties.forwardingProtocol', 'type': 'str'}, + 'link_to_default_domain': {'key': 'properties.linkToDefaultDomain', 'type': 'str'}, + 'https_redirect': {'key': 'properties.httpsRedirect', 'type': 'str'}, + 'enabled_state': {'key': 'properties.enabledState', 'type': 'str'}, + } def __init__( self, *, - operator: Union[str, "PostArgsOperator"], - selector: Optional[str] = None, - negate_condition: Optional[bool] = None, - match_values: Optional[List[str]] = None, - transforms: Optional[List[Union[str, "Transform"]]] = None, + custom_domains: Optional[List["ResourceReference"]] = None, + origin_group: Optional["ResourceReference"] = None, + origin_path: Optional[str] = None, + rule_sets: Optional[List["ResourceReference"]] = None, + supported_protocols: Optional[List[Union[str, "AFDEndpointProtocols"]]] = None, + patterns_to_match: Optional[List[str]] = None, + compression_settings: Optional[object] = None, + query_string_caching_behavior: Optional[Union[str, "QueryStringCachingBehavior"]] = None, + optimization_type: Optional[Union[str, "OptimizationType"]] = None, + forwarding_protocol: Optional[Union[str, "ForwardingProtocol"]] = None, + link_to_default_domain: Optional[Union[str, "LinkToDefaultDomain"]] = None, + https_redirect: Optional[Union[str, "HttpsRedirect"]] = None, + enabled_state: Optional[Union[str, "EnabledState"]] = None, **kwargs ): - super(PostArgsMatchConditionParameters, self).__init__(**kwargs) - self.selector = selector - self.operator = operator - self.negate_condition = negate_condition - self.match_values = match_values - self.transforms = transforms + super(RouteUpdateParameters, self).__init__(**kwargs) + self.custom_domains = custom_domains + self.origin_group = origin_group + self.origin_path = origin_path + self.rule_sets = rule_sets + self.supported_protocols = supported_protocols + self.patterns_to_match = patterns_to_match + self.compression_settings = compression_settings + self.query_string_caching_behavior = query_string_caching_behavior + self.optimization_type = optimization_type + self.forwarding_protocol = forwarding_protocol + self.link_to_default_domain = link_to_default_domain + self.https_redirect = https_redirect + self.enabled_state = enabled_state -class Profile(TrackedResource): - """CDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider and pricing tier. +class Rule(ProxyResource): + """Friendly Rules name mapping to the any Rules or secret related information. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: Required. The pricing tier (defines a CDN provider, feature list and rate) of the - CDN profile. - :type sku: ~azure.mgmt.cdn.models.Sku - :ivar resource_state: Resource status of the profile. Possible values include: "Creating", - "Active", "Deleting", "Disabled". - :vartype resource_state: str or ~azure.mgmt.cdn.models.ProfileResourceState - :ivar provisioning_state: Provisioning status of the profile. - :vartype provisioning_state: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :param order: The order in which the rules are applied for the endpoint. Possible values + {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. + Rule with order 0 is a special rule. It does not require any condition and actions listed in it + will always be applied. + :type order: int + :param conditions: A list of conditions that must be matched for the actions to be executed. + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + :param actions: A list of actions that are executed when all the conditions of a rule are + satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :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.cdn.models.MatchProcessingBehavior + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'required': True}, - 'resource_state': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'order': {'key': 'properties.order', 'type': 'int'}, + 'conditions': {'key': 'properties.conditions', 'type': '[DeliveryRuleCondition]'}, + 'actions': {'key': 'properties.actions', 'type': '[DeliveryRuleAction]'}, + 'match_processing_behavior': {'key': 'properties.matchProcessingBehavior', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, } def __init__( self, *, - location: str, - sku: "Sku", - tags: Optional[Dict[str, str]] = None, + order: Optional[int] = None, + conditions: Optional[List["DeliveryRuleCondition"]] = None, + actions: Optional[List["DeliveryRuleAction"]] = None, + match_processing_behavior: Optional[Union[str, "MatchProcessingBehavior"]] = None, **kwargs ): - super(Profile, self).__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.resource_state = None + super(Rule, self).__init__(**kwargs) + self.order = order + self.conditions = conditions + self.actions = actions + self.match_processing_behavior = match_processing_behavior self.provisioning_state = None + self.deployment_status = None -class ProfileListResult(msrest.serialization.Model): - """Result of the request to list profiles. It contains a list of profile objects and a URL link to get the next set of results. +class RuleListResult(msrest.serialization.Model): + """Result of the request to list rules. It contains a list of rule objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of CDN profiles within a resource group. - :vartype value: list[~azure.mgmt.cdn.models.Profile] - :param next_link: URL to get the next set of profile objects if there are any. + :ivar value: List of AzureFrontDoor rules within a rule set. + :vartype value: list[~azure.mgmt.cdn.models.Rule] + :param next_link: URL to get the next set of rule objects if there are any. :type next_link: str """ @@ -4208,44 +7672,124 @@ class ProfileListResult(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[Profile]'}, + 'value': {'key': 'value', 'type': '[Rule]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - next_link: Optional[str] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(RuleListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class RuleUpdatePropertiesParameters(msrest.serialization.Model): + """The JSON object that contains the properties of the domain to create. + + :param order: The order in which the rules are applied for the endpoint. Possible values + {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. + Rule with order 0 is a special rule. It does not require any condition and actions listed in it + will always be applied. + :type order: int + :param conditions: A list of conditions that must be matched for the actions to be executed. + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + :param actions: A list of actions that are executed when all the conditions of a rule are + satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :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.cdn.models.MatchProcessingBehavior + """ + + _attribute_map = { + 'order': {'key': 'order', 'type': 'int'}, + 'conditions': {'key': 'conditions', 'type': '[DeliveryRuleCondition]'}, + 'actions': {'key': 'actions', 'type': '[DeliveryRuleAction]'}, + 'match_processing_behavior': {'key': 'matchProcessingBehavior', 'type': 'str'}, + } + + def __init__( + self, + *, + order: Optional[int] = None, + conditions: Optional[List["DeliveryRuleCondition"]] = None, + actions: Optional[List["DeliveryRuleAction"]] = None, + match_processing_behavior: Optional[Union[str, "MatchProcessingBehavior"]] = None, **kwargs ): - super(ProfileListResult, self).__init__(**kwargs) - self.value = None - self.next_link = next_link + super(RuleUpdatePropertiesParameters, self).__init__(**kwargs) + self.order = order + self.conditions = conditions + self.actions = actions + self.match_processing_behavior = match_processing_behavior -class ProfileUpdateParameters(msrest.serialization.Model): - """Properties required to update a profile. +class RuleProperties(AFDStateProperties, RuleUpdatePropertiesParameters): + """The JSON object that contains the properties of the Rules to create. - :param tags: A set of tags. Profile tags. - :type tags: dict[str, str] + Variables are only populated by the server, and will be ignored when sending a request. + + :param order: The order in which the rules are applied for the endpoint. Possible values + {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. + Rule with order 0 is a special rule. It does not require any condition and actions listed in it + will always be applied. + :type order: int + :param conditions: A list of conditions that must be matched for the actions to be executed. + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + :param actions: A list of actions that are executed when all the conditions of a rule are + satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :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.cdn.models.MatchProcessingBehavior + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + } + _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + 'order': {'key': 'order', 'type': 'int'}, + 'conditions': {'key': 'conditions', 'type': '[DeliveryRuleCondition]'}, + 'actions': {'key': 'actions', 'type': '[DeliveryRuleAction]'}, + 'match_processing_behavior': {'key': 'matchProcessingBehavior', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + order: Optional[int] = None, + conditions: Optional[List["DeliveryRuleCondition"]] = None, + actions: Optional[List["DeliveryRuleAction"]] = None, + match_processing_behavior: Optional[Union[str, "MatchProcessingBehavior"]] = None, **kwargs ): - super(ProfileUpdateParameters, self).__init__(**kwargs) - self.tags = tags + super(RuleProperties, self).__init__(order=order, conditions=conditions, actions=actions, match_processing_behavior=match_processing_behavior, **kwargs) + self.order = order + self.conditions = conditions + self.actions = actions + self.match_processing_behavior = match_processing_behavior + self.provisioning_state = None + self.deployment_status = None -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. +class RuleSet(ProxyResource): + """Friendly RuleSet name mapping to the any RuleSet or secret related information. Variables are only populated by the server, and will be ignored when sending a request. @@ -4255,631 +7799,528 @@ class ProxyResource(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ProxyResource, self).__init__(**kwargs) - - -class PurgeParameters(msrest.serialization.Model): - """Parameters required for content purge. - - All required parameters must be populated in order to send to Azure. - - :param content_paths: Required. The path to the content to be purged. Can describe a file path - or a wild card directory. - :type content_paths: list[str] - """ - - _validation = { - 'content_paths': {'required': True}, - } - - _attribute_map = { - 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, - } - - def __init__( - self, - *, - content_paths: List[str], - **kwargs - ): - super(PurgeParameters, self).__init__(**kwargs) - self.content_paths = content_paths + super(RuleSet, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_status = None -class QueryStringMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for QueryString match conditions. +class RuleSetListResult(msrest.serialization.Model): + """Result of the request to list rule sets. It contains a list of rule set objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.QueryStringOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :ivar value: List of AzureFrontDoor rule sets within a profile. + :vartype value: list[~azure.mgmt.cdn.models.RuleSet] + :param next_link: URL to get the next set of rule set objects if there are any. + :type next_link: str """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'value': {'key': 'value', 'type': '[RuleSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleQueryStringConditionParameters" - def __init__( self, *, - operator: Union[str, "QueryStringOperator"], - negate_condition: Optional[bool] = None, - match_values: Optional[List[str]] = None, - transforms: Optional[List[Union[str, "Transform"]]] = None, + next_link: Optional[str] = None, **kwargs ): - super(QueryStringMatchConditionParameters, self).__init__(**kwargs) - self.operator = operator - self.negate_condition = negate_condition - self.match_values = match_values - self.transforms = transforms + super(RuleSetListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link -class RateLimitRule(CustomRule): - """Defines a rate limiting rule that can be included in a waf policy. +class RuleSetProperties(AFDStateProperties): + """The JSON object that contains the properties of the Rule Set to create. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param name: Required. Defines the name of the custom rule. - :type name: str - :param enabled_state: Describes if the custom rule is in enabled or disabled state. Defaults to - Enabled if not specified. Possible values include: "Disabled", "Enabled". - :type enabled_state: str or ~azure.mgmt.cdn.models.CustomRuleEnabledState - :param priority: Required. Defines in what order this rule be evaluated in the overall list of - custom rules. - :type priority: int - :param match_conditions: Required. List of match conditions. - :type match_conditions: list[~azure.mgmt.cdn.models.MatchCondition] - :param action: Required. Describes what action to be applied when rule matches. Possible values - include: "Allow", "Block", "Log", "Redirect". - :type action: str or ~azure.mgmt.cdn.models.ActionType - :param rate_limit_threshold: Required. Defines rate limit threshold. - :type rate_limit_threshold: int - :param rate_limit_duration_in_minutes: Required. Defines rate limit duration. Default is 1 - minute. - :type rate_limit_duration_in_minutes: int + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus """ _validation = { - 'name': {'required': True}, - 'priority': {'required': True, 'maximum': 1000, 'minimum': 0}, - 'match_conditions': {'required': True}, - 'action': {'required': True}, - 'rate_limit_threshold': {'required': True, 'minimum': 0}, - 'rate_limit_duration_in_minutes': {'required': True, 'maximum': 60, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'enabled_state': {'key': 'enabledState', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, - 'action': {'key': 'action', 'type': 'str'}, - 'rate_limit_threshold': {'key': 'rateLimitThreshold', 'type': 'int'}, - 'rate_limit_duration_in_minutes': {'key': 'rateLimitDurationInMinutes', 'type': 'int'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, } def __init__( self, - *, - name: str, - priority: int, - match_conditions: List["MatchCondition"], - action: Union[str, "ActionType"], - rate_limit_threshold: int, - rate_limit_duration_in_minutes: int, - enabled_state: Optional[Union[str, "CustomRuleEnabledState"]] = None, **kwargs ): - super(RateLimitRule, self).__init__(name=name, enabled_state=enabled_state, priority=priority, match_conditions=match_conditions, action=action, **kwargs) - self.rate_limit_threshold = rate_limit_threshold - self.rate_limit_duration_in_minutes = rate_limit_duration_in_minutes + super(RuleSetProperties, self).__init__(**kwargs) -class RateLimitRuleList(msrest.serialization.Model): - """Defines contents of rate limit rules. +class RuleUpdateParameters(msrest.serialization.Model): + """The domain JSON object required for domain creation or update. - :param rules: List of rules. - :type rules: list[~azure.mgmt.cdn.models.RateLimitRule] + :param order: The order in which the rules are applied for the endpoint. Possible values + {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. + Rule with order 0 is a special rule. It does not require any condition and actions listed in it + will always be applied. + :type order: int + :param conditions: A list of conditions that must be matched for the actions to be executed. + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + :param actions: A list of actions that are executed when all the conditions of a rule are + satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :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.cdn.models.MatchProcessingBehavior """ _attribute_map = { - 'rules': {'key': 'rules', 'type': '[RateLimitRule]'}, + 'order': {'key': 'properties.order', 'type': 'int'}, + 'conditions': {'key': 'properties.conditions', 'type': '[DeliveryRuleCondition]'}, + 'actions': {'key': 'properties.actions', 'type': '[DeliveryRuleAction]'}, + 'match_processing_behavior': {'key': 'properties.matchProcessingBehavior', 'type': 'str'}, } def __init__( self, *, - rules: Optional[List["RateLimitRule"]] = None, + order: Optional[int] = None, + conditions: Optional[List["DeliveryRuleCondition"]] = None, + actions: Optional[List["DeliveryRuleAction"]] = None, + match_processing_behavior: Optional[Union[str, "MatchProcessingBehavior"]] = None, **kwargs ): - super(RateLimitRuleList, self).__init__(**kwargs) - self.rules = rules + super(RuleUpdateParameters, self).__init__(**kwargs) + self.order = order + self.conditions = conditions + self.actions = actions + self.match_processing_behavior = match_processing_behavior -class RemoteAddressMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RemoteAddress match conditions. +class Secret(ProxyResource): + """Friendly Secret name mapping to the any Secret or secret related information. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "IPMatch", "GeoMatch". - :type operator: str or ~azure.mgmt.cdn.models.RemoteAddressOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: 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 match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :param parameters: object which contains secret parameters. + :type parameters: ~azure.mgmt.cdn.models.SecretParameters """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': 'SecretParameters'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters" - def __init__( self, *, - operator: Union[str, "RemoteAddressOperator"], - negate_condition: Optional[bool] = None, - match_values: Optional[List[str]] = None, - transforms: Optional[List[Union[str, "Transform"]]] = None, + parameters: Optional["SecretParameters"] = None, **kwargs ): - super(RemoteAddressMatchConditionParameters, self).__init__(**kwargs) - self.operator = operator - self.negate_condition = negate_condition - self.match_values = match_values - self.transforms = transforms + super(Secret, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_status = None + self.parameters = parameters -class RequestBodyMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RequestBody match conditions. +class SecretListResult(msrest.serialization.Model): + """Result of the request to list secrets. It contains a list of Secret objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.RequestBodyOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :ivar value: List of AzureFrontDoor secrets within a profile. + :vartype value: list[~azure.mgmt.cdn.models.Secret] + :param next_link: URL to get the next set of Secret objects if there are any. + :type next_link: str """ - - _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + + _validation = { + 'value': {'readonly': True}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestBodyConditionParameters" + _attribute_map = { + 'value': {'key': 'value', 'type': '[Secret]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } def __init__( self, *, - operator: Union[str, "RequestBodyOperator"], - negate_condition: Optional[bool] = None, - match_values: Optional[List[str]] = None, - transforms: Optional[List[Union[str, "Transform"]]] = None, + next_link: Optional[str] = None, **kwargs ): - super(RequestBodyMatchConditionParameters, self).__init__(**kwargs) - self.operator = operator - self.negate_condition = negate_condition - self.match_values = match_values - self.transforms = transforms + super(SecretListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link -class RequestHeaderMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RequestHeader match conditions. +class SecretProperties(AFDStateProperties): + """The JSON object that contains the properties of the Secret to create. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters". - :vartype odata_type: str - :param selector: Name of Header to be matched. - :type selector: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.RequestHeaderOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :param parameters: object which contains secret parameters. + :type parameters: ~azure.mgmt.cdn.models.SecretParameters """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'selector': {'key': 'selector', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'SecretParameters'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestHeaderConditionParameters" - def __init__( self, *, - operator: Union[str, "RequestHeaderOperator"], - selector: Optional[str] = None, - negate_condition: Optional[bool] = None, - match_values: Optional[List[str]] = None, - transforms: Optional[List[Union[str, "Transform"]]] = None, + parameters: Optional["SecretParameters"] = None, **kwargs ): - super(RequestHeaderMatchConditionParameters, self).__init__(**kwargs) - self.selector = selector - self.operator = operator - self.negate_condition = negate_condition - self.match_values = match_values - self.transforms = transforms + super(SecretProperties, self).__init__(**kwargs) + self.parameters = parameters -class RequestMethodMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RequestMethod match conditions. +class SecurityPolicy(ProxyResource): + """SecurityPolicy association for AzureFrontDoor profile. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Equal". - :type operator: str or ~azure.mgmt.cdn.models.RequestMethodOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str or - ~azure.mgmt.cdn.models.RequestMethodMatchConditionParametersMatchValuesItem] + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure.mgmt.cdn.models.SystemData + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :param parameters: object which contains security policy parameters. + :type parameters: ~azure.mgmt.cdn.models.SecurityPolicyWebApplicationFirewallParameters """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': 'SecurityPolicyWebApplicationFirewallParameters'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters" - def __init__( self, *, - operator: Union[str, "RequestMethodOperator"], - negate_condition: Optional[bool] = None, - match_values: Optional[List[Union[str, "RequestMethodMatchConditionParametersMatchValuesItem"]]] = None, + parameters: Optional["SecurityPolicyWebApplicationFirewallParameters"] = None, **kwargs ): - super(RequestMethodMatchConditionParameters, self).__init__(**kwargs) - self.operator = operator - self.negate_condition = negate_condition - self.match_values = match_values + super(SecurityPolicy, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_status = None + self.parameters = parameters -class RequestSchemeMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RequestScheme match conditions. +class SecurityPolicyListResult(msrest.serialization.Model): + """Result of the request to list security policies. It contains a list of security policy objects and a URL link to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters". - :vartype odata_type: str - :ivar operator: Required. Describes operator to be matched. Default value: "Equal". - :vartype operator: str - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str or - ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParametersMatchValuesItem] + :ivar value: List of Security policies within a profile. + :vartype value: list[~azure.mgmt.cdn.models.SecurityPolicy] + :param next_link: URL to get the next set of security policy objects if there is any. + :type next_link: str """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True, 'constant': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'value': {'key': 'value', 'type': '[SecurityPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestSchemeConditionParameters" - operator = "Equal" - def __init__( self, *, - negate_condition: Optional[bool] = None, - match_values: Optional[List[Union[str, "RequestSchemeMatchConditionParametersMatchValuesItem"]]] = None, + next_link: Optional[str] = None, **kwargs ): - super(RequestSchemeMatchConditionParameters, self).__init__(**kwargs) - self.negate_condition = negate_condition - self.match_values = match_values + super(SecurityPolicyListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link -class RequestUriMatchConditionParameters(msrest.serialization.Model): - """Defines the parameters for RequestUri match conditions. +class SecurityPolicyParameters(msrest.serialization.Model): + """The json object containing security policy parameters. - Variables are only populated by the server, and will be ignored when sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SecurityPolicyWebApplicationFirewallParameters. All required parameters must be populated in order to send to Azure. - :ivar odata_type: Required. Default value: - "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters". - :vartype odata_type: str - :param operator: Required. Describes operator to be matched. Possible values include: "Any", - "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". - :type operator: str or ~azure.mgmt.cdn.models.RequestUriOperator - :param negate_condition: Describes if this is negate condition or not. - :type negate_condition: bool - :param match_values: The match value for the condition of the delivery rule. - :type match_values: list[str] - :param transforms: List of transforms. - :type transforms: list[str or ~azure.mgmt.cdn.models.Transform] + :param type: Required. The type of the Security policy to create.Constant filled by server. + Possible values include: "WebApplicationFirewall". + :type type: str or ~azure.mgmt.cdn.models.SecurityPolicyType """ _validation = { - 'odata_type': {'required': True, 'constant': True}, - 'operator': {'required': True}, + 'type': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'negate_condition': {'key': 'negateCondition', 'type': 'bool'}, - 'match_values': {'key': 'matchValues', 'type': '[str]'}, - 'transforms': {'key': 'transforms', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'str'}, } - odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestUriConditionParameters" + _subtype_map = { + 'type': {'WebApplicationFirewall': 'SecurityPolicyWebApplicationFirewallParameters'} + } def __init__( self, - *, - operator: Union[str, "RequestUriOperator"], - negate_condition: Optional[bool] = None, - match_values: Optional[List[str]] = None, - transforms: Optional[List[Union[str, "Transform"]]] = None, **kwargs ): - super(RequestUriMatchConditionParameters, self).__init__(**kwargs) - self.operator = operator - self.negate_condition = negate_condition - self.match_values = match_values - self.transforms = transforms + super(SecurityPolicyParameters, self).__init__(**kwargs) + self.type = None # type: Optional[str] -class ResourceReference(msrest.serialization.Model): - """Reference to another resource. +class SecurityPolicyProperties(AFDStateProperties): + """The json object that contains properties required to create a security policy. - :param id: Resource ID. - :type id: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: Provisioning status. Possible values include: "Succeeded", "Failed", + "Updating", "Deleting", "Creating". + :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState + :ivar deployment_status: Possible values include: "NotStarted", "InProgress", "Succeeded", + "Failed". + :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus + :param parameters: object which contains security policy parameters. + :type parameters: ~azure.mgmt.cdn.models.SecurityPolicyWebApplicationFirewallParameters """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'deployment_status': {'readonly': True}, + } + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_status': {'key': 'deploymentStatus', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'SecurityPolicyWebApplicationFirewallParameters'}, } def __init__( self, *, - id: Optional[str] = None, + parameters: Optional["SecurityPolicyWebApplicationFirewallParameters"] = None, **kwargs ): - super(ResourceReference, self).__init__(**kwargs) - self.id = id - + super(SecurityPolicyProperties, self).__init__(**kwargs) + self.parameters = parameters -class ResourceUsage(msrest.serialization.Model): - """Output of check resource usage API. - Variables are only populated by the server, and will be ignored when sending a request. +class SecurityPolicyWebApplicationFirewallAssociation(msrest.serialization.Model): + """settings for security policy patterns to match. - :ivar resource_type: Resource type for which the usage is provided. - :vartype resource_type: str - :ivar unit: Unit of the usage. e.g. Count. - :vartype unit: str - :ivar current_value: Actual value of usage on the specified resource type. - :vartype current_value: int - :ivar limit: Quota of the specified resource type. - :vartype limit: int + :param domains: List of domains. + :type domains: list[~azure.mgmt.cdn.models.ResourceReference] + :param patterns_to_match: List of paths. + :type patterns_to_match: list[str] """ - _validation = { - 'resource_type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - } - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, + 'domains': {'key': 'domains', 'type': '[ResourceReference]'}, + 'patterns_to_match': {'key': 'patternsToMatch', 'type': '[str]'}, } def __init__( self, + *, + domains: Optional[List["ResourceReference"]] = None, + patterns_to_match: Optional[List[str]] = None, **kwargs ): - super(ResourceUsage, self).__init__(**kwargs) - self.resource_type = None - self.unit = None - self.current_value = None - self.limit = None + super(SecurityPolicyWebApplicationFirewallAssociation, self).__init__(**kwargs) + self.domains = domains + self.patterns_to_match = patterns_to_match -class ResourceUsageListResult(msrest.serialization.Model): - """Output of check resource usage API. +class SecurityPolicyWebApplicationFirewallParameters(SecurityPolicyParameters): + """The json object containing security policy waf parameters. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: List of resource usages. - :vartype value: list[~azure.mgmt.cdn.models.ResourceUsage] - :param next_link: URL to get the next set of custom domain objects if there are any. - :type next_link: str + :param type: Required. The type of the Security policy to create.Constant filled by server. + Possible values include: "WebApplicationFirewall". + :type type: str or ~azure.mgmt.cdn.models.SecurityPolicyType + :param waf_policy: Resource ID. + :type waf_policy: ~azure.mgmt.cdn.models.ResourceReference + :param associations: Waf associations. + :type associations: + list[~azure.mgmt.cdn.models.SecurityPolicyWebApplicationFirewallAssociation] """ _validation = { - 'value': {'readonly': True}, + 'type': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceUsage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'waf_policy': {'key': 'wafPolicy', 'type': 'ResourceReference'}, + 'associations': {'key': 'associations', 'type': '[SecurityPolicyWebApplicationFirewallAssociation]'}, } def __init__( self, *, - next_link: Optional[str] = None, + waf_policy: Optional["ResourceReference"] = None, + associations: Optional[List["SecurityPolicyWebApplicationFirewallAssociation"]] = None, **kwargs ): - super(ResourceUsageListResult, self).__init__(**kwargs) - self.value = None - self.next_link = next_link + super(SecurityPolicyWebApplicationFirewallParameters, self).__init__(**kwargs) + self.type = 'WebApplicationFirewall' # type: str + self.waf_policy = waf_policy + self.associations = associations -class ResponseBasedOriginErrorDetectionParameters(msrest.serialization.Model): - """The JSON object that contains the properties to determine origin health using real requests/responses. - - :param response_based_detected_error_types: Type of response errors for real user requests for - which origin will be deemed unhealthy. Possible values include: "None", "TcpErrorsOnly", - "TcpAndHttpErrors". - :type response_based_detected_error_types: str or - ~azure.mgmt.cdn.models.ResponseBasedDetectedErrorTypes - :param response_based_failover_threshold_percentage: The percentage of failed requests in the - sample where failover should trigger. - :type response_based_failover_threshold_percentage: int - :param http_error_ranges: The list of Http status code ranges that are considered as server - errors for origin and it is marked as unhealthy. - :type http_error_ranges: list[~azure.mgmt.cdn.models.HttpErrorRangeParameters] - """ +class SharedPrivateLinkResourceProperties(msrest.serialization.Model): + """Describes the properties of an existing Shared Private Link Resource to use when connecting to a private origin. - _validation = { - 'response_based_failover_threshold_percentage': {'maximum': 100, 'minimum': 0}, - } + :param private_link: The resource id of the resource the shared private link resource is for. + :type private_link: ~azure.mgmt.cdn.models.ResourceReference + :param private_link_location: The location of the shared private link resource. + :type private_link_location: str + :param group_id: The group id from the provider of resource the shared private link resource is + for. + :type group_id: str + :param request_message: The request message for requesting approval of the shared private link + resource. + :type request_message: str + :param status: Status of the shared private link resource. Can be Pending, Approved, Rejected, + Disconnected, or Timeout. Possible values include: "Pending", "Approved", "Rejected", + "Disconnected", "Timeout". + :type status: str or ~azure.mgmt.cdn.models.SharedPrivateLinkResourceStatus + """ _attribute_map = { - 'response_based_detected_error_types': {'key': 'responseBasedDetectedErrorTypes', 'type': 'str'}, - 'response_based_failover_threshold_percentage': {'key': 'responseBasedFailoverThresholdPercentage', 'type': 'int'}, - 'http_error_ranges': {'key': 'httpErrorRanges', 'type': '[HttpErrorRangeParameters]'}, + 'private_link': {'key': 'privateLink', 'type': 'ResourceReference'}, + 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'request_message': {'key': 'requestMessage', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( self, *, - response_based_detected_error_types: Optional[Union[str, "ResponseBasedDetectedErrorTypes"]] = None, - response_based_failover_threshold_percentage: Optional[int] = None, - http_error_ranges: Optional[List["HttpErrorRangeParameters"]] = None, + private_link: Optional["ResourceReference"] = None, + private_link_location: Optional[str] = None, + group_id: Optional[str] = None, + request_message: Optional[str] = None, + status: Optional[Union[str, "SharedPrivateLinkResourceStatus"]] = None, **kwargs ): - super(ResponseBasedOriginErrorDetectionParameters, self).__init__(**kwargs) - self.response_based_detected_error_types = response_based_detected_error_types - self.response_based_failover_threshold_percentage = response_based_failover_threshold_percentage - self.http_error_ranges = http_error_ranges + super(SharedPrivateLinkResourceProperties, self).__init__(**kwargs) + self.private_link = private_link + self.private_link_location = private_link_location + self.group_id = group_id + self.request_message = request_message + self.status = status class Sku(msrest.serialization.Model): @@ -4887,7 +8328,9 @@ class Sku(msrest.serialization.Model): :param name: Name of the pricing tier. Possible values include: "Standard_Verizon", "Premium_Verizon", "Custom_Verizon", "Standard_Akamai", "Standard_ChinaCdn", - "Standard_Microsoft", "Premium_ChinaCdn". + "Standard_Microsoft", "Premium_ChinaCdn", "Standard_AzureFrontDoor", "Premium_AzureFrontDoor", + "Standard_955BandWidth_ChinaCdn", "Standard_AvgBandWidth_ChinaCdn", "StandardPlus_ChinaCdn", + "StandardPlus_955BandWidth_ChinaCdn", "StandardPlus_AvgBandWidth_ChinaCdn". :type name: str or ~azure.mgmt.cdn.models.SkuName """ @@ -4955,6 +8398,54 @@ def __init__( self.supported_optimization_types = None +class SystemData(msrest.serialization.Model): + """Read only system data. + + :param created_by: An identifier for the identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "user", "application", "managedIdentity", "key". + :type created_by_type: str or ~azure.mgmt.cdn.models.IdentityType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: An identifier for the identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "user", "application", "managedIdentity", "key". + :type last_modified_by_type: str or ~azure.mgmt.cdn.models.IdentityType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "IdentityType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "IdentityType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + class UrlFileExtensionMatchConditionParameters(msrest.serialization.Model): """Defines the parameters for UrlFileExtension match conditions. @@ -4967,7 +8458,7 @@ class UrlFileExtensionMatchConditionParameters(msrest.serialization.Model): :vartype odata_type: str :param operator: Required. Describes operator to be matched. Possible values include: "Any", "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". + "GreaterThanOrEqual", "RegEx". :type operator: str or ~azure.mgmt.cdn.models.UrlFileExtensionOperator :param negate_condition: Describes if this is negate condition or not. :type negate_condition: bool @@ -5020,7 +8511,7 @@ class UrlFileNameMatchConditionParameters(msrest.serialization.Model): :vartype odata_type: str :param operator: Required. Describes operator to be matched. Possible values include: "Any", "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual". + "GreaterThanOrEqual", "RegEx". :type operator: str or ~azure.mgmt.cdn.models.UrlFileNameOperator :param negate_condition: Describes if this is negate condition or not. :type negate_condition: bool @@ -5073,7 +8564,7 @@ class UrlPathMatchConditionParameters(msrest.serialization.Model): :vartype odata_type: str :param operator: Required. Describes operator to be matched. Possible values include: "Any", "Equal", "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan", - "GreaterThanOrEqual", "Wildcard". + "GreaterThanOrEqual", "Wildcard", "RegEx". :type operator: str or ~azure.mgmt.cdn.models.UrlPathOperator :param negate_condition: Describes if this is negate condition or not. :type negate_condition: bool @@ -5121,8 +8612,8 @@ class UrlRedirectAction(DeliveryRuleAction): :param name: Required. The name of the action for the delivery rule.Constant filled by server. Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum :param parameters: Required. Defines the parameters for the action. :type parameters: ~azure.mgmt.cdn.models.UrlRedirectActionParameters """ @@ -5224,8 +8715,8 @@ class UrlRewriteAction(DeliveryRuleAction): :param name: Required. The name of the action for the delivery rule.Constant filled by server. Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum :param parameters: Required. Defines the parameters for the action. :type parameters: ~azure.mgmt.cdn.models.UrlRewriteActionParameters """ @@ -5307,8 +8798,8 @@ class UrlSigningAction(DeliveryRuleAction): :param name: Required. The name of the action for the delivery rule.Constant filled by server. Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", - "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning". - :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionName + "ModifyResponseHeader", "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride". + :type name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum :param parameters: Required. Defines the parameters for the action. :type parameters: ~azure.mgmt.cdn.models.UrlSigningActionParameters """ @@ -5341,32 +8832,24 @@ class UrlSigningActionParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar odata_type: Default value: + :ivar odata_type: Required. Default value: "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlSigningActionParameters". :vartype odata_type: str - :param key_id: Required. Id reference of the key to be used to verify the hash and should be - defined in UrlSigningKeys. - :type key_id: str :param algorithm: Algorithm to use for URL signing. Possible values include: "SHA256". :type algorithm: str or ~azure.mgmt.cdn.models.Algorithm :param parameter_name_override: Defines which query string parameters in the url to be considered for expires, key id etc. :type parameter_name_override: list[~azure.mgmt.cdn.models.UrlSigningParamIdentifier] - :param ip_subnets: Match values to match against. Supports CIDR ranges (both IPv4 and IPv6). - :type ip_subnets: list[str] """ _validation = { - 'odata_type': {'constant': True}, - 'key_id': {'required': True}, + 'odata_type': {'required': True, 'constant': True}, } _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'key_id': {'key': 'keyId', 'type': 'str'}, 'algorithm': {'key': 'algorithm', 'type': 'str'}, 'parameter_name_override': {'key': 'parameterNameOverride', 'type': '[UrlSigningParamIdentifier]'}, - 'ip_subnets': {'key': 'ipSubnets', 'type': '[str]'}, } odata_type = "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlSigningActionParameters" @@ -5374,17 +8857,13 @@ class UrlSigningActionParameters(msrest.serialization.Model): def __init__( self, *, - key_id: str, algorithm: Optional[Union[str, "Algorithm"]] = None, parameter_name_override: Optional[List["UrlSigningParamIdentifier"]] = None, - ip_subnets: Optional[List[str]] = None, **kwargs ): super(UrlSigningActionParameters, self).__init__(**kwargs) - self.key_id = key_id self.algorithm = algorithm self.parameter_name_override = parameter_name_override - self.ip_subnets = ip_subnets class UrlSigningKey(msrest.serialization.Model): @@ -5422,6 +8901,51 @@ def __init__( self.key_source_parameters = key_source_parameters +class UrlSigningKeyParameters(SecretParameters): + """Url signing key parameters. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The type of the Secret to create.Constant filled by server. Possible + values include: "UrlSigningKey", "CustomerCertificate", "ManagedCertificate". + :type type: str or ~azure.mgmt.cdn.models.SecretType + :param key_id: Required. Defines the customer defined key Id. This id will exist in the + incoming request to indicate the key used to form the hash. + :type key_id: str + :param secret_source: Required. Resource reference to the KV secret. + :type secret_source: ~azure.mgmt.cdn.models.ResourceReference + :param secret_version: Version of the secret to be used. + :type secret_version: str + """ + + _validation = { + 'type': {'required': True}, + 'key_id': {'required': True}, + 'secret_source': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'key_id': {'key': 'keyId', 'type': 'str'}, + 'secret_source': {'key': 'secretSource', 'type': 'ResourceReference'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + key_id: str, + secret_source: "ResourceReference", + secret_version: Optional[str] = None, + **kwargs + ): + super(UrlSigningKeyParameters, self).__init__(**kwargs) + self.type = 'UrlSigningKey' # type: str + self.key_id = key_id + self.secret_source = secret_source + self.secret_version = secret_version + + class UrlSigningParamIdentifier(msrest.serialization.Model): """Defines how to identify a parameter for a specific purpose e.g. expires. @@ -5456,6 +8980,111 @@ def __init__( self.param_name = param_name +class Usage(msrest.serialization.Model): + """Describes resource usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource identifier. + :vartype id: str + :param unit: Required. An enum describing the unit of measurement. Possible values include: + "Count". + :type unit: str or ~azure.mgmt.cdn.models.UsageUnit + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.cdn.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__( + self, + *, + unit: Union[str, "UsageUnit"], + current_value: int, + limit: int, + name: "UsageName", + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = None + self.unit = unit + self.current_value = current_value + self.limit = limit + self.name = name + + +class UsageName(msrest.serialization.Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + localized_value: Optional[str] = None, + **kwargs + ): + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class UsagesListResult(msrest.serialization.Model): + """The list usages operation response. + + :param value: The list of resource usages. + :type value: list[~azure.mgmt.cdn.models.Usage] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Usage"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(UsagesListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + class UserManagedHttpsParameters(CustomDomainHttpsParameters): """Defines the certificate source parameters using user's keyvault certificate for enabling SSL. @@ -5623,3 +9252,257 @@ def __init__( self.is_valid = None self.error_code = None self.message = None + + +class ValidateSecretInput(msrest.serialization.Model): + """Input of the secret to be validated. + + All required parameters must be populated in order to send to Azure. + + :param secret_source: Required. The secret source. + :type secret_source: ~azure.mgmt.cdn.models.ResourceReference + :param secret_type: Required. The secret type. Possible values include: "UrlSigningKey", + "ManagedCertificate", "CustomerCertificate". + :type secret_type: str or ~azure.mgmt.cdn.models.ValidateSecretType + """ + + _validation = { + 'secret_source': {'required': True}, + 'secret_type': {'required': True}, + } + + _attribute_map = { + 'secret_source': {'key': 'secretSource', 'type': 'ResourceReference'}, + 'secret_type': {'key': 'secretType', 'type': 'str'}, + } + + def __init__( + self, + *, + secret_source: "ResourceReference", + secret_type: Union[str, "ValidateSecretType"], + **kwargs + ): + super(ValidateSecretInput, self).__init__(**kwargs) + self.secret_source = secret_source + self.secret_type = secret_type + + +class ValidateSecretOutput(msrest.serialization.Model): + """Output of the validated secret. + + :param status: The validation status. Possible values include: "Valid", "Invalid", + "AccessDenied", "CertificateExpired". + :type status: str or ~azure.mgmt.cdn.models.Status + :param message: Detailed error message. + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "Status"]] = None, + message: Optional[str] = None, + **kwargs + ): + super(ValidateSecretOutput, self).__init__(**kwargs) + self.status = status + self.message = message + + +class ValidationToken(msrest.serialization.Model): + """The validation token. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar token: + :vartype token: str + """ + + _validation = { + 'token': {'readonly': True}, + } + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidationToken, self).__init__(**kwargs) + self.token = None + + +class WafMetricsResponse(msrest.serialization.Model): + """Waf Metrics Response. + + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param granularity: Possible values include: "PT5M", "PT1H", "P1D". + :type granularity: str or ~azure.mgmt.cdn.models.WafMetricsResponseGranularity + :param series: + :type series: list[~azure.mgmt.cdn.models.WafMetricsResponseSeriesItem] + """ + + _attribute_map = { + 'date_time_begin': {'key': 'dateTimeBegin', 'type': 'iso-8601'}, + 'date_time_end': {'key': 'dateTimeEnd', 'type': 'iso-8601'}, + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'series': {'key': 'series', 'type': '[WafMetricsResponseSeriesItem]'}, + } + + def __init__( + self, + *, + date_time_begin: Optional[datetime.datetime] = None, + date_time_end: Optional[datetime.datetime] = None, + granularity: Optional[Union[str, "WafMetricsResponseGranularity"]] = None, + series: Optional[List["WafMetricsResponseSeriesItem"]] = None, + **kwargs + ): + super(WafMetricsResponse, self).__init__(**kwargs) + self.date_time_begin = date_time_begin + self.date_time_end = date_time_end + self.granularity = granularity + self.series = series + + +class WafMetricsResponseSeriesItem(msrest.serialization.Model): + """WafMetricsResponseSeriesItem. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param metric: + :type metric: str + :ivar unit: Default value: "count". + :vartype unit: str + :param groups: + :type groups: list[~azure.mgmt.cdn.models.WafMetricsResponseSeriesPropertiesItemsItem] + :param data: + :type data: + list[~azure.mgmt.cdn.models.Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems] + """ + + _validation = { + 'unit': {'constant': True}, + } + + _attribute_map = { + 'metric': {'key': 'metric', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[WafMetricsResponseSeriesPropertiesItemsItem]'}, + 'data': {'key': 'data', 'type': '[Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems]'}, + } + + unit = "count" + + def __init__( + self, + *, + metric: Optional[str] = None, + groups: Optional[List["WafMetricsResponseSeriesPropertiesItemsItem"]] = None, + data: Optional[List["Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems"]] = None, + **kwargs + ): + super(WafMetricsResponseSeriesItem, self).__init__(**kwargs) + self.metric = metric + self.groups = groups + self.data = data + + +class WafMetricsResponseSeriesPropertiesItemsItem(msrest.serialization.Model): + """WafMetricsResponseSeriesPropertiesItemsItem. + + :param name: + :type name: str + :param value: + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(WafMetricsResponseSeriesPropertiesItemsItem, self).__init__(**kwargs) + self.name = name + self.value = value + + +class WafRankingsResponse(msrest.serialization.Model): + """Waf Rankings Response. + + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param groups: + :type groups: list[str] + :param data: + :type data: list[~azure.mgmt.cdn.models.WafRankingsResponseDataItem] + """ + + _attribute_map = { + 'date_time_begin': {'key': 'dateTimeBegin', 'type': 'iso-8601'}, + 'date_time_end': {'key': 'dateTimeEnd', 'type': 'iso-8601'}, + 'groups': {'key': 'groups', 'type': '[str]'}, + 'data': {'key': 'data', 'type': '[WafRankingsResponseDataItem]'}, + } + + def __init__( + self, + *, + date_time_begin: Optional[datetime.datetime] = None, + date_time_end: Optional[datetime.datetime] = None, + groups: Optional[List[str]] = None, + data: Optional[List["WafRankingsResponseDataItem"]] = None, + **kwargs + ): + super(WafRankingsResponse, self).__init__(**kwargs) + self.date_time_begin = date_time_begin + self.date_time_end = date_time_end + self.groups = groups + self.data = data + + +class WafRankingsResponseDataItem(msrest.serialization.Model): + """WafRankingsResponseDataItem. + + :param group_values: + :type group_values: list[str] + :param metrics: + :type metrics: + list[~azure.mgmt.cdn.models.ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems] + """ + + _attribute_map = { + 'group_values': {'key': 'groupValues', 'type': '[str]'}, + 'metrics': {'key': 'metrics', 'type': '[ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems]'}, + } + + def __init__( + self, + *, + group_values: Optional[List[str]] = None, + metrics: Optional[List["ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems"]] = None, + **kwargs + ): + super(WafRankingsResponseDataItem, self).__init__(**kwargs) + self.group_values = group_values + self.metrics = metrics diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/__init__.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/__init__.py index dc4970395883..17011eacfb60 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/__init__.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/__init__.py @@ -15,6 +15,18 @@ from ._resource_usage_operations import ResourceUsageOperations from ._operations import Operations from ._edge_nodes_operations import EdgeNodesOperations +from ._afd_profiles_operations import AFDProfilesOperations +from ._afd_custom_domains_operations import AFDCustomDomainsOperations +from ._afd_endpoints_operations import AFDEndpointsOperations +from ._afd_origin_groups_operations import AFDOriginGroupsOperations +from ._afd_origins_operations import AFDOriginsOperations +from ._routes_operations import RoutesOperations +from ._rule_sets_operations import RuleSetsOperations +from ._rules_operations import RulesOperations +from ._security_policies_operations import SecurityPoliciesOperations +from ._secrets_operations import SecretsOperations +from ._validate_operations import ValidateOperations +from ._log_analytics_operations import LogAnalyticsOperations from ._policies_operations import PoliciesOperations from ._managed_rule_sets_operations import ManagedRuleSetsOperations @@ -28,6 +40,18 @@ 'ResourceUsageOperations', 'Operations', 'EdgeNodesOperations', + 'AFDProfilesOperations', + 'AFDCustomDomainsOperations', + 'AFDEndpointsOperations', + 'AFDOriginGroupsOperations', + 'AFDOriginsOperations', + 'RoutesOperations', + 'RuleSetsOperations', + 'RulesOperations', + 'SecurityPoliciesOperations', + 'SecretsOperations', + 'ValidateOperations', + 'LogAnalyticsOperations', 'PoliciesOperations', 'ManagedRuleSetsOperations', ] diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_custom_domains_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_custom_domains_operations.py new file mode 100644 index 000000000000..d37977ba8183 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_custom_domains_operations.py @@ -0,0 +1,708 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AFDCustomDomainsOperations(object): + """AFDCustomDomainsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AFDDomainListResult"] + """Lists existing AzureFrontDoor domains. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AFDDomainListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.AFDDomainListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomainListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AFDDomainListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains'} # type: ignore + + def get( + self, + resource_group_name, # type: str + profile_name, # type: str + custom_domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDDomain" + """Gets an existing AzureFrontDoor domain with the specified domain name under the specified + subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param custom_domain_name: Name of the domain under the profile which is unique globally. + :type custom_domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AFDDomain, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.AFDDomain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + custom_domain_name, # type: str + custom_domain, # type: "_models.AFDDomain" + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDDomain" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(custom_domain, 'AFDDomain') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + profile_name, # type: str + custom_domain_name, # type: str + custom_domain, # type: "_models.AFDDomain" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AFDDomain"] + """Creates a new domain within the specified profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param custom_domain_name: Name of the domain under the profile which is unique globally. + :type custom_domain_name: str + :param custom_domain: Domain properties. + :type custom_domain: ~azure.mgmt.cdn.models.AFDDomain + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AFDDomain or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.AFDDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomain"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + custom_domain_name=custom_domain_name, + custom_domain=custom_domain, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + custom_domain_name, # type: str + custom_domain_update_properties, # type: "_models.AFDDomainUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDDomain" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(custom_domain_update_properties, 'AFDDomainUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + profile_name, # type: str + custom_domain_name, # type: str + custom_domain_update_properties, # type: "_models.AFDDomainUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AFDDomain"] + """Updates an existing domain within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param custom_domain_name: Name of the domain under the profile which is unique globally. + :type custom_domain_name: str + :param custom_domain_update_properties: Domain properties. + :type custom_domain_update_properties: ~azure.mgmt.cdn.models.AFDDomainUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AFDDomain or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.AFDDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDDomain"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + custom_domain_name=custom_domain_name, + custom_domain_update_properties=custom_domain_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + custom_domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + profile_name, # type: str + custom_domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing AzureFrontDoor domain with the specified domain name under the specified + subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param custom_domain_name: Name of the domain under the profile which is unique globally. + :type custom_domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + custom_domain_name=custom_domain_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}'} # type: ignore + + def _refresh_validation_token_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + custom_domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ValidationToken" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._refresh_validation_token_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidationToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _refresh_validation_token_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}/refreshValidationToken'} # type: ignore + + def begin_refresh_validation_token( + self, + resource_group_name, # type: str + profile_name, # type: str + custom_domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ValidationToken"] + """Updates the domain validation token. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param custom_domain_name: Name of the domain under the profile which is unique globally. + :type custom_domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ValidationToken or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.ValidationToken] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationToken"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._refresh_validation_token_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + custom_domain_name=custom_domain_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ValidationToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh_validation_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}/refreshValidationToken'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_endpoints_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_endpoints_operations.py new file mode 100644 index 000000000000..c12d175c7993 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_endpoints_operations.py @@ -0,0 +1,870 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AFDEndpointsOperations(object): + """AFDEndpointsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AFDEndpointListResult"] + """Lists existing AzureFrontDoor endpoints. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AFDEndpointListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.AFDEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpointListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AFDEndpointListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints'} # type: ignore + + def get( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDEndpoint" + """Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified + subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AFDEndpoint, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.AFDEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + endpoint, # type: "_models.AFDEndpoint" + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(endpoint, 'AFDEndpoint') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + endpoint, # type: "_models.AFDEndpoint" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AFDEndpoint"] + """Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified + subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param endpoint: Endpoint properties. + :type endpoint: ~azure.mgmt.cdn.models.AFDEndpoint + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AFDEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.AFDEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + endpoint=endpoint, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + endpoint_update_properties, # type: "_models.AFDEndpointUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(endpoint_update_properties, 'AFDEndpointUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + endpoint_update_properties, # type: "_models.AFDEndpointUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AFDEndpoint"] + """Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the + specified subscription, resource group and profile. Only tags can be updated after creating an + endpoint. To update origins, use the Update Origin operation. To update origin groups, use the + Update Origin group operation. To update domains, use the Update Custom Domain operation. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param endpoint_update_properties: Endpoint update properties. + :type endpoint_update_properties: ~azure.mgmt.cdn.models.AFDEndpointUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AFDEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.AFDEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + endpoint_update_properties=endpoint_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the + specified subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}'} # type: ignore + + def _purge_content_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + contents, # type: "_models.AfdPurgeParameters" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._purge_content_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(contents, 'AfdPurgeParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _purge_content_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/purge'} # type: ignore + + def begin_purge_content( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + contents, # type: "_models.AfdPurgeParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Removes a content from AzureFrontDoor. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param contents: The list of paths to the content and the list of linked domains to be purged. + Path can be a full URL, e.g. '/pictures/city.png' which removes a single file, or a directory + with a wildcard, e.g. '/pictures/*' which removes all folders and files in the directory. + :type contents: ~azure.mgmt.cdn.models.AfdPurgeParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._purge_content_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + contents=contents, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/purge'} # type: ignore + + def list_resource_usage( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsagesListResult"] + """Checks the quota and actual usage of endpoints under the given CDN profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_resource_usage.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_resource_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/usages'} # type: ignore + + def validate_custom_domain( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + custom_domain_properties, # type: "_models.ValidateCustomDomainInput" + **kwargs # type: Any + ): + # type: (...) -> "_models.ValidateCustomDomainOutput" + """Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param custom_domain_properties: Custom domain to be validated. + :type custom_domain_properties: ~azure.mgmt.cdn.models.ValidateCustomDomainInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateCustomDomainOutput, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.ValidateCustomDomainOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateCustomDomainOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(custom_domain_properties, 'ValidateCustomDomainInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateCustomDomainOutput', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/validateCustomDomain'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_origin_groups_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_origin_groups_operations.py new file mode 100644 index 000000000000..6cc791a4606e --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_origin_groups_operations.py @@ -0,0 +1,662 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AFDOriginGroupsOperations(object): + """AFDOriginGroupsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AFDOriginGroupListResult"] + """Lists all of the existing origin groups within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AFDOriginGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.AFDOriginGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AFDOriginGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups'} # type: ignore + + def get( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDOriginGroup" + """Gets an existing origin group within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the endpoint. + :type origin_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AFDOriginGroup, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.AFDOriginGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_group, # type: "_models.AFDOriginGroup" + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDOriginGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(origin_group, 'AFDOriginGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_group, # type: "_models.AFDOriginGroup" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AFDOriginGroup"] + """Creates a new origin group within the specified profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the endpoint. + :type origin_group_name: str + :param origin_group: Origin group properties. + :type origin_group: ~azure.mgmt.cdn.models.AFDOriginGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AFDOriginGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.AFDOriginGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + origin_group=origin_group, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_group_update_properties, # type: "_models.AFDOriginGroupUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDOriginGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(origin_group_update_properties, 'AFDOriginGroupUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_group_update_properties, # type: "_models.AFDOriginGroupUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AFDOriginGroup"] + """Updates an existing origin group within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :param origin_group_update_properties: Origin group properties. + :type origin_group_update_properties: ~azure.mgmt.cdn.models.AFDOriginGroupUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AFDOriginGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.AFDOriginGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + origin_group_update_properties=origin_group_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDOriginGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing origin group within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}'} # type: ignore + + def list_resource_usage( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsagesListResult"] + """Checks the quota and actual usage of endpoints under the given CDN profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the endpoint. + :type origin_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_resource_usage.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_resource_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/usages'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_origins_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_origins_operations.py new file mode 100644 index 000000000000..5ad32886f7d6 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_origins_operations.py @@ -0,0 +1,611 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AFDOriginsOperations(object): + """AFDOriginsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_origin_group( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AFDOriginListResult"] + """Lists all of the existing origins within an origin group. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AFDOriginListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.AFDOriginListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOriginListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_origin_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AFDOriginListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_origin_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins'} # type: ignore + + def get( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDOrigin" + """Gets an existing origin within an origin group. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :param origin_name: Name of the origin which is unique within the profile. + :type origin_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AFDOrigin, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.AFDOrigin + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOrigin"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_name, # type: str + origin, # type: "_models.AFDOrigin" + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDOrigin" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOrigin"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(origin, 'AFDOrigin') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_name, # type: str + origin, # type: "_models.AFDOrigin" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AFDOrigin"] + """Creates a new origin within the specified origin group. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :param origin_name: Name of the origin that is unique within the profile. + :type origin_name: str + :param origin: Origin properties. + :type origin: ~azure.mgmt.cdn.models.AFDOrigin + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AFDOrigin or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.AFDOrigin] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOrigin"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + origin_name=origin_name, + origin=origin, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_name, # type: str + origin_update_properties, # type: "_models.AFDOriginUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.AFDOrigin" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOrigin"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(origin_update_properties, 'AFDOriginUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_name, # type: str + origin_update_properties, # type: "_models.AFDOriginUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AFDOrigin"] + """Updates an existing origin within an origin group. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :param origin_name: Name of the origin which is unique within the profile. + :type origin_name: str + :param origin_update_properties: Origin properties. + :type origin_update_properties: ~azure.mgmt.cdn.models.AFDOriginUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AFDOrigin or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.AFDOrigin] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AFDOrigin"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + origin_name=origin_name, + origin_update_properties=origin_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AFDOrigin', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + profile_name, # type: str + origin_group_name, # type: str + origin_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing origin within an origin group. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param origin_group_name: Name of the origin group which is unique within the profile. + :type origin_group_name: str + :param origin_name: Name of the origin which is unique within the profile. + :type origin_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + origin_group_name=origin_group_name, + origin_name=origin_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_profiles_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_profiles_operations.py new file mode 100644 index 000000000000..d2ede9d3baaa --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_afd_profiles_operations.py @@ -0,0 +1,190 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AFDProfilesOperations(object): + """AFDProfilesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_resource_usage( + self, + resource_group_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsagesListResult"] + """Checks the quota and actual usage of endpoints under the given CDN profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_resource_usage.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_resource_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/usages'} # type: ignore + + def check_host_name_availability( + self, + resource_group_name, # type: str + profile_name, # type: str + check_host_name_availability_input, # type: "_models.ValidateCustomDomainInput" + **kwargs # type: Any + ): + # type: (...) -> "_models.ValidateCustomDomainOutput" + """Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param check_host_name_availability_input: Custom domain to be validated. + :type check_host_name_availability_input: ~azure.mgmt.cdn.models.ValidateCustomDomainInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateCustomDomainOutput, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.ValidateCustomDomainOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateCustomDomainOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_host_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(check_host_name_availability_input, 'ValidateCustomDomainInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateCustomDomainOutput', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_host_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkHostNameAvailability'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_cdn_management_client_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_cdn_management_client_operations.py index 428a015c149e..8627d6a89fd2 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_cdn_management_client_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_cdn_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -26,28 +26,26 @@ class CdnManagementClientOperationsMixin(object): def check_name_availability( self, - name, # type: str + check_name_availability_input, # type: "_models.CheckNameAvailabilityInput" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityOutput" + # type: (...) -> "_models.CheckNameAvailabilityOutput" """Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. - :param name: The resource name to validate. - :type name: str + :param check_name_availability_input: Input to check. + :type check_name_availability_input: ~azure.mgmt.cdn.models.CheckNameAvailabilityInput :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameAvailabilityOutput, or the result of cls(response) :rtype: ~azure.mgmt.cdn.models.CheckNameAvailabilityOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityOutput"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _check_name_availability_input = models.CheckNameAvailabilityInput(name=name) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -64,7 +62,7 @@ def check_name_availability( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_check_name_availability_input, 'CheckNameAvailabilityInput') + body_content = self._serialize.body(check_name_availability_input, 'CheckNameAvailabilityInput') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -72,7 +70,7 @@ def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityOutput', pipeline_response) @@ -85,28 +83,26 @@ def check_name_availability( def check_name_availability_with_subscription( self, - name, # type: str + check_name_availability_input, # type: "_models.CheckNameAvailabilityInput" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityOutput" + # type: (...) -> "_models.CheckNameAvailabilityOutput" """Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint. - :param name: The resource name to validate. - :type name: str + :param check_name_availability_input: Input to check. + :type check_name_availability_input: ~azure.mgmt.cdn.models.CheckNameAvailabilityInput :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameAvailabilityOutput, or the result of cls(response) :rtype: ~azure.mgmt.cdn.models.CheckNameAvailabilityOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityOutput"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _check_name_availability_input = models.CheckNameAvailabilityInput(name=name) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -127,7 +123,7 @@ def check_name_availability_with_subscription( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_check_name_availability_input, 'CheckNameAvailabilityInput') + body_content = self._serialize.body(check_name_availability_input, 'CheckNameAvailabilityInput') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -135,7 +131,7 @@ def check_name_availability_with_subscription( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityOutput', pipeline_response) @@ -148,29 +144,27 @@ def check_name_availability_with_subscription( def validate_probe( self, - probe_url, # type: str + validate_probe_input, # type: "_models.ValidateProbeInput" **kwargs # type: Any ): - # type: (...) -> "models.ValidateProbeOutput" + # type: (...) -> "_models.ValidateProbeOutput" """Check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file hosted on the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is relative to the origin path specified in the endpoint configuration. - :param probe_url: The probe URL to validate. - :type probe_url: str + :param validate_probe_input: Input to check. + :type validate_probe_input: ~azure.mgmt.cdn.models.ValidateProbeInput :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidateProbeOutput, or the result of cls(response) :rtype: ~azure.mgmt.cdn.models.ValidateProbeOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ValidateProbeOutput"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateProbeOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _validate_probe_input = models.ValidateProbeInput(probe_url=probe_url) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -191,7 +185,7 @@ def validate_probe( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_validate_probe_input, 'ValidateProbeInput') + body_content = self._serialize.body(validate_probe_input, 'ValidateProbeInput') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -199,7 +193,7 @@ def validate_probe( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidateProbeOutput', pipeline_response) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_custom_domains_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_custom_domains_operations.py index 6b58aeb72365..7f902cb800f1 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_custom_domains_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_custom_domains_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class CustomDomainsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def list_by_endpoint( endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.CustomDomainListResult"] + # type: (...) -> Iterable["_models.CustomDomainListResult"] """Lists all of the existing custom domains within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -68,12 +68,12 @@ def list_by_endpoint( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.CustomDomainListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomDomainListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomDomainListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -116,7 +116,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -135,7 +135,7 @@ def get( custom_domain_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.CustomDomain" + # type: (...) -> "_models.CustomDomain" """Gets an existing custom domain within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -151,12 +151,12 @@ def get( :rtype: ~azure.mgmt.cdn.models.CustomDomain :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomDomain"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomDomain"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -184,7 +184,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CustomDomain', pipeline_response) @@ -201,18 +201,16 @@ def _create_initial( profile_name, # type: str endpoint_name, # type: str custom_domain_name, # type: str - host_name=None, # type: Optional[str] + custom_domain_properties, # type: "_models.CustomDomainParameters" **kwargs # type: Any ): - # type: (...) -> "models.CustomDomain" - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomDomain"] + # type: (...) -> "_models.CustomDomain" + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomDomain"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _custom_domain_properties = models.CustomDomainParameters(host_name=host_name) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -237,7 +235,7 @@ def _create_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_custom_domain_properties, 'CustomDomainParameters') + body_content = self._serialize.body(custom_domain_properties, 'CustomDomainParameters') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -245,7 +243,7 @@ def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -269,10 +267,10 @@ def begin_create( profile_name, # type: str endpoint_name, # type: str custom_domain_name, # type: str - host_name=None, # type: Optional[str] + custom_domain_properties, # type: "_models.CustomDomainParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.CustomDomain"] + # type: (...) -> LROPoller["_models.CustomDomain"] """Creates a new custom domain within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -283,8 +281,8 @@ def begin_create( :type endpoint_name: str :param custom_domain_name: Name of the custom domain within an endpoint. :type custom_domain_name: str - :param host_name: The host name of the custom domain. Must be a domain name. - :type host_name: str + :param custom_domain_properties: Properties required to create a new custom domain. + :type custom_domain_properties: ~azure.mgmt.cdn.models.CustomDomainParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -296,7 +294,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomDomain"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomDomain"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -308,7 +306,7 @@ def begin_create( profile_name=profile_name, endpoint_name=endpoint_name, custom_domain_name=custom_domain_name, - host_name=host_name, + custom_domain_properties=custom_domain_properties, cls=lambda x,y,z: x, **kwargs ) @@ -323,7 +321,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -345,13 +351,13 @@ def _delete_initial( custom_domain_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.CustomDomain"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.CustomDomain"]] + # type: (...) -> Optional["_models.CustomDomain"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CustomDomain"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -379,7 +385,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -400,7 +406,7 @@ def begin_delete( custom_domain_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.CustomDomain"] + # type: (...) -> LROPoller["_models.CustomDomain"] """Deletes an existing custom domain within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -422,7 +428,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomDomain"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomDomain"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -448,7 +454,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'customDomainName': self._serialize.url("custom_domain_name", custom_domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -470,7 +484,7 @@ def disable_custom_https( custom_domain_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.CustomDomain"] + # type: (...) -> Optional["_models.CustomDomain"] """Disable https delivery of the custom domain. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -486,12 +500,12 @@ def disable_custom_https( :rtype: ~azure.mgmt.cdn.models.CustomDomain or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.CustomDomain"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CustomDomain"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -519,7 +533,7 @@ def disable_custom_https( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -538,10 +552,10 @@ def enable_custom_https( profile_name, # type: str endpoint_name, # type: str custom_domain_name, # type: str - custom_domain_https_parameters=None, # type: Optional["models.CustomDomainHttpsParameters"] + custom_domain_https_parameters=None, # type: Optional["_models.CustomDomainHttpsParameters"] **kwargs # type: Any ): - # type: (...) -> Optional["models.CustomDomain"] + # type: (...) -> Optional["_models.CustomDomain"] """Enable https delivery of the custom domain. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -561,12 +575,12 @@ def enable_custom_https( :rtype: ~azure.mgmt.cdn.models.CustomDomain or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.CustomDomain"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CustomDomain"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -602,7 +616,7 @@ def enable_custom_https( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_edge_nodes_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_edge_nodes_operations.py index fdc8c9448537..9409298acb27 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_edge_nodes_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_edge_nodes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class EdgeNodesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.EdgenodeResult"] + # type: (...) -> Iterable["_models.EdgenodeResult"] """Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. @@ -58,12 +58,12 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.EdgenodeResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EdgenodeResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EdgenodeResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -99,7 +99,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_endpoints_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_endpoints_operations.py index 784e3abbb05b..756eb364cea5 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_endpoints_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_endpoints_operations.py @@ -16,11 +16,11 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +39,7 @@ class EndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list_by_profile( profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointListResult"] + # type: (...) -> Iterable["_models.EndpointListResult"] """Lists existing CDN endpoints. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -65,12 +65,12 @@ def list_by_profile( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.EndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -112,7 +112,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -130,7 +130,7 @@ def get( endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Endpoint" + # type: (...) -> "_models.Endpoint" """Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. @@ -145,12 +145,12 @@ def get( :rtype: ~azure.mgmt.cdn.models.Endpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -177,7 +177,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Endpoint', pipeline_response) @@ -193,16 +193,16 @@ def _create_initial( resource_group_name, # type: str profile_name, # type: str endpoint_name, # type: str - endpoint, # type: "models.Endpoint" + endpoint, # type: "_models.Endpoint" **kwargs # type: Any ): - # type: (...) -> "models.Endpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + # type: (...) -> "_models.Endpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -234,7 +234,7 @@ def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -257,10 +257,10 @@ def begin_create( resource_group_name, # type: str profile_name, # type: str endpoint_name, # type: str - endpoint, # type: "models.Endpoint" + endpoint, # type: "_models.Endpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Endpoint"] + # type: (...) -> LROPoller["_models.Endpoint"] """Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. @@ -283,7 +283,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +309,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -328,16 +335,16 @@ def _update_initial( resource_group_name, # type: str profile_name, # type: str endpoint_name, # type: str - endpoint_update_properties, # type: "models.EndpointUpdateParameters" + endpoint_update_properties, # type: "_models.EndpointUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.Endpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + # type: (...) -> "_models.Endpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -369,7 +376,7 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -389,10 +396,10 @@ def begin_update( resource_group_name, # type: str profile_name, # type: str endpoint_name, # type: str - endpoint_update_properties, # type: "models.EndpointUpdateParameters" + endpoint_update_properties, # type: "_models.EndpointUpdateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Endpoint"] + # type: (...) -> LROPoller["_models.Endpoint"] """Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update origin groups, use the Update @@ -417,7 +424,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +450,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -470,7 +484,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -497,7 +511,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -555,7 +569,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,13 +597,13 @@ def _start_initial( endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Endpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + # type: (...) -> "_models.Endpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -609,7 +630,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -631,7 +652,7 @@ def begin_start( endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Endpoint"] + # type: (...) -> LROPoller["_models.Endpoint"] """Starts an existing CDN endpoint that is on a stopped state. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -651,7 +672,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -676,7 +697,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -697,13 +725,13 @@ def _stop_initial( endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Endpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + # type: (...) -> "_models.Endpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -730,7 +758,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -752,7 +780,7 @@ def begin_stop( endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Endpoint"] + # type: (...) -> LROPoller["_models.Endpoint"] """Stops an existing running CDN endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -772,7 +800,7 @@ def begin_stop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Endpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Endpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -797,7 +825,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -816,7 +851,7 @@ def _purge_content_initial( resource_group_name, # type: str profile_name, # type: str endpoint_name, # type: str - content_paths, # type: List[str] + content_file_paths, # type: "_models.PurgeParameters" **kwargs # type: Any ): # type: (...) -> None @@ -825,9 +860,7 @@ def _purge_content_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _content_file_paths = models.PurgeParameters(content_paths=content_paths) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -851,7 +884,7 @@ def _purge_content_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_content_file_paths, 'PurgeParameters') + body_content = self._serialize.body(content_file_paths, 'PurgeParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -859,7 +892,7 @@ def _purge_content_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -872,7 +905,7 @@ def begin_purge_content( resource_group_name, # type: str profile_name, # type: str endpoint_name, # type: str - content_paths, # type: List[str] + content_file_paths, # type: "_models.PurgeParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -884,9 +917,10 @@ def begin_purge_content( :type profile_name: str :param endpoint_name: Name of the endpoint under the profile which is unique globally. :type endpoint_name: str - :param content_paths: The path to the content to be purged. Can describe a file path or a wild - card directory. - :type content_paths: list[str] + :param content_file_paths: The path to the content to be purged. Path can be a full URL, e.g. + '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. + '/pictures/*' which removes all folders and files in the directory. + :type content_file_paths: ~azure.mgmt.cdn.models.PurgeParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -909,7 +943,7 @@ def begin_purge_content( resource_group_name=resource_group_name, profile_name=profile_name, endpoint_name=endpoint_name, - content_paths=content_paths, + content_file_paths=content_file_paths, cls=lambda x,y,z: x, **kwargs ) @@ -921,7 +955,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -940,7 +981,7 @@ def _load_content_initial( resource_group_name, # type: str profile_name, # type: str endpoint_name, # type: str - content_paths, # type: List[str] + content_file_paths, # type: "_models.LoadParameters" **kwargs # type: Any ): # type: (...) -> None @@ -949,9 +990,7 @@ def _load_content_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _content_file_paths = models.LoadParameters(content_paths=content_paths) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -975,7 +1014,7 @@ def _load_content_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_content_file_paths, 'LoadParameters') + body_content = self._serialize.body(content_file_paths, 'LoadParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -983,7 +1022,7 @@ def _load_content_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -996,7 +1035,7 @@ def begin_load_content( resource_group_name, # type: str profile_name, # type: str endpoint_name, # type: str - content_paths, # type: List[str] + content_file_paths, # type: "_models.LoadParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1008,9 +1047,9 @@ def begin_load_content( :type profile_name: str :param endpoint_name: Name of the endpoint under the profile which is unique globally. :type endpoint_name: str - :param content_paths: The path to the content to be loaded. Path should be a relative file URL - of the origin. - :type content_paths: list[str] + :param content_file_paths: The path to the content to be loaded. Path should be a full URL, + e.g. ‘/pictures/city.png' which loads a single file. + :type content_file_paths: ~azure.mgmt.cdn.models.LoadParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -1033,7 +1072,7 @@ def begin_load_content( resource_group_name=resource_group_name, profile_name=profile_name, endpoint_name=endpoint_name, - content_paths=content_paths, + content_file_paths=content_file_paths, cls=lambda x,y,z: x, **kwargs ) @@ -1045,7 +1084,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,10 +1110,10 @@ def validate_custom_domain( resource_group_name, # type: str profile_name, # type: str endpoint_name, # type: str - host_name, # type: str + custom_domain_properties, # type: "_models.ValidateCustomDomainInput" **kwargs # type: Any ): - # type: (...) -> "models.ValidateCustomDomainOutput" + # type: (...) -> "_models.ValidateCustomDomainOutput" """Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -1076,21 +1122,19 @@ def validate_custom_domain( :type profile_name: str :param endpoint_name: Name of the endpoint under the profile which is unique globally. :type endpoint_name: str - :param host_name: The host name of the custom domain. Must be a domain name. - :type host_name: str + :param custom_domain_properties: Custom domain to be validated. + :type custom_domain_properties: ~azure.mgmt.cdn.models.ValidateCustomDomainInput :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidateCustomDomainOutput, or the result of cls(response) :rtype: ~azure.mgmt.cdn.models.ValidateCustomDomainOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ValidateCustomDomainOutput"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateCustomDomainOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _custom_domain_properties = models.ValidateCustomDomainInput(host_name=host_name) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1114,7 +1158,7 @@ def validate_custom_domain( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_custom_domain_properties, 'ValidateCustomDomainInput') + body_content = self._serialize.body(custom_domain_properties, 'ValidateCustomDomainInput') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -1122,7 +1166,7 @@ def validate_custom_domain( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidateCustomDomainOutput', pipeline_response) @@ -1140,7 +1184,7 @@ def list_resource_usage( endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ResourceUsageListResult"] + # type: (...) -> Iterable["_models.ResourceUsageListResult"] """Checks the quota and usage of geo filters and custom domains under the given endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -1154,12 +1198,12 @@ def list_resource_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.ResourceUsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceUsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceUsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -1202,7 +1246,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_log_analytics_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_log_analytics_operations.py new file mode 100644 index 000000000000..ed22c74aa788 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_log_analytics_operations.py @@ -0,0 +1,533 @@ +# 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 datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LogAnalyticsOperations(object): + """LogAnalyticsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_log_analytics_metrics( + self, + resource_group_name, # type: str + profile_name, # type: str + metrics, # type: List[Union[str, "_models.Get4ItemsItem"]] + date_time_begin, # type: datetime.datetime + date_time_end, # type: datetime.datetime + granularity, # type: Union[str, "_models.Enum31"] + group_by=None, # type: Optional[List[Union[str, "_models.Get8ItemsItem"]]] + continents=None, # type: Optional[List[str]] + country_or_regions=None, # type: Optional[List[str]] + custom_domains=None, # type: Optional[List[str]] + protocols=None, # type: Optional[List[str]] + **kwargs # type: Any + ): + # type: (...) -> "_models.MetricsResponse" + """Get log report for AFD profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param metrics: + :type metrics: list[str or ~azure.mgmt.cdn.models.Get4ItemsItem] + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param granularity: + :type granularity: str or ~azure.mgmt.cdn.models.Enum31 + :param group_by: + :type group_by: list[str or ~azure.mgmt.cdn.models.Get8ItemsItem] + :param continents: + :type continents: list[str] + :param country_or_regions: + :type country_or_regions: list[str] + :param custom_domains: + :type custom_domains: list[str] + :param protocols: + :type protocols: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MetricsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.MetricsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_log_analytics_metrics.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['metrics'] = self._serialize.query("metrics", metrics, '[str]', div=',') + query_parameters['dateTimeBegin'] = self._serialize.query("date_time_begin", date_time_begin, 'iso-8601') + query_parameters['dateTimeEnd'] = self._serialize.query("date_time_end", date_time_end, 'iso-8601') + query_parameters['granularity'] = self._serialize.query("granularity", granularity, 'str') + if group_by is not None: + query_parameters['groupBy'] = self._serialize.query("group_by", group_by, '[str]', div=',') + if continents is not None: + query_parameters['continents'] = self._serialize.query("continents", continents, '[str]', div=',') + if country_or_regions is not None: + query_parameters['countryOrRegions'] = self._serialize.query("country_or_regions", country_or_regions, '[str]', div=',') + if custom_domains is not None: + query_parameters['customDomains'] = self._serialize.query("custom_domains", custom_domains, '[str]', div=',') + if protocols is not None: + query_parameters['protocols'] = self._serialize.query("protocols", protocols, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MetricsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_log_analytics_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsMetrics'} # type: ignore + + def get_log_analytics_rankings( + self, + resource_group_name, # type: str + profile_name, # type: str + rankings, # type: List[Union[str, "_models.Enum35"]] + metrics, # type: List[Union[str, "_models.Get5ItemsItem"]] + max_ranking, # type: float + date_time_begin, # type: datetime.datetime + date_time_end, # type: datetime.datetime + custom_domains=None, # type: Optional[List[str]] + **kwargs # type: Any + ): + # type: (...) -> "_models.RankingsResponse" + """Get log analytics ranking report for AFD profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rankings: + :type rankings: list[str or ~azure.mgmt.cdn.models.Enum35] + :param metrics: + :type metrics: list[str or ~azure.mgmt.cdn.models.Get5ItemsItem] + :param max_ranking: + :type max_ranking: float + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param custom_domains: + :type custom_domains: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RankingsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.RankingsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RankingsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_log_analytics_rankings.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['rankings'] = self._serialize.query("rankings", rankings, '[str]', div=',') + query_parameters['metrics'] = self._serialize.query("metrics", metrics, '[str]', div=',') + query_parameters['maxRanking'] = self._serialize.query("max_ranking", max_ranking, 'float') + query_parameters['dateTimeBegin'] = self._serialize.query("date_time_begin", date_time_begin, 'iso-8601') + query_parameters['dateTimeEnd'] = self._serialize.query("date_time_end", date_time_end, 'iso-8601') + if custom_domains is not None: + query_parameters['customDomains'] = self._serialize.query("custom_domains", custom_domains, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RankingsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_log_analytics_rankings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsRankings'} # type: ignore + + def get_log_analytics_locations( + self, + resource_group_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ContinentsResponse" + """Get all available location names for AFD log analytics report. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinentsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.ContinentsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinentsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_log_analytics_locations.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ContinentsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_log_analytics_locations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsLocations'} # type: ignore + + def get_log_analytics_resources( + self, + resource_group_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourcesResponse" + """Get all endpoints and custom domains available for AFD log report. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourcesResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.ResourcesResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcesResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_log_analytics_resources.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourcesResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_log_analytics_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsResources'} # type: ignore + + def get_waf_log_analytics_metrics( + self, + resource_group_name, # type: str + profile_name, # type: str + metrics, # type: List[str] + date_time_begin, # type: datetime.datetime + date_time_end, # type: datetime.datetime + granularity, # type: Union[str, "_models.Enum37"] + actions=None, # type: Optional[List[Union[str, "_models.Enum38"]]] + group_by=None, # type: Optional[List[Union[str, "_models.Enum39"]]] + rule_types=None, # type: Optional[List[Union[str, "_models.Enum40"]]] + **kwargs # type: Any + ): + # type: (...) -> "_models.WafMetricsResponse" + """Get Waf related log analytics report for AFD profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param metrics: + :type metrics: list[str] + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param granularity: + :type granularity: str or ~azure.mgmt.cdn.models.Enum37 + :param actions: + :type actions: list[str or ~azure.mgmt.cdn.models.Enum38] + :param group_by: + :type group_by: list[str or ~azure.mgmt.cdn.models.Enum39] + :param rule_types: + :type rule_types: list[str or ~azure.mgmt.cdn.models.Enum40] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WafMetricsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.WafMetricsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WafMetricsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_waf_log_analytics_metrics.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['metrics'] = self._serialize.query("metrics", metrics, '[str]', div=',') + query_parameters['dateTimeBegin'] = self._serialize.query("date_time_begin", date_time_begin, 'iso-8601') + query_parameters['dateTimeEnd'] = self._serialize.query("date_time_end", date_time_end, 'iso-8601') + query_parameters['granularity'] = self._serialize.query("granularity", granularity, 'str') + if actions is not None: + query_parameters['actions'] = self._serialize.query("actions", actions, '[str]', div=',') + if group_by is not None: + query_parameters['groupBy'] = self._serialize.query("group_by", group_by, '[str]', div=',') + if rule_types is not None: + query_parameters['ruleTypes'] = self._serialize.query("rule_types", rule_types, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WafMetricsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_waf_log_analytics_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getWafLogAnalyticsMetrics'} # type: ignore + + def get_waf_log_analytics_rankings( + self, + resource_group_name, # type: str + profile_name, # type: str + metrics, # type: List[str] + date_time_begin, # type: datetime.datetime + date_time_end, # type: datetime.datetime + max_ranking, # type: float + rankings, # type: List[Union[str, "_models.Enum42"]] + actions=None, # type: Optional[List[Union[str, "_models.Enum43"]]] + rule_types=None, # type: Optional[List[Union[str, "_models.Enum44"]]] + **kwargs # type: Any + ): + # type: (...) -> "_models.WafRankingsResponse" + """Get WAF log analytics charts for AFD profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param metrics: + :type metrics: list[str] + :param date_time_begin: + :type date_time_begin: ~datetime.datetime + :param date_time_end: + :type date_time_end: ~datetime.datetime + :param max_ranking: + :type max_ranking: float + :param rankings: + :type rankings: list[str or ~azure.mgmt.cdn.models.Enum42] + :param actions: + :type actions: list[str or ~azure.mgmt.cdn.models.Enum43] + :param rule_types: + :type rule_types: list[str or ~azure.mgmt.cdn.models.Enum44] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WafRankingsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.WafRankingsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WafRankingsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get_waf_log_analytics_rankings.metadata['url'] # type: ignore + 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=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['metrics'] = self._serialize.query("metrics", metrics, '[str]', div=',') + query_parameters['dateTimeBegin'] = self._serialize.query("date_time_begin", date_time_begin, 'iso-8601') + query_parameters['dateTimeEnd'] = self._serialize.query("date_time_end", date_time_end, 'iso-8601') + query_parameters['maxRanking'] = self._serialize.query("max_ranking", max_ranking, 'float') + query_parameters['rankings'] = self._serialize.query("rankings", rankings, '[str]', div=',') + if actions is not None: + query_parameters['actions'] = self._serialize.query("actions", actions, '[str]', div=',') + if rule_types is not None: + query_parameters['ruleTypes'] = self._serialize.query("rule_types", rule_types, '[str]', div=',') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WafRankingsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_waf_log_analytics_rankings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getWafLogAnalyticsRankings'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_managed_rule_sets_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_managed_rule_sets_operations.py index 258890c01427..00552854ac51 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_managed_rule_sets_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_managed_rule_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ManagedRuleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ManagedRuleSetDefinitionList"] + # type: (...) -> Iterable["_models.ManagedRuleSetDefinitionList"] """Lists all available managed rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,12 +57,12 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.ManagedRuleSetDefinitionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedRuleSetDefinitionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedRuleSetDefinitionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -102,7 +102,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_operations.py index 303b95460de0..dbf8578c17d5 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationsListResult"] + # type: (...) -> Iterable["_models.OperationsListResult"] """Lists all of the available CDN REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,12 +57,12 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.OperationsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_origin_groups_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_origin_groups_operations.py index e37574b72f7b..517f3130ce49 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_origin_groups_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_origin_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class OriginGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def list_by_endpoint( endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.OriginGroupListResult"] + # type: (...) -> Iterable["_models.OriginGroupListResult"] """Lists all of the existing origin groups within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -68,12 +68,12 @@ def list_by_endpoint( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.OriginGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -116,7 +116,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -135,7 +135,7 @@ def get( origin_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OriginGroup" + # type: (...) -> "_models.OriginGroup" """Gets an existing origin group within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -151,12 +151,12 @@ def get( :rtype: ~azure.mgmt.cdn.models.OriginGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -184,7 +184,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OriginGroup', pipeline_response) @@ -201,16 +201,16 @@ def _create_initial( profile_name, # type: str endpoint_name, # type: str origin_group_name, # type: str - origin_group, # type: "models.OriginGroup" + origin_group, # type: "_models.OriginGroup" **kwargs # type: Any ): - # type: (...) -> "models.OriginGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroup"] + # type: (...) -> "_models.OriginGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -243,7 +243,7 @@ def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -267,10 +267,10 @@ def begin_create( profile_name, # type: str endpoint_name, # type: str origin_group_name, # type: str - origin_group, # type: "models.OriginGroup" + origin_group, # type: "_models.OriginGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OriginGroup"] + # type: (...) -> LROPoller["_models.OriginGroup"] """Creates a new origin group within the specified endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -294,7 +294,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +321,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,16 +349,16 @@ def _update_initial( profile_name, # type: str endpoint_name, # type: str origin_group_name, # type: str - origin_group_update_properties, # type: "models.OriginGroupUpdateParameters" + origin_group_update_properties, # type: "_models.OriginGroupUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.OriginGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroup"] + # type: (...) -> "_models.OriginGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -383,7 +391,7 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -404,10 +412,10 @@ def begin_update( profile_name, # type: str endpoint_name, # type: str origin_group_name, # type: str - origin_group_update_properties, # type: "models.OriginGroupUpdateParameters" + origin_group_update_properties, # type: "_models.OriginGroupUpdateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OriginGroup"] + # type: (...) -> LROPoller["_models.OriginGroup"] """Updates an existing origin group within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -431,7 +439,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -458,7 +466,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -486,7 +502,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -514,7 +530,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -575,7 +591,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originGroupName': self._serialize.url("origin_group_name", origin_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_origins_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_origins_operations.py index 2d921f83814f..f08639a66920 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_origins_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_origins_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class OriginsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def list_by_endpoint( endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.OriginListResult"] + # type: (...) -> Iterable["_models.OriginListResult"] """Lists all of the existing origins within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -68,12 +68,12 @@ def list_by_endpoint( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.OriginListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OriginListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OriginListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -116,7 +116,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -135,7 +135,7 @@ def get( origin_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Origin" + # type: (...) -> "_models.Origin" """Gets an existing origin within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -151,12 +151,12 @@ def get( :rtype: ~azure.mgmt.cdn.models.Origin :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Origin"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Origin"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -184,7 +184,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Origin', pipeline_response) @@ -201,16 +201,16 @@ def _create_initial( profile_name, # type: str endpoint_name, # type: str origin_name, # type: str - origin, # type: "models.Origin" + origin, # type: "_models.Origin" **kwargs # type: Any ): - # type: (...) -> "models.Origin" - cls = kwargs.pop('cls', None) # type: ClsType["models.Origin"] + # type: (...) -> "_models.Origin" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Origin"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -243,7 +243,7 @@ def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -267,10 +267,10 @@ def begin_create( profile_name, # type: str endpoint_name, # type: str origin_name, # type: str - origin, # type: "models.Origin" + origin, # type: "_models.Origin" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Origin"] + # type: (...) -> LROPoller["_models.Origin"] """Creates a new origin within the specified endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -294,7 +294,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Origin"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Origin"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +321,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,16 +349,16 @@ def _update_initial( profile_name, # type: str endpoint_name, # type: str origin_name, # type: str - origin_update_properties, # type: "models.OriginUpdateParameters" + origin_update_properties, # type: "_models.OriginUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.Origin" - cls = kwargs.pop('cls', None) # type: ClsType["models.Origin"] + # type: (...) -> "_models.Origin" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Origin"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -383,7 +391,7 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -404,10 +412,10 @@ def begin_update( profile_name, # type: str endpoint_name, # type: str origin_name, # type: str - origin_update_properties, # type: "models.OriginUpdateParameters" + origin_update_properties, # type: "_models.OriginUpdateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Origin"] + # type: (...) -> LROPoller["_models.Origin"] """Updates an existing origin within an endpoint. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -431,7 +439,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Origin"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Origin"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -458,7 +466,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -486,7 +502,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -514,7 +530,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -575,7 +591,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'originName': self._serialize.url("origin_name", origin_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_policies_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_policies_operations.py index b335727c7cee..8d588616174f 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_policies_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.CdnWebApplicationFirewallPolicyList"] + # type: (...) -> Iterable["_models.CdnWebApplicationFirewallPolicyList"] """Lists all of the protection policies within a resource group. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -62,12 +62,12 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicyList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicyList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicyList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -79,7 +79,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -108,7 +108,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -125,7 +125,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.CdnWebApplicationFirewallPolicy" + # type: (...) -> "_models.CdnWebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -137,18 +137,18 @@ def get( :rtype: ~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CdnWebApplicationFirewallPolicy', pipeline_response) @@ -183,23 +183,23 @@ def _create_or_update_initial( self, resource_group_name, # type: str policy_name, # type: str - cdn_web_application_firewall_policy, # type: "models.CdnWebApplicationFirewallPolicy" + cdn_web_application_firewall_policy, # type: "_models.CdnWebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.CdnWebApplicationFirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicy"] + # type: (...) -> "_models.CdnWebApplicationFirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -223,7 +223,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -245,10 +245,10 @@ def begin_create_or_update( self, resource_group_name, # type: str policy_name, # type: str - cdn_web_application_firewall_policy, # type: "models.CdnWebApplicationFirewallPolicy" + cdn_web_application_firewall_policy, # type: "_models.CdnWebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.CdnWebApplicationFirewallPolicy"] + # type: (...) -> LROPoller["_models.CdnWebApplicationFirewallPolicy"] """Create or update policy with specified rule set name within a resource group. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -268,7 +268,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -293,7 +293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -311,25 +317,23 @@ def _update_initial( self, resource_group_name, # type: str policy_name, # type: str - tags=None, # type: Optional[Dict[str, str]] + cdn_web_application_firewall_policy_patch_parameters, # type: "_models.CdnWebApplicationFirewallPolicyPatchParameters" **kwargs # type: Any ): - # type: (...) -> "models.CdnWebApplicationFirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicy"] + # type: (...) -> "_models.CdnWebApplicationFirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _cdn_web_application_firewall_policy_patch_parameters = models.CdnWebApplicationFirewallPolicyPatchParameters(tags=tags) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -345,7 +349,7 @@ def _update_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_cdn_web_application_firewall_policy_patch_parameters, 'CdnWebApplicationFirewallPolicyPatchParameters') + body_content = self._serialize.body(cdn_web_application_firewall_policy_patch_parameters, 'CdnWebApplicationFirewallPolicyPatchParameters') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -353,7 +357,7 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -372,10 +376,10 @@ def begin_update( self, resource_group_name, # type: str policy_name, # type: str - tags=None, # type: Optional[Dict[str, str]] + cdn_web_application_firewall_policy_patch_parameters, # type: "_models.CdnWebApplicationFirewallPolicyPatchParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.CdnWebApplicationFirewallPolicy"] + # type: (...) -> LROPoller["_models.CdnWebApplicationFirewallPolicy"] """Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified subscription and resource group. @@ -383,8 +387,9 @@ def begin_update( :type resource_group_name: str :param policy_name: The name of the CdnWebApplicationFirewallPolicy. :type policy_name: str - :param tags: CdnWebApplicationFirewallPolicy tags. - :type tags: dict[str, str] + :param cdn_web_application_firewall_policy_patch_parameters: CdnWebApplicationFirewallPolicy + parameters to be patched. + :type cdn_web_application_firewall_policy_patch_parameters: ~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicyPatchParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -396,7 +401,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CdnWebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CdnWebApplicationFirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -406,7 +411,7 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, policy_name=policy_name, - tags=tags, + cdn_web_application_firewall_policy_patch_parameters=cdn_web_application_firewall_policy_patch_parameters, cls=lambda x,y,z: x, **kwargs ) @@ -421,7 +426,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -458,12 +469,12 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=80, min_length=1, pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'), 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_profiles_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_profiles_operations.py index 0b0c7dbf4bde..f8786089ce84 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_profiles_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProfileListResult"] + # type: (...) -> Iterable["_models.ProfileListResult"] """Lists all of the CDN profiles within an Azure subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,12 +59,12 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.ProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -104,7 +104,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -120,7 +120,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProfileListResult"] + # type: (...) -> Iterable["_models.ProfileListResult"] """Lists all of the CDN profiles within a resource group. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -130,12 +130,12 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.ProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -176,7 +176,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -193,7 +193,7 @@ def get( profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Profile" + # type: (...) -> "_models.Profile" """Gets a CDN profile with the specified profile name under the specified subscription and resource group. @@ -206,12 +206,12 @@ def get( :rtype: ~azure.mgmt.cdn.models.Profile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Profile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Profile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -237,7 +237,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Profile', pipeline_response) @@ -252,16 +252,16 @@ def _create_initial( self, resource_group_name, # type: str profile_name, # type: str - profile, # type: "models.Profile" + profile, # type: "_models.Profile" **kwargs # type: Any ): - # type: (...) -> "models.Profile" - cls = kwargs.pop('cls', None) # type: ClsType["models.Profile"] + # type: (...) -> "_models.Profile" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Profile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -292,7 +292,7 @@ def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -314,10 +314,10 @@ def begin_create( self, resource_group_name, # type: str profile_name, # type: str - profile, # type: "models.Profile" + profile, # type: "_models.Profile" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Profile"] + # type: (...) -> LROPoller["_models.Profile"] """Creates a new CDN profile with a profile name under the specified subscription and resource group. @@ -338,7 +338,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Profile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Profile"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -363,7 +363,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -381,18 +387,16 @@ def _update_initial( self, resource_group_name, # type: str profile_name, # type: str - tags=None, # type: Optional[Dict[str, str]] + profile_update_parameters, # type: "_models.ProfileUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.Profile" - cls = kwargs.pop('cls', None) # type: ClsType["models.Profile"] + # type: (...) -> "_models.Profile" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Profile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _profile_update_parameters = models.ProfileUpdateParameters(tags=tags) - api_version = "2020-04-15" + api_version = "2020-09-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -415,7 +419,7 @@ def _update_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_profile_update_parameters, 'ProfileUpdateParameters') + body_content = self._serialize.body(profile_update_parameters, 'ProfileUpdateParameters') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -423,7 +427,7 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -442,10 +446,10 @@ def begin_update( self, resource_group_name, # type: str profile_name, # type: str - tags=None, # type: Optional[Dict[str, str]] + profile_update_parameters, # type: "_models.ProfileUpdateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Profile"] + # type: (...) -> LROPoller["_models.Profile"] """Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. @@ -453,8 +457,8 @@ def begin_update( :type resource_group_name: str :param profile_name: Name of the CDN profile which is unique within the resource group. :type profile_name: str - :param tags: Profile tags. - :type tags: dict[str, str] + :param profile_update_parameters: Profile properties needed to update an existing profile. + :type profile_update_parameters: ~azure.mgmt.cdn.models.ProfileUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -466,7 +470,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Profile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Profile"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -476,7 +480,7 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, profile_name=profile_name, - tags=tags, + profile_update_parameters=profile_update_parameters, cls=lambda x,y,z: x, **kwargs ) @@ -491,7 +495,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -517,7 +527,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -543,7 +553,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -597,7 +607,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -617,7 +633,7 @@ def generate_sso_uri( profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SsoUri" + # type: (...) -> "_models.SsoUri" """Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a standard profile; rules engine, advanced HTTP reports, and @@ -633,12 +649,12 @@ def generate_sso_uri( :rtype: ~azure.mgmt.cdn.models.SsoUri :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SsoUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SsoUri"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -664,7 +680,7 @@ def generate_sso_uri( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SsoUri', pipeline_response) @@ -681,7 +697,7 @@ def list_supported_optimization_types( profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SupportedOptimizationTypesListResult" + # type: (...) -> "_models.SupportedOptimizationTypesListResult" """Gets the supported optimization types for the current profile. A user can create an endpoint with an optimization type from the listed values. @@ -694,12 +710,12 @@ def list_supported_optimization_types( :rtype: ~azure.mgmt.cdn.models.SupportedOptimizationTypesListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SupportedOptimizationTypesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SupportedOptimizationTypesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" # Construct URL @@ -725,7 +741,7 @@ def list_supported_optimization_types( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SupportedOptimizationTypesListResult', pipeline_response) @@ -742,7 +758,7 @@ def list_resource_usage( profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ResourceUsageListResult"] + # type: (...) -> Iterable["_models.ResourceUsageListResult"] """Checks the quota and actual usage of endpoints under the given CDN profile. :param resource_group_name: Name of the Resource group within the Azure subscription. @@ -754,12 +770,12 @@ def list_resource_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.ResourceUsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceUsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceUsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -801,7 +817,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_resource_usage_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_resource_usage_operations.py index 92286c521c3b..3d3efd59e59d 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_resource_usage_operations.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_resource_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ResourceUsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ResourceUsageListResult"] + # type: (...) -> Iterable["_models.ResourceUsageListResult"] """Check the quota and actual usage of the CDN profiles under the given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,12 +57,12 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.ResourceUsageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceUsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceUsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-15" + api_version = "2020-09-01" accept = "application/json" def prepare_request(next_link=None): @@ -102,7 +102,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_routes_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_routes_operations.py new file mode 100644 index 000000000000..a031ab86f1a4 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_routes_operations.py @@ -0,0 +1,615 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RoutesOperations(object): + """RoutesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_endpoint( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RouteListResult"] + """Lists all of the existing origins within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.RouteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_endpoint.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RouteListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_endpoint.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes'} # type: ignore + + def get( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Route" + """Gets an existing route with the specified route name under the specified subscription, resource + group, profile, and AzureFrontDoor endpoint. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param route_name: Name of the routing rule. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Route, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.Route + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + route_name, # type: str + route, # type: "_models.Route" + **kwargs # type: Any + ): + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'Route') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Route', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + route_name, # type: str + route, # type: "_models.Route" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Route"] + """Creates a new route with the specified route name under the specified subscription, resource + group, profile, and AzureFrontDoor endpoint. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param route_name: Name of the routing rule. + :type route_name: str + :param route: Route properties. + :type route: ~azure.mgmt.cdn.models.Route + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + route_name=route_name, + route=route, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + route_name, # type: str + route_update_properties, # type: "_models.RouteUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route_update_properties, 'RouteUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Route', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + route_name, # type: str + route_update_properties, # type: "_models.RouteUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Route"] + """Updates an existing route with the specified route name under the specified subscription, + resource group, profile, and AzureFrontDoor endpoint. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param route_name: Name of the routing rule. + :type route_name: str + :param route_update_properties: Route update properties. + :type route_update_properties: ~azure.mgmt.cdn.models.RouteUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + route_name=route_name, + route_update_properties=route_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + profile_name, # type: str + endpoint_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing route with the specified route name under the specified subscription, + resource group, profile, and AzureFrontDoor endpoint. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param endpoint_name: Name of the endpoint under the profile which is unique globally. + :type endpoint_name: str + :param route_name: Name of the routing rule. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + route_name=route_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'endpointName': self._serialize.url("endpoint_name", endpoint_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_rule_sets_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_rule_sets_operations.py new file mode 100644 index 000000000000..cebfd981671f --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_rule_sets_operations.py @@ -0,0 +1,526 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RuleSetsOperations(object): + """RuleSetsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RuleSetListResult"] + """Lists existing AzureFrontDoor rule sets within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RuleSetListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.RuleSetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RuleSetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RuleSetListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets'} # type: ignore + + def get( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RuleSet" + """Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified + subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile which is unique globally. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RuleSet, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.RuleSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RuleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RuleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + rule_set, # type: "_models.RuleSet" + **kwargs # type: Any + ): + # type: (...) -> "_models.RuleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RuleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(rule_set, 'RuleSet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RuleSet', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RuleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + rule_set, # type: "_models.RuleSet" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RuleSet"] + """Creates a new rule set within the specified profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile which is unique globally. + :type rule_set_name: str + :param rule_set: RuleSet properties. + :type rule_set: ~azure.mgmt.cdn.models.RuleSet + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RuleSet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.RuleSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RuleSet"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + rule_set_name=rule_set_name, + rule_set=rule_set, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RuleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing AzureFrontDoor rule set with the specified rule set name under the + specified subscription, resource group and profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile which is unique globally. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + rule_set_name=rule_set_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}'} # type: ignore + + def list_resource_usage( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsagesListResult"] + """Checks the quota and actual usage of endpoints under the given CDN profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile which is unique globally. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_resource_usage.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_resource_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/usages'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_rules_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_rules_operations.py new file mode 100644 index 000000000000..dcbffdc2b4c1 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_rules_operations.py @@ -0,0 +1,611 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RulesOperations(object): + """RulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_rule_set( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RuleListResult"] + """Lists all of the existing delivery rules within a rule set. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.RuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_rule_set.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_rule_set.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules'} # type: ignore + + def get( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Rule" + """Gets an existing delivery rule within a rule set. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile. + :type rule_set_name: str + :param rule_name: Name of the delivery rule which is unique within the endpoint. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Rule, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.Rule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Rule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Rule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + rule_name, # type: str + rule, # type: "_models.Rule" + **kwargs # type: Any + ): + # type: (...) -> "_models.Rule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Rule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(rule, 'Rule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Rule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Rule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + rule_name, # type: str + rule, # type: "_models.Rule" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Rule"] + """Creates a new delivery rule within the specified rule set. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile. + :type rule_set_name: str + :param rule_name: Name of the delivery rule which is unique within the endpoint. + :type rule_name: str + :param rule: The delivery rule properties. + :type rule: ~azure.mgmt.cdn.models.Rule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Rule or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.Rule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Rule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + rule_set_name=rule_set_name, + rule_name=rule_name, + rule=rule, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Rule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + rule_name, # type: str + rule_update_properties, # type: "_models.RuleUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.Rule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Rule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(rule_update_properties, 'RuleUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Rule', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Rule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + rule_name, # type: str + rule_update_properties, # type: "_models.RuleUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Rule"] + """Updates an existing delivery rule within a rule set. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile. + :type rule_set_name: str + :param rule_name: Name of the delivery rule which is unique within the endpoint. + :type rule_name: str + :param rule_update_properties: Delivery rule properties. + :type rule_update_properties: ~azure.mgmt.cdn.models.RuleUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Rule or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.Rule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Rule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + rule_set_name=rule_set_name, + rule_name=rule_name, + rule_update_properties=rule_update_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Rule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + profile_name, # type: str + rule_set_name, # type: str + rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing delivery rule within a rule set. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param rule_set_name: Name of the rule set under the profile. + :type rule_set_name: str + :param rule_name: Name of the delivery rule which is unique within the endpoint. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + rule_set_name=rule_set_name, + rule_name=rule_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_secrets_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_secrets_operations.py new file mode 100644 index 000000000000..f4b8081306c9 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_secrets_operations.py @@ -0,0 +1,582 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SecretsOperations(object): + """SecretsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SecretListResult"] + """Lists existing AzureFrontDoor secrets. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecretListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.SecretListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecretListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SecretListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets'} # type: ignore + + def get( + self, + resource_group_name, # type: str + profile_name, # type: str + secret_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Secret" + """Gets an existing Secret within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param secret_name: Name of the Secret under the profile. + :type secret_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Secret, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.Secret + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + secret_name, # type: str + secret, # type: "_models.Secret" + **kwargs # type: Any + ): + # type: (...) -> "_models.Secret" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(secret, 'Secret') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Secret', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + profile_name, # type: str + secret_name, # type: str + secret, # type: "_models.Secret" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Secret"] + """Creates a new Secret within the specified profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param secret_name: Name of the Secret under the profile. + :type secret_name: str + :param secret: The Secret properties. + :type secret: ~azure.mgmt.cdn.models.Secret + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Secret or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.Secret] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + secret_name=secret_name, + secret=secret, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + secret_name, # type: str + secret_properties, # type: "_models.SecretProperties" + **kwargs # type: Any + ): + # type: (...) -> "_models.Secret" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(secret_properties, 'SecretProperties') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Secret', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + profile_name, # type: str + secret_name, # type: str + secret_properties, # type: "_models.SecretProperties" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Secret"] + """Updates an existing Secret within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param secret_name: Name of the Secret under the profile. + :type secret_name: str + :param secret_properties: Secret properties. + :type secret_properties: ~azure.mgmt.cdn.models.SecretProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Secret or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.Secret] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Secret"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + secret_name=secret_name, + secret_properties=secret_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Secret', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + secret_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + profile_name, # type: str + secret_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing Secret within profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param secret_name: Name of the Secret under the profile. + :type secret_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + secret_name=secret_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'secretName': self._serialize.url("secret_name", secret_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_security_policies_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_security_policies_operations.py new file mode 100644 index 000000000000..aa6921b5c6fa --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_security_policies_operations.py @@ -0,0 +1,582 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SecurityPoliciesOperations(object): + """SecurityPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_profile( + self, + resource_group_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SecurityPolicyListResult"] + """Lists security policies associated with the profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecurityPolicyListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cdn.models.SecurityPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SecurityPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.AfdErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies'} # type: ignore + + def get( + self, + resource_group_name, # type: str + profile_name, # type: str + security_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SecurityPolicy" + """Gets an existing security policy within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param security_policy_name: Name of the security policy under the profile. + :type security_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SecurityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.SecurityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + security_policy_name, # type: str + security_policy, # type: "_models.SecurityPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.SecurityPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_policy, 'SecurityPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + profile_name, # type: str + security_policy_name, # type: str + security_policy, # type: "_models.SecurityPolicy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SecurityPolicy"] + """Creates a new security policy within the specified profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param security_policy_name: Name of the security policy under the profile. + :type security_policy_name: str + :param security_policy: The security policy properties. + :type security_policy: ~azure.mgmt.cdn.models.SecurityPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SecurityPolicy or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + security_policy_name=security_policy_name, + security_policy=security_policy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + def _patch_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + security_policy_name, # type: str + security_policy_parameters, # type: "_models.SecurityPolicyWebApplicationFirewallParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.SecurityPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._patch_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_policy_parameters, 'SecurityPolicyWebApplicationFirewallParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _patch_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + def begin_patch( + self, + resource_group_name, # type: str + profile_name, # type: str + security_policy_name, # type: str + security_policy_parameters, # type: "_models.SecurityPolicyWebApplicationFirewallParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SecurityPolicy"] + """Updates an existing Secret within a profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param security_policy_name: Name of the security policy under the profile. + :type security_policy_name: str + :param security_policy_parameters: Security policy update properties. + :type security_policy_parameters: ~azure.mgmt.cdn.models.SecurityPolicyWebApplicationFirewallParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SecurityPolicy or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cdn.models.SecurityPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._patch_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + security_policy_name=security_policy_name, + security_policy_parameters=security_policy_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SecurityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + profile_name, # type: str + security_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + profile_name, # type: str + security_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing security policy within profile. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param profile_name: Name of the CDN profile which is unique within the resource group. + :type profile_name: str + :param security_policy_name: Name of the Secret under the profile. + :type security_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + security_policy_name=security_policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'securityPolicyName': self._serialize.url("security_policy_name", security_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_validate_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_validate_operations.py new file mode 100644 index 000000000000..b3545e35607f --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_validate_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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ValidateOperations(object): + """ValidateOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cdn.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def secret( + self, + validate_secret_input, # type: "_models.ValidateSecretInput" + **kwargs # type: Any + ): + # type: (...) -> "_models.ValidateSecretOutput" + """Validate a Secret in the profile. + + :param validate_secret_input: The Secret source. + :type validate_secret_input: ~azure.mgmt.cdn.models.ValidateSecretInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateSecretOutput, or the result of cls(response) + :rtype: ~azure.mgmt.cdn.models.ValidateSecretOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateSecretOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.secret.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_secret_input, 'ValidateSecretInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.AfdErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateSecretOutput', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + secret.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateSecret'} # type: ignore diff --git a/sdk/cdn/azure-mgmt-cdn/tests/recordings/test_cli_mgmt_cdn.test_cdn.yaml b/sdk/cdn/azure-mgmt-cdn/tests/recordings/test_cli_mgmt_cdn.test_cdn.yaml index 9666db836e50..e94adf8b04c5 100644 --- a/sdk/cdn/azure-mgmt-cdn/tests/recordings/test_cli_mgmt_cdn.test_cdn.yaml +++ b/sdk/cdn/azure-mgmt-cdn/tests/recordings/test_cli_mgmt_cdn.test_cdn.yaml @@ -13,23 +13,23 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename","type":"Microsoft.Cdn/profiles","name":"profilename","location":"WestUs","tags":{},"sku":{"name":"Standard_Verizon"},"properties":{"resourceState":"Creating","provisioningState":"Creating"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename","type":"Microsoft.Cdn/profiles","name":"profilename","location":"WestUs","kind":"cdn","tags":{},"sku":{"name":"Standard_Verizon"},"properties":{"resourceState":"Creating","provisioningState":"Creating"}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e7928965-2f32-4b1f-b5e3-94d42189413a?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e2c8a893-4277-4296-ad75-a4ece217a8b9?api-version=2020-09-01 cache-control: - no-cache content-length: - - '345' + - '358' content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:55:12 GMT + - Tue, 19 Jan 2021 09:13:16 GMT expires: - '-1' pragma: @@ -55,9 +55,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e7928965-2f32-4b1f-b5e3-94d42189413a?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e2c8a893-4277-4296-ad75-a4ece217a8b9?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -69,7 +69,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:55:23 GMT + - Tue, 19 Jan 2021 09:13:26 GMT expires: - '-1' pragma: @@ -97,9 +97,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e7928965-2f32-4b1f-b5e3-94d42189413a?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e2c8a893-4277-4296-ad75-a4ece217a8b9?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -111,7 +111,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:55:53 GMT + - Tue, 19 Jan 2021 09:13:57 GMT expires: - '-1' pragma: @@ -139,9 +139,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e7928965-2f32-4b1f-b5e3-94d42189413a?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e2c8a893-4277-4296-ad75-a4ece217a8b9?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -153,7 +153,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:56:23 GMT + - Tue, 19 Jan 2021 09:14:27 GMT expires: - '-1' pragma: @@ -181,9 +181,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e7928965-2f32-4b1f-b5e3-94d42189413a?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e2c8a893-4277-4296-ad75-a4ece217a8b9?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -195,7 +195,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:56:53 GMT + - Tue, 19 Jan 2021 09:14:58 GMT expires: - '-1' pragma: @@ -223,9 +223,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e7928965-2f32-4b1f-b5e3-94d42189413a?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e2c8a893-4277-4296-ad75-a4ece217a8b9?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -237,7 +237,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:57:24 GMT + - Tue, 19 Jan 2021 09:15:28 GMT expires: - '-1' pragma: @@ -265,9 +265,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e7928965-2f32-4b1f-b5e3-94d42189413a?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e2c8a893-4277-4296-ad75-a4ece217a8b9?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -279,7 +279,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:57:55 GMT + - Tue, 19 Jan 2021 09:15:59 GMT expires: - '-1' pragma: @@ -307,9 +307,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e7928965-2f32-4b1f-b5e3-94d42189413a?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e2c8a893-4277-4296-ad75-a4ece217a8b9?api-version=2020-09-01 response: body: string: '{"status":"Succeeded","error":{"code":"None","message":null}}' @@ -321,7 +321,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:58:25 GMT + - Tue, 19 Jan 2021 09:16:30 GMT expires: - '-1' pragma: @@ -349,21 +349,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename","type":"Microsoft.Cdn/profiles","name":"profilename","location":"WestUs","tags":{},"sku":{"name":"Standard_Verizon"},"properties":{"resourceState":"Active","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename","type":"Microsoft.Cdn/profiles","name":"profilename","location":"WestUs","kind":"cdn","tags":{},"sku":{"name":"Standard_Verizon"},"properties":{"resourceState":"Active","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '344' + - '357' content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:58:26 GMT + - Tue, 19 Jan 2021 09:16:31 GMT expires: - '-1' pragma: @@ -401,15 +401,15 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x","type":"Microsoft.Cdn/profiles/endpoints","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":null,"httpsPort":null,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":null,"webApplicationFirewallPolicyLink":null,"resourceState":"Creating","provisioningState":"Creating"}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/f1c1dd12-c591-43df-b20e-c123a630aae6?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/f86afc75-fa03-4090-838a-97f98a89de9a?api-version=2020-09-01 cache-control: - no-cache content-length: @@ -417,7 +417,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:58:41 GMT + - Tue, 19 Jan 2021 09:16:47 GMT expires: - '-1' pragma: @@ -443,9 +443,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/f1c1dd12-c591-43df-b20e-c123a630aae6?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/f86afc75-fa03-4090-838a-97f98a89de9a?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -457,7 +457,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:58:51 GMT + - Tue, 19 Jan 2021 09:16:57 GMT expires: - '-1' pragma: @@ -485,51 +485,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/f1c1dd12-c591-43df-b20e-c123a630aae6?api-version=2020-04-15 - response: - body: - string: '{"status":"InProgress","error":{"code":"None","message":null}}' - headers: - cache-control: - - no-cache - content-length: - - '62' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 02 Nov 2020 07:59:21 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/f1c1dd12-c591-43df-b20e-c123a630aae6?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/f86afc75-fa03-4090-838a-97f98a89de9a?api-version=2020-09-01 response: body: string: '{"status":"Succeeded","error":{"code":"None","message":null}}' @@ -541,7 +499,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:59:52 GMT + - Tue, 19 Jan 2021 09:17:27 GMT expires: - '-1' pragma: @@ -569,9 +527,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x","type":"Microsoft.Cdn/profiles/endpoints","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":null,"httpsPort":null,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Running","provisioningState":"Succeeded"}}' @@ -583,7 +541,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:59:53 GMT + - Tue, 19 Jan 2021 09:17:28 GMT expires: - '-1' pragma: @@ -613,9 +571,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/origins/origin1?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/origins/origin1?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/origins/origin1","type":"Microsoft.Cdn/profiles/endpoints/origins","name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":null,"httpsPort":null,"resourceState":"Active","originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null,"provisioningState":"Succeeded"}}' @@ -627,7 +585,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:59:54 GMT + - Tue, 19 Jan 2021 09:17:29 GMT expires: - '-1' pragma: @@ -655,9 +613,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x","type":"Microsoft.Cdn/profiles/endpoints","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":null,"httpsPort":null,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Running","provisioningState":"Succeeded"}}' @@ -669,7 +627,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:59:55 GMT + - Tue, 19 Jan 2021 09:17:30 GMT expires: - '-1' pragma: @@ -699,21 +657,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename","type":"Microsoft.Cdn/profiles","name":"profilename","location":"WestUs","tags":{},"sku":{"name":"Standard_Verizon"},"properties":{"resourceState":"Active","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename","type":"Microsoft.Cdn/profiles","name":"profilename","location":"WestUs","kind":"cdn","tags":{},"sku":{"name":"Standard_Verizon"},"properties":{"resourceState":"Active","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '344' + - '357' content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:59:55 GMT + - Tue, 19 Jan 2021 09:17:30 GMT expires: - '-1' pragma: @@ -747,15 +705,15 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/origins/origin1?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/origins/origin1?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/origins/origin1","type":"Microsoft.Cdn/profiles/endpoints/origins","name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"resourceState":"Active","originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null,"provisioningState":"Succeeded"}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/3b982807-25e3-408b-82bc-d5fd4ac8560f?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/719b058f-4577-4e53-88cc-9bdb1b210ab6?api-version=2020-09-01 cache-control: - no-cache content-length: @@ -763,11 +721,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 07:59:59 GMT + - Tue, 19 Jan 2021 09:17:33 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/3b982807-25e3-408b-82bc-d5fd4ac8560f/profileresults/profilename/endpointresults/endpoint9527x/originresults/origin1?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/719b058f-4577-4e53-88cc-9bdb1b210ab6/profileresults/profilename/endpointresults/endpoint9527x/originresults/origin1?api-version=2020-09-01 pragma: - no-cache server: @@ -777,7 +735,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 202 message: Accepted @@ -791,9 +749,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/3b982807-25e3-408b-82bc-d5fd4ac8560f?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/719b058f-4577-4e53-88cc-9bdb1b210ab6?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -805,7 +763,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:00:10 GMT + - Tue, 19 Jan 2021 09:17:44 GMT expires: - '-1' pragma: @@ -833,9 +791,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/3b982807-25e3-408b-82bc-d5fd4ac8560f?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/719b058f-4577-4e53-88cc-9bdb1b210ab6?api-version=2020-09-01 response: body: string: '{"status":"Succeeded","error":{"code":"None","message":null}}' @@ -847,7 +805,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:00:41 GMT + - Tue, 19 Jan 2021 09:18:14 GMT expires: - '-1' pragma: @@ -875,9 +833,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/origins/origin1?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/origins/origin1?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/origins/origin1","type":"Microsoft.Cdn/profiles/endpoints/origins","name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"resourceState":"Active","originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null,"provisioningState":"Succeeded"}}' @@ -889,7 +847,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:00:41 GMT + - Tue, 19 Jan 2021 09:18:15 GMT expires: - '-1' pragma: @@ -921,9 +879,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/validateCustomDomain?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/validateCustomDomain?api-version=2020-09-01 response: body: string: '{"customDomainValidated":false,"reason":"IncorrectMapping","message":"We @@ -938,7 +896,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:00:43 GMT + - Tue, 19 Jan 2021 09:18:16 GMT expires: - '-1' pragma: @@ -954,7 +912,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK @@ -972,25 +930,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/purge?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/purge?api-version=2020-09-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/9ba2c0f3-8759-44fe-bce2-63949b1d415f?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7ef531fb-7029-4c6e-80a5-55ea49334cea?api-version=2020-09-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 02 Nov 2020 08:00:49 GMT + - Tue, 19 Jan 2021 09:18:19 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/9ba2c0f3-8759-44fe-bce2-63949b1d415f/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7ef531fb-7029-4c6e-80a5-55ea49334cea/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-09-01 pragma: - no-cache server: @@ -1014,9 +972,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/9ba2c0f3-8759-44fe-bce2-63949b1d415f?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7ef531fb-7029-4c6e-80a5-55ea49334cea?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1028,7 +986,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:00:59 GMT + - Tue, 19 Jan 2021 09:18:31 GMT expires: - '-1' pragma: @@ -1056,9 +1014,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/9ba2c0f3-8759-44fe-bce2-63949b1d415f?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7ef531fb-7029-4c6e-80a5-55ea49334cea?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1070,7 +1028,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:01:29 GMT + - Tue, 19 Jan 2021 09:19:01 GMT expires: - '-1' pragma: @@ -1098,9 +1056,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/9ba2c0f3-8759-44fe-bce2-63949b1d415f?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7ef531fb-7029-4c6e-80a5-55ea49334cea?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1112,7 +1070,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:02:00 GMT + - Tue, 19 Jan 2021 09:19:31 GMT expires: - '-1' pragma: @@ -1140,9 +1098,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/9ba2c0f3-8759-44fe-bce2-63949b1d415f?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7ef531fb-7029-4c6e-80a5-55ea49334cea?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1154,7 +1112,91 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:02:30 GMT + - Tue, 19 Jan 2021 09:20:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7ef531fb-7029-4c6e-80a5-55ea49334cea?api-version=2020-09-01 + response: + body: + string: '{"status":"Succeeded","error":{"code":"None","message":null}}' + headers: + cache-control: + - no-cache + content-length: + - '61' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 19 Jan 2021 09:20:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7ef531fb-7029-4c6e-80a5-55ea49334cea/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7ef531fb-7029-4c6e-80a5-55ea49334cea/profileresults/profilename/endpointresults/endpoint9527x","type":"Microsoft.Cdn/operationresults/profileresults/endpointresults","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Running","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '1254' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 19 Jan 2021 09:20:33 GMT expires: - '-1' pragma: @@ -1172,6 +1214,52 @@ interactions: status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/stop?api-version=2020-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x","type":"Microsoft.Cdn/profiles/endpoints","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Stopping","provisioningState":"Succeeded"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a031b57a-b7e7-4583-8a22-5de6e5997cce?api-version=2020-09-01 + cache-control: + - no-cache + content-length: + - '1160' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 19 Jan 2021 09:20:37 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a031b57a-b7e7-4583-8a22-5de6e5997cce/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-09-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '49' + status: + code: 202 + message: Accepted - request: body: null headers: @@ -1182,9 +1270,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/9ba2c0f3-8759-44fe-bce2-63949b1d415f?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a031b57a-b7e7-4583-8a22-5de6e5997cce?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1196,7 +1284,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:03:01 GMT + - Tue, 19 Jan 2021 09:20:47 GMT expires: - '-1' pragma: @@ -1224,9 +1312,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/9ba2c0f3-8759-44fe-bce2-63949b1d415f?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a031b57a-b7e7-4583-8a22-5de6e5997cce?api-version=2020-09-01 response: body: string: '{"status":"Succeeded","error":{"code":"None","message":null}}' @@ -1238,7 +1326,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:03:31 GMT + - Tue, 19 Jan 2021 09:21:17 GMT expires: - '-1' pragma: @@ -1266,12 +1354,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/9ba2c0f3-8759-44fe-bce2-63949b1d415f/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a031b57a-b7e7-4583-8a22-5de6e5997cce/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/9ba2c0f3-8759-44fe-bce2-63949b1d415f/profileresults/profilename/endpointresults/endpoint9527x","type":"Microsoft.Cdn/operationresults/profileresults/endpointresults","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Running","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a031b57a-b7e7-4583-8a22-5de6e5997cce/profileresults/profilename/endpointresults/endpoint9527x","type":"Microsoft.Cdn/operationresults/profileresults/endpointresults","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Stopped","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -1280,7 +1368,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:03:31 GMT + - Tue, 19 Jan 2021 09:21:18 GMT expires: - '-1' pragma: @@ -1310,15 +1398,15 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/stop?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/start?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x","type":"Microsoft.Cdn/profiles/endpoints","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Stopping","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x","type":"Microsoft.Cdn/profiles/endpoints","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Starting","provisioningState":"Succeeded"}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/b80ce64a-cfc0-4dcc-a09a-b4c47328d7dd?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/5e8fa28d-bf6a-4436-884c-823bd8e37eb2?api-version=2020-09-01 cache-control: - no-cache content-length: @@ -1326,11 +1414,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:03:34 GMT + - Tue, 19 Jan 2021 09:21:21 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/b80ce64a-cfc0-4dcc-a09a-b4c47328d7dd/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/5e8fa28d-bf6a-4436-884c-823bd8e37eb2/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-09-01 pragma: - no-cache server: @@ -1354,9 +1442,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/b80ce64a-cfc0-4dcc-a09a-b4c47328d7dd?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/5e8fa28d-bf6a-4436-884c-823bd8e37eb2?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1368,7 +1456,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:03:45 GMT + - Tue, 19 Jan 2021 09:21:32 GMT expires: - '-1' pragma: @@ -1396,9 +1484,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/b80ce64a-cfc0-4dcc-a09a-b4c47328d7dd?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/5e8fa28d-bf6a-4436-884c-823bd8e37eb2?api-version=2020-09-01 response: body: string: '{"status":"Succeeded","error":{"code":"None","message":null}}' @@ -1410,7 +1498,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:04:15 GMT + - Tue, 19 Jan 2021 09:22:02 GMT expires: - '-1' pragma: @@ -1438,12 +1526,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/b80ce64a-cfc0-4dcc-a09a-b4c47328d7dd/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/5e8fa28d-bf6a-4436-884c-823bd8e37eb2/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/b80ce64a-cfc0-4dcc-a09a-b4c47328d7dd/profileresults/profilename/endpointresults/endpoint9527x","type":"Microsoft.Cdn/operationresults/profileresults/endpointresults","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Stopped","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/5e8fa28d-bf6a-4436-884c-823bd8e37eb2/profileresults/profilename/endpointresults/endpoint9527x","type":"Microsoft.Cdn/operationresults/profileresults/endpointresults","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Running","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -1452,7 +1540,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:04:15 GMT + - Tue, 19 Jan 2021 09:22:03 GMT expires: - '-1' pragma: @@ -1471,7 +1559,7 @@ interactions: code: 200 message: OK - request: - body: null + body: '{"contentPaths": ["/folder1"]}' headers: Accept: - application/json @@ -1480,29 +1568,29 @@ interactions: Connection: - keep-alive Content-Length: - - '0' + - '30' + Content-Type: + - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/start?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/load?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x","type":"Microsoft.Cdn/profiles/endpoints","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Starting","provisioningState":"Succeeded"}}' + string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/085a37bc-7e56-4d5a-95f4-105962226e05?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 cache-control: - no-cache content-length: - - '1160' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Mon, 02 Nov 2020 08:04:17 GMT + - Tue, 19 Jan 2021 09:22:06 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/085a37bc-7e56-4d5a-95f4-105962226e05/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-09-01 pragma: - no-cache server: @@ -1512,7 +1600,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-resource-requests: - - '49' + - '499' status: code: 202 message: Accepted @@ -1526,9 +1614,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/085a37bc-7e56-4d5a-95f4-105962226e05?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1540,7 +1628,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:04:28 GMT + - Tue, 19 Jan 2021 09:22:17 GMT expires: - '-1' pragma: @@ -1568,21 +1656,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/085a37bc-7e56-4d5a-95f4-105962226e05?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: - string: '{"status":"Succeeded","error":{"code":"None","message":null}}' + string: '{"status":"InProgress","error":{"code":"None","message":null}}' headers: cache-control: - no-cache content-length: - - '61' + - '62' content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:04:59 GMT + - Tue, 19 Jan 2021 09:22:47 GMT expires: - '-1' pragma: @@ -1610,21 +1698,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/085a37bc-7e56-4d5a-95f4-105962226e05/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/085a37bc-7e56-4d5a-95f4-105962226e05/profileresults/profilename/endpointresults/endpoint9527x","type":"Microsoft.Cdn/operationresults/profileresults/endpointresults","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Running","provisioningState":"Succeeded"}}' + string: '{"status":"InProgress","error":{"code":"None","message":null}}' headers: cache-control: - no-cache content-length: - - '1254' + - '62' content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:04:59 GMT + - Tue, 19 Jan 2021 09:23:17 GMT expires: - '-1' pragma: @@ -1643,51 +1731,131 @@ interactions: code: 200 message: OK - request: - body: '{"contentPaths": ["/folder1"]}' + body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive - Content-Length: - - '30' - Content-Type: - - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/load?api-version=2020-04-15 + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: - string: '' + string: '{"status":"InProgress","error":{"code":"None","message":null}}' headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 cache-control: - no-cache content-length: - - '0' + - '62' + content-type: + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:05:03 GMT + - Tue, 19 Jan 2021 09:23:48 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-04-15 pragma: - no-cache server: - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-resource-requests: - - '499' status: - code: 202 - message: Accepted + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 + response: + body: + string: '{"status":"InProgress","error":{"code":"None","message":null}}' + headers: + cache-control: + - no-cache + content-length: + - '62' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 19 Jan 2021 09:24:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 + response: + body: + string: '{"status":"InProgress","error":{"code":"None","message":null}}' + headers: + cache-control: + - no-cache + content-length: + - '62' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 19 Jan 2021 09:24:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -1698,9 +1866,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1712,7 +1880,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:05:13 GMT + - Tue, 19 Jan 2021 09:25:20 GMT expires: - '-1' pragma: @@ -1740,9 +1908,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1754,7 +1922,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:05:43 GMT + - Tue, 19 Jan 2021 09:25:50 GMT expires: - '-1' pragma: @@ -1782,9 +1950,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1796,7 +1964,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:06:14 GMT + - Tue, 19 Jan 2021 09:26:20 GMT expires: - '-1' pragma: @@ -1824,9 +1992,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1838,7 +2006,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:06:44 GMT + - Tue, 19 Jan 2021 09:26:52 GMT expires: - '-1' pragma: @@ -1866,9 +2034,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1880,7 +2048,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:07:15 GMT + - Tue, 19 Jan 2021 09:27:22 GMT expires: - '-1' pragma: @@ -1908,9 +2076,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1922,7 +2090,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:07:45 GMT + - Tue, 19 Jan 2021 09:27:52 GMT expires: - '-1' pragma: @@ -1950,9 +2118,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -1964,7 +2132,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:08:15 GMT + - Tue, 19 Jan 2021 09:28:23 GMT expires: - '-1' pragma: @@ -1992,9 +2160,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -2006,7 +2174,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:08:45 GMT + - Tue, 19 Jan 2021 09:28:53 GMT expires: - '-1' pragma: @@ -2034,9 +2202,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: string: '{"status":"InProgress","error":{"code":"None","message":null}}' @@ -2048,7 +2216,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:09:16 GMT + - Tue, 19 Jan 2021 09:29:24 GMT expires: - '-1' pragma: @@ -2076,42 +2244,35 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: - string: "{\r\n \"status\":\"InProgress\",\"error\":{\r\n \"code\":\"None\"\ - ,\"message\":null\r\n }\r\n}" + string: '{"status":"InProgress","error":{"code":"None","message":null}}' headers: cache-control: - no-cache content-length: - - '78' + - '62' content-type: - - application/json; odata.metadata=minimal + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:09:48 GMT + - Tue, 19 Jan 2021 09:29:54 GMT expires: - '-1' - odata-version: - - '4.0' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked vary: - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-powered-by: - - ASP.NET status: code: 200 message: OK @@ -2125,42 +2286,35 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: - string: "{\r\n \"status\":\"InProgress\",\"error\":{\r\n \"code\":\"None\"\ - ,\"message\":null\r\n }\r\n}" + string: '{"status":"InProgress","error":{"code":"None","message":null}}' headers: cache-control: - no-cache content-length: - - '78' + - '62' content-type: - - application/json; odata.metadata=minimal + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:10:18 GMT + - Tue, 19 Jan 2021 09:30:25 GMT expires: - '-1' - odata-version: - - '4.0' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked vary: - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-powered-by: - - ASP.NET status: code: 200 message: OK @@ -2174,42 +2328,35 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3?api-version=2020-09-01 response: body: - string: "{\r\n \"status\":\"Succeeded\",\"error\":{\r\n \"code\":\"None\"\ - ,\"message\":null\r\n }\r\n}" + string: '{"status":"Succeeded","error":{"code":"None","message":null}}' headers: cache-control: - no-cache content-length: - - '77' + - '61' content-type: - - application/json; odata.metadata=minimal + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:10:49 GMT + - Tue, 19 Jan 2021 09:30:55 GMT expires: - '-1' - odata-version: - - '4.0' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked vary: - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-powered-by: - - ASP.NET status: code: 200 message: OK @@ -2223,58 +2370,35 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-09-01 response: body: - string: "{\r\n \"name\":\"endpoint9527x\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/a051631c-835a-452e-8c1f-b0415e491816/profileresults/profilename/endpointresults/endpoint9527x\"\ - ,\"type\":\"Microsoft.Cdn/operationresults/profileresults/endpointresults\"\ - ,\"tags\":{\r\n \"kay1\":\"value1\"\r\n },\"location\":\"WestUs\",\"properties\"\ - :{\r\n \"hostName\":\"endpoint9527x.azureedge.net\",\"originHostHeader\"\ - :\"www.bing.com\",\"provisioningState\":\"Succeeded\",\"resourceState\":\"\ - Running\",\"isHttpAllowed\":true,\"isHttpsAllowed\":true,\"queryStringCachingBehavior\"\ - :\"BypassCaching\",\"originPath\":\"/image\",\"origins\":[\r\n {\r\n\ - \ \"name\":\"origin1\",\"properties\":{\r\n \"hostName\":\"\ - host1.hello.com\",\"httpPort\":42,\"httpsPort\":43,\"originHostHeader\":null,\"\ - priority\":null,\"weight\":null,\"enabled\":true,\"privateLinkResourceId\"\ - :null,\"privateLinkLocation\":null,\"privateLinkAlias\":null,\"privateEndpointStatus\"\ - :null,\"privateLinkApprovalMessage\":null\r\n }\r\n }\r\n ],\"\ - originGroups\":[\r\n \r\n ],\"defaultOriginGroup\":null,\"customDomains\"\ - :[\r\n \r\n ],\"contentTypesToCompress\":[\r\n \"text/html\"\ - ,\"application/octet-stream\"\r\n ],\"isCompressionEnabled\":true,\"optimizationType\"\ - :null,\"probePath\":null,\"geoFilters\":[\r\n \r\n ],\"deliveryPolicy\"\ - :null,\"webApplicationFirewallPolicyLink\":null,\"urlSigningKeys\":[\r\n \ - \ \r\n ]\r\n }\r\n}" + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/8d4328e1-ebca-4b30-acc7-9fc94c0846e3/profileresults/profilename/endpointresults/endpoint9527x","type":"Microsoft.Cdn/operationresults/profileresults/endpointresults","name":"endpoint9527x","location":"WestUs","tags":{"kay1":"value1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Running","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '1404' + - '1254' content-type: - - application/json; odata.metadata=minimal + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:10:50 GMT + - Tue, 19 Jan 2021 09:30:56 GMT expires: - '-1' - odata-version: - - '4.0' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked vary: - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-powered-by: - - ASP.NET status: code: 200 message: OK @@ -2290,9 +2414,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/getSupportedOptimizationTypes?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/getSupportedOptimizationTypes?api-version=2020-09-01 response: body: string: '{"supportedOptimizationTypes":["GeneralWebDelivery","DynamicSiteAcceleration"]}' @@ -2304,7 +2428,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:10:51 GMT + - Tue, 19 Jan 2021 09:30:57 GMT expires: - '-1' pragma: @@ -2320,7 +2444,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1196' status: code: 200 message: OK @@ -2338,9 +2462,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x?api-version=2020-09-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x","type":"Microsoft.Cdn/profiles/endpoints","name":"endpoint9527x","location":"WestUs","tags":{"additional_properties":"Tag1"},"properties":{"hostName":"endpoint9527x.azureedge.net","originHostHeader":"www.bing.com","originPath":"/image","contentTypesToCompress":["text/html","application/octet-stream"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"BypassCaching","optimizationType":null,"probePath":null,"origins":[{"name":"origin1","properties":{"hostName":"host1.hello.com","httpPort":42,"httpsPort":43,"originHostHeader":null,"priority":null,"weight":null,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[],"geoFilters":[],"deliveryPolicy":null,"urlSigningKeys":[],"webApplicationFirewallPolicyLink":null,"resourceState":"Running","provisioningState":"Succeeded"}}' @@ -2352,7 +2476,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:10:56 GMT + - Tue, 19 Jan 2021 09:31:05 GMT expires: - '-1' pragma: @@ -2384,21 +2508,21 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/generateSsoUri?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/generateSsoUri?api-version=2020-09-01 response: body: - string: '{"ssoUriValue":"https://cdn.windowsazure.com/account/loginexternal/?token=d2D8BTAYQbDba3pJhswqQTYEAR%2fk8rWOP6lUimDYswI%3d×tamp=2020-11-02T08:10:57.4685455Z&cdnAccountId=FD5E1&userCustomId=SSO-ce3f2905-3c79-4bc5-8285-b8af6ed2c3fc&restEndpointId=0"}' + string: '{"ssoUriValue":"https://cdn.windowsazure.com/account/loginexternal/?token=HHH62oZ2NImhVjehJbhWewufxl%2fXiOso7COYzafMX%2bs%3d×tamp=2021-01-19T09:31:06.9462439Z&cdnAccountId=1073D0&userCustomId=SSO-f4fef8bd-1bba-4dbc-ab03-001753a41877&restEndpointId=0"}' headers: cache-control: - no-cache content-length: - - '253' + - '256' content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:10:56 GMT + - Tue, 19 Jan 2021 09:31:06 GMT expires: - '-1' pragma: @@ -2414,12 +2538,12 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1195' status: code: 200 message: OK - request: - body: '{"tags": {"tags": "{''additional_properties'': ''Tag1''}"}}' + body: '{"tags": {"additional_properties": "Tag1"}}' headers: Accept: - application/json @@ -2428,32 +2552,31 @@ interactions: Connection: - keep-alive Content-Length: - - '55' + - '43' Content-Type: - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename","type":"Microsoft.Cdn/profiles","name":"profilename","location":"WestUs","tags":{"tags":"{''additional_properties'': - ''Tag1''}"},"sku":{"name":"Standard_Verizon"},"properties":{"resourceState":"Active","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename","type":"Microsoft.Cdn/profiles","name":"profilename","location":"WestUs","kind":"cdn","tags":{"additional_properties":"Tag1"},"sku":{"name":"Standard_Verizon"},"properties":{"resourceState":"Active","provisioningState":"Succeeded"}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/ca3e527b-3395-4faa-8a75-d632cf9e8220?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7508941d-62c7-4b10-aa2b-ee3d0d7c3718?api-version=2020-09-01 cache-control: - no-cache content-length: - - '386' + - '387' content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:10:58 GMT + - Tue, 19 Jan 2021 09:31:08 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/ca3e527b-3395-4faa-8a75-d632cf9e8220/profileresults/profilename?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7508941d-62c7-4b10-aa2b-ee3d0d7c3718/profileresults/profilename?api-version=2020-09-01 pragma: - no-cache server: @@ -2477,42 +2600,35 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/ca3e527b-3395-4faa-8a75-d632cf9e8220?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/7508941d-62c7-4b10-aa2b-ee3d0d7c3718?api-version=2020-09-01 response: body: - string: "{\r\n \"status\":\"Succeeded\",\"error\":{\r\n \"code\":\"None\"\ - ,\"message\":null\r\n }\r\n}" + string: '{"status":"Succeeded","error":{"code":"None","message":null}}' headers: cache-control: - no-cache content-length: - - '77' + - '61' content-type: - - application/json; odata.metadata=minimal + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:11:09 GMT + - Tue, 19 Jan 2021 09:31:19 GMT expires: - '-1' - odata-version: - - '4.0' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked vary: - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-powered-by: - - ASP.NET status: code: 200 message: OK @@ -2526,22 +2642,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename","type":"Microsoft.Cdn/profiles","name":"profilename","location":"WestUs","tags":{"tags":"{''additional_properties'': - ''Tag1''}"},"sku":{"name":"Standard_Verizon"},"properties":{"resourceState":"Active","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename","type":"Microsoft.Cdn/profiles","name":"profilename","location":"WestUs","kind":"cdn","tags":{"additional_properties":"Tag1"},"sku":{"name":"Standard_Verizon"},"properties":{"resourceState":"Active","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '386' + - '387' content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:11:09 GMT + - Tue, 19 Jan 2021 09:31:19 GMT expires: - '-1' pragma: @@ -2575,43 +2690,37 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Cdn/checkNameAvailability?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Cdn/checkNameAvailability?api-version=2020-09-01 response: body: - string: "{\r\n \"nameAvailable\":true,\"reason\":null,\"message\":null\r\n}" + string: '{"nameAvailable":true,"reason":null,"message":null}' headers: cache-control: - no-cache content-length: - - '57' + - '51' content-type: - - application/json; odata.metadata=minimal + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:11:11 GMT + - Tue, 19 Jan 2021 09:31:21 GMT expires: - '-1' - odata-version: - - '4.0' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked vary: - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' - x-powered-by: - - ASP.NET + - '1194' status: code: 200 message: OK @@ -2629,44 +2738,37 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Cdn/validateProbe?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Cdn/validateProbe?api-version=2020-09-01 response: body: - string: "{\r\n \"isValid\":true,\"errorCode\":\"None\",\"message\":null\r\n\ - }" + string: '{"isValid":true,"errorCode":"None","message":null}' headers: cache-control: - no-cache content-length: - - '56' + - '50' content-type: - - application/json; odata.metadata=minimal + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:11:13 GMT + - Tue, 19 Jan 2021 09:31:21 GMT expires: - '-1' - odata-version: - - '4.0' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked vary: - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1195' - x-powered-by: - - ASP.NET + - '1193' status: code: 200 message: OK @@ -2684,9 +2786,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/providers/Microsoft.Cdn/checkNameAvailability?api-version=2020-04-15 + uri: https://management.azure.com/providers/Microsoft.Cdn/checkNameAvailability?api-version=2020-09-01 response: body: string: '{"nameAvailable":true,"reason":null,"message":null}' @@ -2698,7 +2800,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:11:13 GMT + - Tue, 19 Jan 2021 09:31:22 GMT expires: - '-1' pragma: @@ -2730,9 +2832,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/customDomains/someDomain?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x/customDomains/someDomain?api-version=2020-09-01 response: body: string: '' @@ -2740,7 +2842,7 @@ interactions: cache-control: - no-cache date: - - Mon, 02 Nov 2020 08:11:14 GMT + - Tue, 19 Jan 2021 09:31:24 GMT expires: - '-1' pragma: @@ -2752,7 +2854,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14997' status: code: 204 message: No Content @@ -2768,25 +2870,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename/endpoints/endpoint9527x?api-version=2020-09-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e23e15aa-9ac5-43d6-bc75-65b055360852?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e4554fb3-b027-4f3b-9ae0-ee71958abaad?api-version=2020-09-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 02 Nov 2020 08:11:15 GMT + - Tue, 19 Jan 2021 09:31:27 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e23e15aa-9ac5-43d6-bc75-65b055360852/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e4554fb3-b027-4f3b-9ae0-ee71958abaad/profileresults/profilename/endpointresults/endpoint9527x?api-version=2020-09-01 pragma: - no-cache server: @@ -2796,7 +2898,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14996' status: code: 202 message: Accepted @@ -2810,42 +2912,35 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e23e15aa-9ac5-43d6-bc75-65b055360852?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e4554fb3-b027-4f3b-9ae0-ee71958abaad?api-version=2020-09-01 response: body: - string: "{\r\n \"status\":\"InProgress\",\"error\":{\r\n \"code\":\"None\"\ - ,\"message\":null\r\n }\r\n}" + string: '{"status":"InProgress","error":{"code":"None","message":null}}' headers: cache-control: - no-cache content-length: - - '78' + - '62' content-type: - - application/json; odata.metadata=minimal + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:11:25 GMT + - Tue, 19 Jan 2021 09:31:37 GMT expires: - '-1' - odata-version: - - '4.0' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked vary: - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-powered-by: - - ASP.NET status: code: 200 message: OK @@ -2859,42 +2954,77 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e23e15aa-9ac5-43d6-bc75-65b055360852?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e4554fb3-b027-4f3b-9ae0-ee71958abaad?api-version=2020-09-01 response: body: - string: "{\r\n \"status\":\"Succeeded\",\"error\":{\r\n \"code\":\"None\"\ - ,\"message\":null\r\n }\r\n}" + string: '{"status":"InProgress","error":{"code":"None","message":null}}' headers: cache-control: - no-cache content-length: - - '77' + - '62' content-type: - - application/json; odata.metadata=minimal + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:11:56 GMT + - Tue, 19 Jan 2021 09:32:09 GMT expires: - '-1' - odata-version: - - '4.0' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/e4554fb3-b027-4f3b-9ae0-ee71958abaad?api-version=2020-09-01 + response: + body: + string: '{"status":"Succeeded","error":{"code":"None","message":null}}' + headers: + cache-control: + - no-cache + content-length: + - '61' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 19 Jan 2021 09:32:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked vary: - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-powered-by: - - ASP.NET status: code: 200 message: OK @@ -2910,25 +3040,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/profiles/profilename?api-version=2020-09-01 response: body: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/db3870c9-d3f0-446e-b147-5844c0cffdce?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/3fe4f8f1-364e-4dcb-b956-c0921cf3aba0?api-version=2020-09-01 cache-control: - no-cache content-length: - '0' date: - - Mon, 02 Nov 2020 08:11:57 GMT + - Tue, 19 Jan 2021 09:32:41 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/db3870c9-d3f0-446e-b147-5844c0cffdce/profileresults/profilename?api-version=2020-04-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/3fe4f8f1-364e-4dcb-b956-c0921cf3aba0/profileresults/profilename?api-version=2020-09-01 pragma: - no-cache server: @@ -2938,7 +3068,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14995' status: code: 202 message: Accepted @@ -2952,42 +3082,77 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-mgmt-cdn/10.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/db3870c9-d3f0-446e-b147-5844c0cffdce?api-version=2020-04-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/3fe4f8f1-364e-4dcb-b956-c0921cf3aba0?api-version=2020-09-01 response: body: - string: "{\r\n \"status\":\"Succeeded\",\"error\":{\r\n \"code\":\"None\"\ - ,\"message\":null\r\n }\r\n}" + string: '{"status":"InProgress","error":{"code":"None","message":null}}' headers: cache-control: - no-cache content-length: - - '77' + - '62' content-type: - - application/json; odata.metadata=minimal + - application/json; charset=utf-8 date: - - Mon, 02 Nov 2020 08:12:07 GMT + - Tue, 19 Jan 2021 09:32:51 GMT expires: - '-1' - odata-version: - - '4.0' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-cdn/10.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_cli_mgmt_cdn_test_cdn8f6e0a82/providers/Microsoft.Cdn/operationresults/3fe4f8f1-364e-4dcb-b956-c0921cf3aba0?api-version=2020-09-01 + response: + body: + string: '{"status":"Succeeded","error":{"code":"None","message":null}}' + headers: + cache-control: + - no-cache + content-length: + - '61' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 19 Jan 2021 09:33:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked vary: - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-powered-by: - - ASP.NET status: code: 200 message: OK diff --git a/sdk/cdn/azure-mgmt-cdn/tests/test_cli_mgmt_cdn.py b/sdk/cdn/azure-mgmt-cdn/tests/test_cli_mgmt_cdn.py index 07304419934b..f71ba695de94 100644 --- a/sdk/cdn/azure-mgmt-cdn/tests/test_cli_mgmt_cdn.py +++ b/sdk/cdn/azure-mgmt-cdn/tests/test_cli_mgmt_cdn.py @@ -454,23 +454,23 @@ def test_cdn(self, resource_group): """ # Endpoints_ValidateCustomDomain[post] - # BODY = { - # "host_name": "www.someDomain.com" - # } - HOST_NAME = "www.someDomain.com" - result = self.mgmt_client.endpoints.validate_custom_domain(resource_group.name, PROFILE_NAME, ENDPOINT_NAME, HOST_NAME) + BODY = { + "host_name": "www.someDomain.com" + } + # HOST_NAME = "www.someDomain.com" + result = self.mgmt_client.endpoints.validate_custom_domain(resource_group.name, PROFILE_NAME, ENDPOINT_NAME, BODY) # Endpoints_ListResourceUsage[post] result = self.mgmt_client.endpoints.list_resource_usage(resource_group.name, PROFILE_NAME, ENDPOINT_NAME) # Endpoints_PurgeContent[post] - # BODY = { - # "content_paths": [ - # "/folder1" - # ] - # } - CONTENT_PATHS = ["/folder1"] - result = self.mgmt_client.endpoints.begin_purge_content(resource_group.name, PROFILE_NAME, ENDPOINT_NAME, CONTENT_PATHS) + BODY = { + "content_paths": [ + "/folder1" + ] + } + # CONTENT_PATHS = ["/folder1"] + result = self.mgmt_client.endpoints.begin_purge_content(resource_group.name, PROFILE_NAME, ENDPOINT_NAME, BODY) result = result.result() # Endpoints_Stop[post] @@ -482,13 +482,13 @@ def test_cdn(self, resource_group): result = result.result() # Endpoints_LoadContent[post] - # BODY = { - # "content_paths": [ - # "/folder1" - # ] - # } - CONTENT_PATHS = ["/folder1"] - result = self.mgmt_client.endpoints.begin_load_content(resource_group.name, PROFILE_NAME, ENDPOINT_NAME, CONTENT_PATHS) + BODY = { + "content_paths": [ + "/folder1" + ] + } + # CONTENT_PATHS = ["/folder1"] + result = self.mgmt_client.endpoints.begin_load_content(resource_group.name, PROFILE_NAME, ENDPOINT_NAME, BODY) result = result.result() # Profiles_ListSupportedOptimizationTypes[post] @@ -522,30 +522,30 @@ def test_cdn(self, resource_group): result = result.result() # CheckNameAvailabilityWithSubscription[post] - # BODY = { - # "name": "sampleName", - # "type": "Microsoft.Cdn/Profiles/Endpoints" - # } - CHECK_NAME = "sampleName" - result = self.mgmt_client.check_name_availability_with_subscription(CHECK_NAME) + BODY = { + "name": "sampleName", + "type": "Microsoft.Cdn/Profiles/Endpoints" + } + # CHECK_NAME = "sampleName" + result = self.mgmt_client.check_name_availability_with_subscription(BODY) # ResourceUsage_List[post] result = self.mgmt_client.resource_usage.list() # ValidateProbe[post] - # BODY = { - # "probe_url": "https://www.bing.com/image" - # } - PROBEURL = "https://www.bing.com/image" - result = self.mgmt_client.validate_probe(PROBEURL) + BODY = { + "probe_url": "https://www.bing.com/image" + } + # PROBEURL = "https://www.bing.com/image" + result = self.mgmt_client.validate_probe(BODY) # CheckNameAvailability[post] - # BODY = { - # "name": "sampleName", - # "type": "Microsoft.Cdn/Profiles/Endpoints" - # } - CHECKNAME = "sampleName" - result = self.mgmt_client.check_name_availability(CHECKNAME) + BODY = { + "name": "sampleName", + "type": "Microsoft.Cdn/Profiles/Endpoints" + } + # CHECKNAME = "sampleName" + result = self.mgmt_client.check_name_availability(BODY) # CustomDomains_Delete[delete] result = self.mgmt_client.custom_domains.begin_delete(resource_group.name, PROFILE_NAME, ENDPOINT_NAME, CUSTOM_DOMAIN_NAME)