diff --git a/sdk/cdn/azure-mgmt-cdn/README.md b/sdk/cdn/azure-mgmt-cdn/README.md index e1c5ed53c3fc..539e49dc391b 100644 --- a/sdk/cdn/azure-mgmt-cdn/README.md +++ b/sdk/cdn/azure-mgmt-cdn/README.md @@ -1,29 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure CDN Management Client Library. - -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). - This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. +# Usage -## Usage +For code examples, see [CDN Management](https://docs.microsoft.com/python/api/overview/azure/cdn) +on docs.microsoft.com. -For code examples, see [CDN -Management](https://docs.microsoft.com/python/api/overview/azure/cdn) on -docs.microsoft.com. -## Provide Feedback +# Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-cdn%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-cdn%2FREADME.png) 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 aadd85e922cd..582c8a145740 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 @@ -17,6 +17,7 @@ from .operations import ProfilesOperations from .operations import EndpointsOperations from .operations import OriginsOperations +from .operations import OriginGroupsOperations from .operations import CustomDomainsOperations from .operations import ResourceUsageOperations from .operations import Operations @@ -38,6 +39,8 @@ class CdnManagementClient(CdnManagementClientOperationsMixin, SDKClient): :vartype endpoints: azure.mgmt.cdn.operations.EndpointsOperations :ivar origins: Origins operations :vartype origins: azure.mgmt.cdn.operations.OriginsOperations + :ivar origin_groups: OriginGroups operations + :vartype origin_groups: azure.mgmt.cdn.operations.OriginGroupsOperations :ivar custom_domains: CustomDomains operations :vartype custom_domains: azure.mgmt.cdn.operations.CustomDomainsOperations :ivar resource_usage: ResourceUsage operations @@ -56,17 +59,22 @@ class CdnManagementClient(CdnManagementClientOperationsMixin, SDKClient): object` :param subscription_id: Azure Subscription ID. :type subscription_id: str + :param subscription_id1: Azure Subscription ID. + :type subscription_id1: str + :param api_version1: Version of the API to be used with the client + request. Current version is 2017-04-02. + :type api_version1: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, subscription_id1, api_version1, base_url=None): - self.config = CdnManagementClientConfiguration(credentials, subscription_id, base_url) + self.config = CdnManagementClientConfiguration(credentials, subscription_id, subscription_id1, api_version1, base_url) super(CdnManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-06-15-preview' + self.api_version = '2020-04-15' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -76,6 +84,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.origins = OriginsOperations( self._client, self.config, self._serialize, self._deserialize) + self.origin_groups = OriginGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) self.custom_domains = CustomDomainsOperations( self._client, self.config, self._serialize, self._deserialize) self.resource_usage = ResourceUsageOperations( 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 425d52e81a87..2562e3f64a69 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_configuration.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_configuration.py @@ -23,16 +23,25 @@ class CdnManagementClientConfiguration(AzureConfiguration): object` :param subscription_id: Azure Subscription ID. :type subscription_id: str + :param subscription_id1: Azure Subscription ID. + :type subscription_id1: str + :param api_version1: Version of the API to be used with the client + request. Current version is 2017-04-02. + :type api_version1: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, subscription_id1, api_version1, base_url=None): if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") + if subscription_id1 is None: + raise ValueError("Parameter 'subscription_id1' must not be None.") + if api_version1 is None: + raise ValueError("Parameter 'api_version1' must not be None.") if not base_url: base_url = 'https://management.azure.com' @@ -46,3 +55,5 @@ def __init__( self.credentials = credentials self.subscription_id = subscription_id + self.subscription_id1 = subscription_id1 + self.api_version1 = api_version1 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 e841190e5841..019298060111 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 @@ -27,6 +27,7 @@ from ._models_py3 import CustomRule from ._models_py3 import CustomRuleList from ._models_py3 import DeepCreatedOrigin + from ._models_py3 import DeepCreatedOriginGroup from ._models_py3 import DeliveryRule from ._models_py3 import DeliveryRuleAction from ._models_py3 import DeliveryRuleCacheExpirationAction @@ -56,10 +57,13 @@ from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import GeoFilter from ._models_py3 import HeaderActionParameters + from ._models_py3 import HealthProbeParameters + from ._models_py3 import HttpErrorRangeParameters from ._models_py3 import HttpVersionMatchConditionParameters from ._models_py3 import IpAddressGroup from ._models_py3 import IsDeviceMatchConditionParameters from ._models_py3 import KeyVaultCertificateSourceParameters + from ._models_py3 import KeyVaultSigningKeyParameters from ._models_py3 import LoadParameters from ._models_py3 import ManagedRuleDefinition from ._models_py3 import ManagedRuleGroupDefinition @@ -72,6 +76,8 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import Origin + from ._models_py3 import OriginGroup + from ._models_py3 import OriginGroupUpdateParameters from ._models_py3 import OriginUpdateParameters from ._models_py3 import PolicySettings from ._models_py3 import PostArgsMatchConditionParameters @@ -89,7 +95,9 @@ from ._models_py3 import RequestSchemeMatchConditionParameters from ._models_py3 import RequestUriMatchConditionParameters from ._models_py3 import Resource + from ._models_py3 import ResourceReference from ._models_py3 import ResourceUsage + from ._models_py3 import ResponseBasedOriginErrorDetectionParameters from ._models_py3 import Sku from ._models_py3 import SsoUri from ._models_py3 import SupportedOptimizationTypesListResult @@ -101,6 +109,9 @@ from ._models_py3 import UrlRedirectActionParameters from ._models_py3 import UrlRewriteAction from ._models_py3 import UrlRewriteActionParameters + from ._models_py3 import UrlSigningActionParameters + from ._models_py3 import UrlSigningKey + from ._models_py3 import UrlSigningParamIdentifier from ._models_py3 import UserManagedHttpsParameters from ._models_py3 import ValidateCustomDomainInput from ._models_py3 import ValidateCustomDomainOutput @@ -124,6 +135,7 @@ from ._models import CustomRule from ._models import CustomRuleList from ._models import DeepCreatedOrigin + from ._models import DeepCreatedOriginGroup from ._models import DeliveryRule from ._models import DeliveryRuleAction from ._models import DeliveryRuleCacheExpirationAction @@ -153,10 +165,13 @@ from ._models import ErrorResponse, ErrorResponseException from ._models import GeoFilter from ._models import HeaderActionParameters + from ._models import HealthProbeParameters + from ._models import HttpErrorRangeParameters from ._models import HttpVersionMatchConditionParameters from ._models import IpAddressGroup from ._models import IsDeviceMatchConditionParameters from ._models import KeyVaultCertificateSourceParameters + from ._models import KeyVaultSigningKeyParameters from ._models import LoadParameters from ._models import ManagedRuleDefinition from ._models import ManagedRuleGroupDefinition @@ -169,6 +184,8 @@ from ._models import Operation from ._models import OperationDisplay from ._models import Origin + from ._models import OriginGroup + from ._models import OriginGroupUpdateParameters from ._models import OriginUpdateParameters from ._models import PolicySettings from ._models import PostArgsMatchConditionParameters @@ -186,7 +203,9 @@ from ._models import RequestSchemeMatchConditionParameters from ._models import RequestUriMatchConditionParameters from ._models import Resource + from ._models import ResourceReference from ._models import ResourceUsage + from ._models import ResponseBasedOriginErrorDetectionParameters from ._models import Sku from ._models import SsoUri from ._models import SupportedOptimizationTypesListResult @@ -198,6 +217,9 @@ from ._models import UrlRedirectActionParameters from ._models import UrlRewriteAction from ._models import UrlRewriteActionParameters + from ._models import UrlSigningActionParameters + from ._models import UrlSigningKey + from ._models import UrlSigningParamIdentifier from ._models import UserManagedHttpsParameters from ._models import ValidateCustomDomainInput from ._models import ValidateCustomDomainOutput @@ -209,6 +231,7 @@ from ._paged_models import EndpointPaged from ._paged_models import ManagedRuleSetDefinitionPaged from ._paged_models import OperationPaged +from ._paged_models import OriginGroupPaged from ._paged_models import OriginPaged from ._paged_models import ProfilePaged from ._paged_models import ResourceUsagePaged @@ -216,6 +239,9 @@ SkuName, ProfileResourceState, OptimizationType, + HealthProbeRequestType, + ProbeProtocol, + ResponseBasedDetectedErrorTypes, EndpointResourceState, QueryStringCachingBehavior, GeoFilterActions, @@ -232,10 +258,14 @@ CookiesOperator, RedirectType, DestinationProtocol, + Algorithm, + ParamIndicator, HeaderAction, CacheBehavior, QueryStringBehavior, OriginResourceState, + PrivateEndpointStatus, + OriginGroupResourceState, CustomDomainResourceState, CustomHttpsProvisioningState, CustomHttpsProvisioningSubstate, @@ -273,6 +303,7 @@ 'CustomRule', 'CustomRuleList', 'DeepCreatedOrigin', + 'DeepCreatedOriginGroup', 'DeliveryRule', 'DeliveryRuleAction', 'DeliveryRuleCacheExpirationAction', @@ -302,10 +333,13 @@ 'ErrorResponse', 'ErrorResponseException', 'GeoFilter', 'HeaderActionParameters', + 'HealthProbeParameters', + 'HttpErrorRangeParameters', 'HttpVersionMatchConditionParameters', 'IpAddressGroup', 'IsDeviceMatchConditionParameters', 'KeyVaultCertificateSourceParameters', + 'KeyVaultSigningKeyParameters', 'LoadParameters', 'ManagedRuleDefinition', 'ManagedRuleGroupDefinition', @@ -318,6 +352,8 @@ 'Operation', 'OperationDisplay', 'Origin', + 'OriginGroup', + 'OriginGroupUpdateParameters', 'OriginUpdateParameters', 'PolicySettings', 'PostArgsMatchConditionParameters', @@ -335,7 +371,9 @@ 'RequestSchemeMatchConditionParameters', 'RequestUriMatchConditionParameters', 'Resource', + 'ResourceReference', 'ResourceUsage', + 'ResponseBasedOriginErrorDetectionParameters', 'Sku', 'SsoUri', 'SupportedOptimizationTypesListResult', @@ -347,6 +385,9 @@ 'UrlRedirectActionParameters', 'UrlRewriteAction', 'UrlRewriteActionParameters', + 'UrlSigningActionParameters', + 'UrlSigningKey', + 'UrlSigningParamIdentifier', 'UserManagedHttpsParameters', 'ValidateCustomDomainInput', 'ValidateCustomDomainOutput', @@ -356,6 +397,7 @@ 'ResourceUsagePaged', 'EndpointPaged', 'OriginPaged', + 'OriginGroupPaged', 'CustomDomainPaged', 'OperationPaged', 'EdgeNodePaged', @@ -364,6 +406,9 @@ 'SkuName', 'ProfileResourceState', 'OptimizationType', + 'HealthProbeRequestType', + 'ProbeProtocol', + 'ResponseBasedDetectedErrorTypes', 'EndpointResourceState', 'QueryStringCachingBehavior', 'GeoFilterActions', @@ -380,10 +425,14 @@ 'CookiesOperator', 'RedirectType', 'DestinationProtocol', + 'Algorithm', + 'ParamIndicator', 'HeaderAction', 'CacheBehavior', 'QueryStringBehavior', 'OriginResourceState', + 'PrivateEndpointStatus', + 'OriginGroupResourceState', 'CustomDomainResourceState', 'CustomHttpsProvisioningState', 'CustomHttpsProvisioningSubstate', 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 b69fc68b6e47..3817f006c3d3 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 @@ -40,6 +40,27 @@ class OptimizationType(str, Enum): dynamic_site_acceleration = "DynamicSiteAcceleration" +class HealthProbeRequestType(str, Enum): + + not_set = "NotSet" + get = "GET" + head = "HEAD" + + +class ProbeProtocol(str, Enum): + + not_set = "NotSet" + http = "Http" + https = "Https" + + +class ResponseBasedDetectedErrorTypes(str, Enum): + + none = "None" + tcp_errors_only = "TcpErrorsOnly" + tcp_and_http_errors = "TcpAndHttpErrors" + + class EndpointResourceState(str, Enum): creating = "Creating" @@ -210,6 +231,18 @@ class DestinationProtocol(str, Enum): https = "Https" +class Algorithm(str, Enum): + + sha256 = "SHA256" + + +class ParamIndicator(str, Enum): + + expires = "expires" + key_id = "keyId" + signature = "signature" + + class HeaderAction(str, Enum): append = "Append" @@ -239,6 +272,22 @@ class OriginResourceState(str, Enum): deleting = "Deleting" +class PrivateEndpointStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + timeout = "Timeout" + + +class OriginGroupResourceState(str, Enum): + + creating = "Creating" + active = "Active" + deleting = "Deleting" + + class CustomDomainResourceState(str, Enum): creating = "Creating" @@ -314,7 +363,7 @@ class CustomRuleEnabledState(str, Enum): class MatchVariable(str, Enum): remote_addr = "RemoteAddr" - country = "Country" + socket_addr = "SocketAddr" request_method = "RequestMethod" request_header = "RequestHeader" request_uri = "RequestUri" 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 940b401edd27..d73d1806066f 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 @@ -623,10 +623,6 @@ class CustomDomain(ProxyResource): 'CertificateDeleted' :vartype custom_https_provisioning_substate: str or ~azure.mgmt.cdn.models.CustomHttpsProvisioningSubstate - :param custom_https_parameters: Certificate parameters for securing custom - HTTPS - :type custom_https_parameters: - ~azure.mgmt.cdn.models.CustomDomainHttpsParameters :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. @@ -654,7 +650,6 @@ class CustomDomain(ProxyResource): 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'custom_https_provisioning_state': {'key': 'properties.customHttpsProvisioningState', 'type': 'str'}, 'custom_https_provisioning_substate': {'key': 'properties.customHttpsProvisioningSubstate', 'type': 'str'}, - 'custom_https_parameters': {'key': 'properties.customHttpsParameters', 'type': 'CustomDomainHttpsParameters'}, 'validation_data': {'key': 'properties.validationData', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -665,7 +660,6 @@ def __init__(self, **kwargs): self.resource_state = None self.custom_https_provisioning_state = None self.custom_https_provisioning_substate = None - self.custom_https_parameters = kwargs.get('custom_https_parameters', None) self.validation_data = kwargs.get('validation_data', None) self.provisioning_state = None @@ -760,16 +754,47 @@ class DeepCreatedOrigin(Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Origin name + :param name: Required. Origin name which must be unique within the + endpoint. :type name: str :param host_name: Required. The address of the origin. It can be a domain - name, IPv4 address, or IPv6 address. + 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 + :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 + 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 = { @@ -777,6 +802,8 @@ class DeepCreatedOrigin(Model): 'host_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 = { @@ -784,6 +811,14 @@ class DeepCreatedOrigin(Model): '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): @@ -792,6 +827,65 @@ def __init__(self, **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 DeepCreatedOriginGroup(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 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: Required. 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 = { + 'name': {'required': True}, + 'origins': {'required': True}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + } + + _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'}, + } + + def __init__(self, **kwargs): + super(DeepCreatedOriginGroup, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + 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 DeliveryRule(Model): @@ -1458,18 +1552,20 @@ class Endpoint(TrackedResource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :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 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. @@ -1500,12 +1596,18 @@ class Endpoint(TrackedResource): :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. + 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: @@ -1520,6 +1622,9 @@ class Endpoint(TrackedResource): :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' @@ -1546,9 +1651,9 @@ class Endpoint(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'origin_host_header': {'key': 'properties.originHostHeader', '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'}, @@ -1556,19 +1661,22 @@ class Endpoint(TrackedResource): '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_host_header = kwargs.get('origin_host_header', 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) @@ -1576,10 +1684,13 @@ def __init__(self, **kwargs): 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 @@ -1632,18 +1743,20 @@ class EndpointUpdateParameters(Model): :param tags: Endpoint tags. :type tags: dict[str, str] - :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 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. @@ -1674,12 +1787,18 @@ class EndpointUpdateParameters(Model): :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. + 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: @@ -1692,9 +1811,9 @@ class EndpointUpdateParameters(Model): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'origin_host_header': {'key': 'properties.originHostHeader', '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'}, @@ -1702,6 +1821,8 @@ class EndpointUpdateParameters(Model): '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'}, } @@ -1709,9 +1830,9 @@ class EndpointUpdateParameters(Model): def __init__(self, **kwargs): super(EndpointUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) - self.origin_host_header = kwargs.get('origin_host_header', 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) @@ -1719,6 +1840,8 @@ def __init__(self, **kwargs): 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) @@ -1841,6 +1964,69 @@ def __init__(self, **kwargs): self.value = kwargs.get('value', None) +class HealthProbeParameters(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': 'HealthProbeRequestType'}, + 'probe_protocol': {'key': 'probeProtocol', 'type': 'ProbeProtocol'}, + '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(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(Model): """Defines the parameters for HttpVersion match conditions. @@ -2029,6 +2215,61 @@ def __init__(self, **kwargs): self.secret_version = kwargs.get('secret_version', None) +class KeyVaultSigningKeyParameters(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 odatatype: Required. Default value: + "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters" . + :vartype odatatype: 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 = { + 'odatatype': {'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 = { + 'odatatype': {'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'}, + } + + odatatype = "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters" + + def __init__(self, **kwargs): + super(KeyVaultSigningKeyParameters, self).__init__(**kwargs) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.vault_name = kwargs.get('vault_name', None) + self.secret_name = kwargs.get('secret_name', None) + self.secret_version = kwargs.get('secret_version', None) + + class LoadParameters(Model): """Parameters required for content load. @@ -2292,12 +2533,12 @@ class MatchCondition(Model): All required parameters must be populated in order to send to Azure. :param match_variable: Required. Match variable to compare against. - Possible values include: 'RemoteAddr', 'Country', 'RequestMethod', + Possible values include: 'RemoteAddr', 'SocketAddr', 'RequestMethod', 'RequestHeader', 'RequestUri', 'QueryString', 'RequestBody', 'Cookies', 'PostArgs' :type match_variable: str or ~azure.mgmt.cdn.models.MatchVariable :param selector: Selector can used to match a specific key for - QueryString, RequestUri, RequestHeaders or RequestBody. + QueryString, Cookies, RequestHeader or PostArgs. :type selector: str :param operator: Required. Describes operator to be matched. Possible values include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains', @@ -2420,19 +2661,53 @@ class Origin(TrackedResource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param host_name: Required. The address of the origin. Domain names, IPv4 - addresses, and IPv6 addresses are supported. + :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 + :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 = { @@ -2440,11 +2715,13 @@ class Origin(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'host_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}, 'resource_state': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'private_endpoint_status': {'readonly': True}, } _attribute_map = { @@ -2456,8 +2733,17 @@ class Origin(TrackedResource): '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): @@ -2465,39 +2751,207 @@ def __init__(self, **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 + :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}, + '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 +class OriginGroupUpdateParameters(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 OriginUpdateParameters(Model): - """Origin properties needed for origin creation or update. + """Origin properties needed for origin update. + :param tags: Origin tags. + :type tags: dict[str, str] :param host_name: The address of the origin. Domain names, IPv4 addresses, - and IPv6 addresses are supported. + 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 = { + 'tags': {'key': 'tags', '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(OriginUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', 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) class PolicySettings(Model): @@ -2523,7 +2977,6 @@ class PolicySettings(Model): """ _validation = { - 'default_custom_block_response_status_code': {'maximum': 599, 'minimum': 200}, '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})$'}, } @@ -3099,6 +3552,22 @@ def __init__(self, **kwargs): self.transforms = kwargs.get('transforms', None) +class ResourceReference(Model): + """Reference to another resource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + class ResourceUsage(Model): """Output of check resource usage API. @@ -3137,6 +3606,41 @@ def __init__(self, **kwargs): self.limit = None +class ResponseBasedOriginErrorDetectionParameters(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] + """ + + _validation = { + 'response_based_failover_threshold_percentage': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'response_based_detected_error_types': {'key': 'responseBasedDetectedErrorTypes', 'type': 'ResponseBasedDetectedErrorTypes'}, + '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 Sku(Model): """The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. @@ -3483,16 +3987,14 @@ class UrlRewriteActionParameters(Model): "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRewriteActionParameters" . :vartype odatatype: str :param source_pattern: Required. define a request URI pattern that - identifies the type of requests that may be rewritten. Currently, source - pattern uses a prefix-based match. To match all URL paths, use "/" as the - source pattern value. To match only the root directory and re-write this - path, use the origin path field + identifies the type of requests that may be rewritten. If value is blank, + all strings are matched. :type source_pattern: str - :param destination: Required. Define the destination path for be used in - the rewrite. This will overwrite the source pattern + :param destination: Required. Define the relative URL to which the above + requests will be rewritten by. :type destination: str - :param preserve_unmatched_path: If True, the remaining path after the - source pattern will be appended to the new destination path. + :param preserve_unmatched_path: Whether to preserve unmatched path. + Default value is true. :type preserve_unmatched_path: bool """ @@ -3518,6 +4020,108 @@ def __init__(self, **kwargs): self.preserve_unmatched_path = kwargs.get('preserve_unmatched_path', None) +class UrlSigningActionParameters(Model): + """Defines the parameters for the Url Signing action. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Possible values include: + '#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlSigningActionParameters' + :type odatatype: str or ~azure.mgmt.cdn.models.enum + :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 = { + 'key_id': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'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]'}, + } + + def __init__(self, **kwargs): + super(UrlSigningActionParameters, self).__init__(**kwargs) + self.odatatype = kwargs.get('odatatype', None) + self.key_id = kwargs.get('key_id', None) + 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(Model): + """Url signing key. + + All required parameters must be populated in order to send to Azure. + + :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 key_source_parameters: Required. Defines the parameters for using + customer key vault for Url Signing Key. + :type key_source_parameters: + ~azure.mgmt.cdn.models.KeyVaultSigningKeyParameters + """ + + _validation = { + 'key_id': {'required': True}, + 'key_source_parameters': {'required': True}, + } + + _attribute_map = { + 'key_id': {'key': 'keyId', 'type': 'str'}, + 'key_source_parameters': {'key': 'keySourceParameters', 'type': 'KeyVaultSigningKeyParameters'}, + } + + def __init__(self, **kwargs): + super(UrlSigningKey, self).__init__(**kwargs) + self.key_id = kwargs.get('key_id', None) + self.key_source_parameters = kwargs.get('key_source_parameters', None) + + +class UrlSigningParamIdentifier(Model): + """Defines how to identify a parameter for a specific purpose e.g. expires. + + All required parameters must be populated in order to send to Azure. + + :param param_indicator: Required. Indicates the purpose of the parameter. + Possible values include: 'expires', 'keyId', 'signature' + :type param_indicator: str or ~azure.mgmt.cdn.models.ParamIndicator + :param param_name: Required. Parameter name + :type param_name: str + """ + + _validation = { + 'param_indicator': {'required': True}, + 'param_name': {'required': True}, + } + + _attribute_map = { + 'param_indicator': {'key': 'paramIndicator', 'type': 'str'}, + 'param_name': {'key': 'paramName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UrlSigningParamIdentifier, self).__init__(**kwargs) + self.param_indicator = kwargs.get('param_indicator', None) + self.param_name = kwargs.get('param_name', None) + + class UserManagedHttpsParameters(CustomDomainHttpsParameters): """Defines the certificate source parameters using user's keyvault certificate for enabling SSL. 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 f544cd6f0a88..21e49dce0a9f 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 @@ -623,10 +623,6 @@ class CustomDomain(ProxyResource): 'CertificateDeleted' :vartype custom_https_provisioning_substate: str or ~azure.mgmt.cdn.models.CustomHttpsProvisioningSubstate - :param custom_https_parameters: Certificate parameters for securing custom - HTTPS - :type custom_https_parameters: - ~azure.mgmt.cdn.models.CustomDomainHttpsParameters :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. @@ -654,18 +650,16 @@ class CustomDomain(ProxyResource): 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'custom_https_provisioning_state': {'key': 'properties.customHttpsProvisioningState', 'type': 'str'}, 'custom_https_provisioning_substate': {'key': 'properties.customHttpsProvisioningSubstate', 'type': 'str'}, - 'custom_https_parameters': {'key': 'properties.customHttpsParameters', 'type': 'CustomDomainHttpsParameters'}, 'validation_data': {'key': 'properties.validationData', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, host_name: str, custom_https_parameters=None, validation_data: str=None, **kwargs) -> None: + def __init__(self, *, host_name: str, validation_data: str=None, **kwargs) -> None: 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.custom_https_parameters = custom_https_parameters self.validation_data = validation_data self.provisioning_state = None @@ -760,16 +754,47 @@ class DeepCreatedOrigin(Model): All required parameters must be populated in order to send to Azure. - :param name: Required. Origin name + :param name: Required. Origin name which must be unique within the + endpoint. :type name: str :param host_name: Required. The address of the origin. It can be a domain - name, IPv4 address, or IPv6 address. + 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 + :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 + 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 = { @@ -777,6 +802,8 @@ class DeepCreatedOrigin(Model): 'host_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 = { @@ -784,14 +811,81 @@ class DeepCreatedOrigin(Model): '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, *, name: str, host_name: str, http_port: int=None, https_port: int=None, **kwargs) -> None: + def __init__(self, *, name: str, host_name: str, http_port: int=None, https_port: int=None, origin_host_header: str=None, priority: int=None, weight: int=None, enabled: bool=None, private_link_alias: str=None, private_link_resource_id: str=None, private_link_location: str=None, private_link_approval_message: str=None, **kwargs) -> None: 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 DeepCreatedOriginGroup(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 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: Required. 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 = { + 'name': {'required': True}, + 'origins': {'required': True}, + 'traffic_restoration_time_to_healed_or_new_endpoints_in_minutes': {'maximum': 50, 'minimum': 0}, + } + + _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'}, + } + + def __init__(self, *, name: str, origins, health_probe_settings=None, traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int=None, response_based_origin_error_detection_settings=None, **kwargs) -> None: + 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 DeliveryRule(Model): @@ -1458,18 +1552,20 @@ class Endpoint(TrackedResource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :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 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. @@ -1500,12 +1596,18 @@ class Endpoint(TrackedResource): :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. + 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: @@ -1520,6 +1622,9 @@ class Endpoint(TrackedResource): :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' @@ -1546,9 +1651,9 @@ class Endpoint(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'origin_host_header': {'key': 'properties.originHostHeader', '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'}, @@ -1556,19 +1661,22 @@ class Endpoint(TrackedResource): '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, origins, tags=None, origin_host_header: str=None, origin_path: str=None, content_types_to_compress=None, is_compression_enabled: bool=None, is_http_allowed: bool=None, is_https_allowed: bool=None, query_string_caching_behavior=None, optimization_type=None, probe_path: str=None, geo_filters=None, delivery_policy=None, web_application_firewall_policy_link=None, **kwargs) -> None: + def __init__(self, *, location: str, origins, tags=None, origin_path: str=None, content_types_to_compress=None, origin_host_header: str=None, is_compression_enabled: bool=None, is_http_allowed: bool=None, is_https_allowed: bool=None, query_string_caching_behavior=None, optimization_type=None, probe_path: str=None, geo_filters=None, default_origin_group=None, url_signing_keys=None, delivery_policy=None, web_application_firewall_policy_link=None, origin_groups=None, **kwargs) -> None: super(Endpoint, self).__init__(location=location, tags=tags, **kwargs) - self.origin_host_header = origin_host_header 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 @@ -1576,10 +1684,13 @@ def __init__(self, *, location: str, origins, tags=None, origin_host_header: str 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 @@ -1632,18 +1743,20 @@ class EndpointUpdateParameters(Model): :param tags: Endpoint tags. :type tags: dict[str, str] - :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 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. @@ -1674,12 +1787,18 @@ class EndpointUpdateParameters(Model): :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. + 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: @@ -1692,9 +1811,9 @@ class EndpointUpdateParameters(Model): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'origin_host_header': {'key': 'properties.originHostHeader', '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'}, @@ -1702,16 +1821,18 @@ class EndpointUpdateParameters(Model): '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=None, origin_host_header: str=None, origin_path: str=None, content_types_to_compress=None, is_compression_enabled: bool=None, is_http_allowed: bool=None, is_https_allowed: bool=None, query_string_caching_behavior=None, optimization_type=None, probe_path: str=None, geo_filters=None, delivery_policy=None, web_application_firewall_policy_link=None, **kwargs) -> None: + def __init__(self, *, tags=None, origin_path: str=None, content_types_to_compress=None, origin_host_header: str=None, is_compression_enabled: bool=None, is_http_allowed: bool=None, is_https_allowed: bool=None, query_string_caching_behavior=None, optimization_type=None, probe_path: str=None, geo_filters=None, default_origin_group=None, url_signing_keys=None, delivery_policy=None, web_application_firewall_policy_link=None, **kwargs) -> None: super(EndpointUpdateParameters, self).__init__(**kwargs) self.tags = tags - self.origin_host_header = origin_host_header 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 @@ -1719,6 +1840,8 @@ def __init__(self, *, tags=None, origin_host_header: str=None, origin_path: str= 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 @@ -1841,6 +1964,69 @@ def __init__(self, *, header_action, header_name: str, value: str=None, **kwargs self.value = value +class HealthProbeParameters(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': 'HealthProbeRequestType'}, + 'probe_protocol': {'key': 'probeProtocol', 'type': 'ProbeProtocol'}, + 'probe_interval_in_seconds': {'key': 'probeIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, *, probe_path: str=None, probe_request_type=None, probe_protocol=None, probe_interval_in_seconds: int=None, **kwargs) -> None: + 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(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: int=None, end: int=None, **kwargs) -> None: + super(HttpErrorRangeParameters, self).__init__(**kwargs) + self.begin = begin + self.end = end + + class HttpVersionMatchConditionParameters(Model): """Defines the parameters for HttpVersion match conditions. @@ -2029,6 +2215,61 @@ def __init__(self, *, subscription_id: str, resource_group_name: str, vault_name self.secret_version = secret_version +class KeyVaultSigningKeyParameters(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 odatatype: Required. Default value: + "#Microsoft.Azure.Cdn.Models.KeyVaultSigningKeyParameters" . + :vartype odatatype: 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 = { + 'odatatype': {'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 = { + 'odatatype': {'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'}, + } + + odatatype = "#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) -> None: + 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 LoadParameters(Model): """Parameters required for content load. @@ -2292,12 +2533,12 @@ class MatchCondition(Model): All required parameters must be populated in order to send to Azure. :param match_variable: Required. Match variable to compare against. - Possible values include: 'RemoteAddr', 'Country', 'RequestMethod', + Possible values include: 'RemoteAddr', 'SocketAddr', 'RequestMethod', 'RequestHeader', 'RequestUri', 'QueryString', 'RequestBody', 'Cookies', 'PostArgs' :type match_variable: str or ~azure.mgmt.cdn.models.MatchVariable :param selector: Selector can used to match a specific key for - QueryString, RequestUri, RequestHeaders or RequestBody. + QueryString, Cookies, RequestHeader or PostArgs. :type selector: str :param operator: Required. Describes operator to be matched. Possible values include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains', @@ -2420,19 +2661,53 @@ class Origin(TrackedResource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param host_name: Required. The address of the origin. Domain names, IPv4 - addresses, and IPv6 addresses are supported. + :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 + :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 = { @@ -2440,11 +2715,13 @@ class Origin(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'host_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}, 'resource_state': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'private_endpoint_status': {'readonly': True}, } _attribute_map = { @@ -2456,48 +2733,225 @@ class Origin(TrackedResource): '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, *, location: str, host_name: str, tags=None, http_port: int=None, https_port: int=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, host_name: str=None, http_port: int=None, https_port: int=None, origin_host_header: str=None, priority: int=None, weight: int=None, enabled: bool=None, private_link_alias: str=None, private_link_resource_id: str=None, private_link_location: str=None, private_link_approval_message: str=None, **kwargs) -> None: super(Origin, self).__init__(location=location, tags=tags, **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 + :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}, + '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, *, health_probe_settings=None, origins=None, traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int=None, response_based_origin_error_detection_settings=None, **kwargs) -> None: + 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 OriginGroupUpdateParameters(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=None, origins=None, traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int=None, response_based_origin_error_detection_settings=None, **kwargs) -> None: + 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 OriginUpdateParameters(Model): - """Origin properties needed for origin creation or update. + """Origin properties needed for origin update. + :param tags: Origin tags. + :type tags: dict[str, str] :param host_name: The address of the origin. Domain names, IPv4 addresses, - and IPv6 addresses are supported. + 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 = { + 'tags': {'key': 'tags', '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, *, host_name: str=None, http_port: int=None, https_port: int=None, **kwargs) -> None: + def __init__(self, *, tags=None, host_name: str=None, http_port: int=None, https_port: int=None, origin_host_header: str=None, priority: int=None, weight: int=None, enabled: bool=None, private_link_alias: str=None, private_link_resource_id: str=None, private_link_location: str=None, private_link_approval_message: str=None, **kwargs) -> None: super(OriginUpdateParameters, self).__init__(**kwargs) + self.tags = tags 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(Model): @@ -2523,7 +2977,6 @@ class PolicySettings(Model): """ _validation = { - 'default_custom_block_response_status_code': {'maximum': 599, 'minimum': 200}, '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})$'}, } @@ -3099,6 +3552,22 @@ def __init__(self, *, operator, match_values, negate_condition: bool=None, trans self.transforms = transforms +class ResourceReference(Model): + """Reference to another resource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(ResourceReference, self).__init__(**kwargs) + self.id = id + + class ResourceUsage(Model): """Output of check resource usage API. @@ -3137,6 +3606,41 @@ def __init__(self, **kwargs) -> None: self.limit = None +class ResponseBasedOriginErrorDetectionParameters(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] + """ + + _validation = { + 'response_based_failover_threshold_percentage': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'response_based_detected_error_types': {'key': 'responseBasedDetectedErrorTypes', 'type': 'ResponseBasedDetectedErrorTypes'}, + 'response_based_failover_threshold_percentage': {'key': 'responseBasedFailoverThresholdPercentage', 'type': 'int'}, + 'http_error_ranges': {'key': 'httpErrorRanges', 'type': '[HttpErrorRangeParameters]'}, + } + + def __init__(self, *, response_based_detected_error_types=None, response_based_failover_threshold_percentage: int=None, http_error_ranges=None, **kwargs) -> None: + 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 Sku(Model): """The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. @@ -3483,16 +3987,14 @@ class UrlRewriteActionParameters(Model): "#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlRewriteActionParameters" . :vartype odatatype: str :param source_pattern: Required. define a request URI pattern that - identifies the type of requests that may be rewritten. Currently, source - pattern uses a prefix-based match. To match all URL paths, use "/" as the - source pattern value. To match only the root directory and re-write this - path, use the origin path field + identifies the type of requests that may be rewritten. If value is blank, + all strings are matched. :type source_pattern: str - :param destination: Required. Define the destination path for be used in - the rewrite. This will overwrite the source pattern + :param destination: Required. Define the relative URL to which the above + requests will be rewritten by. :type destination: str - :param preserve_unmatched_path: If True, the remaining path after the - source pattern will be appended to the new destination path. + :param preserve_unmatched_path: Whether to preserve unmatched path. + Default value is true. :type preserve_unmatched_path: bool """ @@ -3518,6 +4020,108 @@ def __init__(self, *, source_pattern: str, destination: str, preserve_unmatched_ self.preserve_unmatched_path = preserve_unmatched_path +class UrlSigningActionParameters(Model): + """Defines the parameters for the Url Signing action. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Possible values include: + '#Microsoft.Azure.Cdn.Models.DeliveryRuleUrlSigningActionParameters' + :type odatatype: str or ~azure.mgmt.cdn.models.enum + :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 = { + 'key_id': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'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]'}, + } + + def __init__(self, *, key_id: str, odatatype=None, algorithm=None, parameter_name_override=None, ip_subnets=None, **kwargs) -> None: + super(UrlSigningActionParameters, self).__init__(**kwargs) + self.odatatype = odatatype + self.key_id = key_id + self.algorithm = algorithm + self.parameter_name_override = parameter_name_override + self.ip_subnets = ip_subnets + + +class UrlSigningKey(Model): + """Url signing key. + + All required parameters must be populated in order to send to Azure. + + :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 key_source_parameters: Required. Defines the parameters for using + customer key vault for Url Signing Key. + :type key_source_parameters: + ~azure.mgmt.cdn.models.KeyVaultSigningKeyParameters + """ + + _validation = { + 'key_id': {'required': True}, + 'key_source_parameters': {'required': True}, + } + + _attribute_map = { + 'key_id': {'key': 'keyId', 'type': 'str'}, + 'key_source_parameters': {'key': 'keySourceParameters', 'type': 'KeyVaultSigningKeyParameters'}, + } + + def __init__(self, *, key_id: str, key_source_parameters, **kwargs) -> None: + super(UrlSigningKey, self).__init__(**kwargs) + self.key_id = key_id + self.key_source_parameters = key_source_parameters + + +class UrlSigningParamIdentifier(Model): + """Defines how to identify a parameter for a specific purpose e.g. expires. + + All required parameters must be populated in order to send to Azure. + + :param param_indicator: Required. Indicates the purpose of the parameter. + Possible values include: 'expires', 'keyId', 'signature' + :type param_indicator: str or ~azure.mgmt.cdn.models.ParamIndicator + :param param_name: Required. Parameter name + :type param_name: str + """ + + _validation = { + 'param_indicator': {'required': True}, + 'param_name': {'required': True}, + } + + _attribute_map = { + 'param_indicator': {'key': 'paramIndicator', 'type': 'str'}, + 'param_name': {'key': 'paramName', 'type': 'str'}, + } + + def __init__(self, *, param_indicator, param_name: str, **kwargs) -> None: + super(UrlSigningParamIdentifier, self).__init__(**kwargs) + self.param_indicator = param_indicator + self.param_name = param_name + + class UserManagedHttpsParameters(CustomDomainHttpsParameters): """Defines the certificate source parameters using user's keyvault certificate for enabling SSL. diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_paged_models.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_paged_models.py index fbfa32a6349a..f90edc9ae4c1 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_paged_models.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_paged_models.py @@ -64,6 +64,19 @@ class OriginPaged(Paged): def __init__(self, *args, **kwargs): super(OriginPaged, self).__init__(*args, **kwargs) +class OriginGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`OriginGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OriginGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(OriginGroupPaged, self).__init__(*args, **kwargs) class CustomDomainPaged(Paged): """ A paging container for iterating over a list of :class:`CustomDomain ` object 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 ccdc2d079741..ecb93da46928 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 @@ -12,6 +12,7 @@ from ._profiles_operations import ProfilesOperations from ._endpoints_operations import EndpointsOperations from ._origins_operations import OriginsOperations +from ._origin_groups_operations import OriginGroupsOperations from ._custom_domains_operations import CustomDomainsOperations from ._resource_usage_operations import ResourceUsageOperations from ._operations import Operations @@ -24,6 +25,7 @@ 'ProfilesOperations', 'EndpointsOperations', 'OriginsOperations', + 'OriginGroupsOperations', 'CustomDomainsOperations', 'ResourceUsageOperations', 'Operations', 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 7062f3872b4d..d7bebfb3859e 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 @@ -26,7 +26,7 @@ class CustomDomainsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-06-15-preview". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2020-04-15". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-15-preview" + self.api_version = "2020-04-15" self.config = config 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 55813844da35..c32d0267b32c 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 @@ -24,7 +24,7 @@ class EdgeNodesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-06-15-preview". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2020-04-15". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-15-preview" + self.api_version = "2020-04-15" self.config = config 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 db2f79eeea3b..1fb9401a5db7 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 @@ -26,7 +26,7 @@ class EndpointsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-06-15-preview". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2020-04-15". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-15-preview" + self.api_version = "2020-04-15" self.config = config @@ -345,10 +345,11 @@ def _update_initial( def update( self, resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers=None, raw=False, polling=True, **operation_config): """Updates an existing CDN endpoint with the specified endpoint name under - the specified subscription, resource group and profile. Only tags and - Origin HostHeader can be updated after creating an endpoint. To update - origins, use the Update Origin operation. To update custom domains, use - the Update Custom Domain operation. + 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 custom domains, use the Update Custom Domain + operation. :param resource_group_name: Name of the Resource group within the Azure subscription. 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 548d3c4e12f3..568a32512497 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 @@ -24,7 +24,7 @@ class ManagedRuleSetsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-06-15-preview". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2020-04-15". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-15-preview" + self.api_version = "2020-04-15" self.config = config 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 11d4db705f67..b6c6a98b42e5 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 @@ -24,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-06-15-preview". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2020-04-15". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-15-preview" + self.api_version = "2020-04-15" self.config = config 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 new file mode 100644 index 000000000000..db45d3f53779 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_origin_groups_operations.py @@ -0,0 +1,507 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class OriginGroupsOperations(object): + """OriginGroupsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2020-04-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-04-15" + + self.config = config + + def list_by_endpoint( + self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the existing origin groups within an 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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of OriginGroup + :rtype: + ~azure.mgmt.cdn.models.OriginGroupPaged[~azure.mgmt.cdn.models.OriginGroup] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_endpoint.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OriginGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_endpoint.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups'} + + def get( + self, resource_group_name, profile_name, endpoint_name, origin_group_name, custom_headers=None, raw=False, **operation_config): + """Gets an existing origin group within an 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 origin_group_name: Name of the origin group which is unique + within the endpoint. + :type origin_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OriginGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cdn.models.OriginGroup or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OriginGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}'} + + + def _create_initial( + self, resource_group_name, profile_name, endpoint_name, origin_group_name, origin_group, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + 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') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(origin_group, 'OriginGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OriginGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('OriginGroup', response) + if response.status_code == 202: + deserialized = self._deserialize('OriginGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, profile_name, endpoint_name, origin_group_name, origin_group, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new origin group within the specified 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 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.OriginGroup + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OriginGroup or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.OriginGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.OriginGroup]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + origin_group_name=origin_group_name, + origin_group=origin_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OriginGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}'} + + + def _update_initial( + self, resource_group_name, profile_name, endpoint_name, origin_group_name, origin_group_update_properties, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + 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') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(origin_group_update_properties, 'OriginGroupUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OriginGroup', response) + if response.status_code == 202: + deserialized = self._deserialize('OriginGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, profile_name, endpoint_name, origin_group_name, origin_group_update_properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an existing origin group within an 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 origin_group_name: Name of the origin group which is unique + within the endpoint. + :type origin_group_name: str + :param origin_group_update_properties: Origin group properties + :type origin_group_update_properties: + ~azure.mgmt.cdn.models.OriginGroupUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OriginGroup or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.OriginGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.OriginGroup]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + origin_group_name=origin_group_name, + origin_group_update_properties=origin_group_update_properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OriginGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}'} + + + def _delete_initial( + self, resource_group_name, profile_name, endpoint_name, origin_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, profile_name, endpoint_name, origin_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing origin group within an 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 origin_group_name: Name of the origin group which is unique + within the endpoint. + :type origin_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + origin_group_name=origin_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}'} 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 9e197af88faf..ae2c716fd0ed 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 @@ -26,7 +26,7 @@ class OriginsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-06-15-preview". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2020-04-15". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-15-preview" + self.api_version = "2020-04-15" self.config = config @@ -188,6 +188,121 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'} + def _create_initial( + self, resource_group_name, profile_name, endpoint_name, origin_name, origin, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + 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') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(origin, 'Origin') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Origin', response) + if response.status_code == 201: + deserialized = self._deserialize('Origin', response) + if response.status_code == 202: + deserialized = self._deserialize('Origin', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, profile_name, endpoint_name, origin_name, origin, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new origin within the specified 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 origin_name: Name of the origin that is unique within the + endpoint. + :type origin_name: str + :param origin: Origin properties + :type origin: ~azure.mgmt.cdn.models.Origin + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Origin or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.Origin] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.Origin]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + origin_name=origin_name, + origin=origin, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Origin', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'} + + def _update_initial( self, resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers=None, raw=False, **operation_config): # Construct URL @@ -300,3 +415,93 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'} + + + def _delete_initial( + self, resource_group_name, profile_name, endpoint_name, origin_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, profile_name, endpoint_name, origin_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing origin within an 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 origin_name: Name of the origin which is unique within the + endpoint. + :type origin_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + profile_name=profile_name, + endpoint_name=endpoint_name, + origin_name=origin_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'} 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 38877e1801b7..999bb4c52b1b 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 @@ -27,7 +27,7 @@ class PoliciesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-06-15-preview". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2020-04-15". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-15-preview" + self.api_version = "2020-04-15" self.config = config 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 72fafc7245fe..9ce21e83369a 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 @@ -26,7 +26,7 @@ class ProfilesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-06-15-preview". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2020-04-15". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-15-preview" + self.api_version = "2020-04-15" self.config = config 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 654a4f3a72b8..a7d9f9e7ca07 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 @@ -24,7 +24,7 @@ class ResourceUsageOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-06-15-preview". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2020-04-15". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-15-preview" + self.api_version = "2020-04-15" self.config = config diff --git a/sdk/cdn/azure-mgmt-cdn/setup.py b/sdk/cdn/azure-mgmt-cdn/setup.py index 763e8773b4d5..5d51c73ccf6d 100644 --- a/sdk/cdn/azure-mgmt-cdn/setup.py +++ b/sdk/cdn/azure-mgmt-cdn/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)