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 39e32aa444b9..333c5d6379a3 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 @@ -20,6 +20,7 @@ from .operations.profiles_operations import ProfilesOperations from .operations.endpoints_operations import EndpointsOperations from .operations.origins_operations import OriginsOperations +from .operations.origin_groups_operations import OriginGroupsOperations from .operations.custom_domains_operations import CustomDomainsOperations from .operations.resource_usage_operations import ResourceUsageOperations from .operations.operations import Operations @@ -71,6 +72,8 @@ class CdnManagementClient(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 @@ -95,7 +98,7 @@ def __init__( 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-04-15' + self.api_version = '2019-12-31' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -105,6 +108,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/models/__init__.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py index a6a3d053e954..f63da3e1176d 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 @@ -16,6 +16,11 @@ from .sso_uri_py3 import SsoUri from .supported_optimization_types_list_result_py3 import SupportedOptimizationTypesListResult from .deep_created_origin_py3 import DeepCreatedOrigin + from .health_probe_parameters_py3 import HealthProbeParameters + from .resource_reference_py3 import ResourceReference + from .http_error_range_parameters_py3 import HttpErrorRangeParameters + from .response_based_origin_error_detection_parameters_py3 import ResponseBasedOriginErrorDetectionParameters + from .deep_created_origin_group_py3 import DeepCreatedOriginGroup from .endpoint_py3 import Endpoint from .geo_filter_py3 import GeoFilter from .delivery_rule_condition_py3 import DeliveryRuleCondition @@ -66,6 +71,8 @@ from .load_parameters_py3 import LoadParameters from .origin_py3 import Origin from .origin_update_parameters_py3 import OriginUpdateParameters + from .origin_group_py3 import OriginGroup + from .origin_group_update_parameters_py3 import OriginGroupUpdateParameters from .custom_domain_py3 import CustomDomain from .custom_domain_parameters_py3 import CustomDomainParameters from .custom_domain_https_parameters_py3 import CustomDomainHttpsParameters @@ -96,6 +103,11 @@ from .sso_uri import SsoUri from .supported_optimization_types_list_result import SupportedOptimizationTypesListResult from .deep_created_origin import DeepCreatedOrigin + from .health_probe_parameters import HealthProbeParameters + from .resource_reference import ResourceReference + from .http_error_range_parameters import HttpErrorRangeParameters + from .response_based_origin_error_detection_parameters import ResponseBasedOriginErrorDetectionParameters + from .deep_created_origin_group import DeepCreatedOriginGroup from .endpoint import Endpoint from .geo_filter import GeoFilter from .delivery_rule_condition import DeliveryRuleCondition @@ -146,6 +158,8 @@ from .load_parameters import LoadParameters from .origin import Origin from .origin_update_parameters import OriginUpdateParameters + from .origin_group import OriginGroup + from .origin_group_update_parameters import OriginGroupUpdateParameters from .custom_domain import CustomDomain from .custom_domain_parameters import CustomDomainParameters from .custom_domain_https_parameters import CustomDomainHttpsParameters @@ -173,6 +187,7 @@ from .resource_usage_paged import ResourceUsagePaged from .endpoint_paged import EndpointPaged from .origin_paged import OriginPaged +from .origin_group_paged import OriginGroupPaged from .custom_domain_paged import CustomDomainPaged from .operation_paged import OperationPaged from .edge_node_paged import EdgeNodePaged @@ -180,6 +195,9 @@ SkuName, ProfileResourceState, OptimizationType, + HealthProbeRequestType, + ProbeProtocol, + ResponseBasedDetectedErrorTypes, EndpointResourceState, QueryStringCachingBehavior, GeoFilterActions, @@ -200,10 +218,12 @@ CacheBehavior, QueryStringBehavior, OriginResourceState, + OriginGroupResourceState, CustomDomainResourceState, CustomHttpsProvisioningState, CustomHttpsProvisioningSubstate, ProtocolType, + MinimumTlsVersion, CertificateType, ResourceType, ) @@ -215,6 +235,11 @@ 'SsoUri', 'SupportedOptimizationTypesListResult', 'DeepCreatedOrigin', + 'HealthProbeParameters', + 'ResourceReference', + 'HttpErrorRangeParameters', + 'ResponseBasedOriginErrorDetectionParameters', + 'DeepCreatedOriginGroup', 'Endpoint', 'GeoFilter', 'DeliveryRuleCondition', @@ -265,6 +290,8 @@ 'LoadParameters', 'Origin', 'OriginUpdateParameters', + 'OriginGroup', + 'OriginGroupUpdateParameters', 'CustomDomain', 'CustomDomainParameters', 'CustomDomainHttpsParameters', @@ -292,12 +319,16 @@ 'ResourceUsagePaged', 'EndpointPaged', 'OriginPaged', + 'OriginGroupPaged', 'CustomDomainPaged', 'OperationPaged', 'EdgeNodePaged', 'SkuName', 'ProfileResourceState', 'OptimizationType', + 'HealthProbeRequestType', + 'ProbeProtocol', + 'ResponseBasedDetectedErrorTypes', 'EndpointResourceState', 'QueryStringCachingBehavior', 'GeoFilterActions', @@ -318,10 +349,12 @@ 'CacheBehavior', 'QueryStringBehavior', 'OriginResourceState', + 'OriginGroupResourceState', 'CustomDomainResourceState', 'CustomHttpsProvisioningState', 'CustomHttpsProvisioningSubstate', 'ProtocolType', + 'MinimumTlsVersion', 'CertificateType', 'ResourceType', ] diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters.py index 3c9a2bcca295..0008581a92bc 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters.py @@ -22,6 +22,9 @@ class CdnManagedHttpsParameters(CustomDomainHttpsParameters): used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType + :param minimum_tls_version: TLS protocol version that will be used for + Https. Possible values include: 'None', 'TLS10', 'TLS12' + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion :param certificate_source: Required. Constant filled by server. :type certificate_source: str :param certificate_source_parameters: Required. Defines the certificate @@ -38,6 +41,7 @@ class CdnManagedHttpsParameters(CustomDomainHttpsParameters): _attribute_map = { 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'MinimumTlsVersion'}, 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, 'certificate_source_parameters': {'key': 'certificateSourceParameters', 'type': 'CdnCertificateSourceParameters'}, } diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters_py3.py index 909a93392f89..e0e711886f6c 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters_py3.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters_py3.py @@ -22,6 +22,9 @@ class CdnManagedHttpsParameters(CustomDomainHttpsParameters): used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType + :param minimum_tls_version: TLS protocol version that will be used for + Https. Possible values include: 'None', 'TLS10', 'TLS12' + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion :param certificate_source: Required. Constant filled by server. :type certificate_source: str :param certificate_source_parameters: Required. Defines the certificate @@ -38,11 +41,12 @@ class CdnManagedHttpsParameters(CustomDomainHttpsParameters): _attribute_map = { 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'MinimumTlsVersion'}, 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, 'certificate_source_parameters': {'key': 'certificateSourceParameters', 'type': 'CdnCertificateSourceParameters'}, } - def __init__(self, *, protocol_type, certificate_source_parameters, **kwargs) -> None: - super(CdnManagedHttpsParameters, self).__init__(protocol_type=protocol_type, **kwargs) + def __init__(self, *, protocol_type, certificate_source_parameters, minimum_tls_version=None, **kwargs) -> None: + super(CdnManagedHttpsParameters, self).__init__(protocol_type=protocol_type, minimum_tls_version=minimum_tls_version, **kwargs) self.certificate_source_parameters = certificate_source_parameters self.certificate_source = 'Cdn' 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 a4ed77e37bc2..bbf2d47aeae0 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" @@ -239,6 +260,13 @@ class OriginResourceState(str, Enum): deleting = "Deleting" +class OriginGroupResourceState(str, Enum): + + creating = "Creating" + active = "Active" + deleting = "Deleting" + + class CustomDomainResourceState(str, Enum): creating = "Creating" @@ -275,6 +303,13 @@ class ProtocolType(str, Enum): ip_based = "IPBased" +class MinimumTlsVersion(str, Enum): + + none = "None" + tls10 = "TLS10" + tls12 = "TLS12" + + class CertificateType(str, Enum): shared = "Shared" diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters.py index c854a87ff851..14fd42bab2b9 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters.py @@ -24,6 +24,9 @@ class CustomDomainHttpsParameters(Model): used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType + :param minimum_tls_version: TLS protocol version that will be used for + Https. Possible values include: 'None', 'TLS10', 'TLS12' + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion :param certificate_source: Required. Constant filled by server. :type certificate_source: str """ @@ -35,6 +38,7 @@ class CustomDomainHttpsParameters(Model): _attribute_map = { 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'MinimumTlsVersion'}, 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, } @@ -45,4 +49,5 @@ class CustomDomainHttpsParameters(Model): def __init__(self, **kwargs): super(CustomDomainHttpsParameters, self).__init__(**kwargs) self.protocol_type = kwargs.get('protocol_type', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) self.certificate_source = None diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters_py3.py index 97bfd1838cba..ca7c8530f1cf 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters_py3.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters_py3.py @@ -24,6 +24,9 @@ class CustomDomainHttpsParameters(Model): used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType + :param minimum_tls_version: TLS protocol version that will be used for + Https. Possible values include: 'None', 'TLS10', 'TLS12' + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion :param certificate_source: Required. Constant filled by server. :type certificate_source: str """ @@ -35,6 +38,7 @@ class CustomDomainHttpsParameters(Model): _attribute_map = { 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'MinimumTlsVersion'}, 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, } @@ -42,7 +46,8 @@ class CustomDomainHttpsParameters(Model): 'certificate_source': {'Cdn': 'CdnManagedHttpsParameters', 'AzureKeyVault': 'UserManagedHttpsParameters'} } - def __init__(self, *, protocol_type, **kwargs) -> None: + def __init__(self, *, protocol_type, minimum_tls_version=None, **kwargs) -> None: super(CustomDomainHttpsParameters, self).__init__(**kwargs) self.protocol_type = protocol_type + self.minimum_tls_version = minimum_tls_version self.certificate_source = None diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin.py index 16ff46a21a21..63e2410b1389 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin.py @@ -17,16 +17,34 @@ 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 """ _validation = { @@ -34,6 +52,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 = { @@ -41,6 +61,10 @@ 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'}, } def __init__(self, **kwargs): @@ -49,3 +73,7 @@ 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) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_group.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_group.py new file mode 100644 index 000000000000..347c76a78b8c --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_group.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +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) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_group_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_group_py3.py new file mode 100644 index 000000000000..7a5d1ee79a66 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_group_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_py3.py index 1de34bb5580a..68c6395f4f19 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_py3.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_py3.py @@ -17,16 +17,34 @@ 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 """ _validation = { @@ -34,6 +52,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 = { @@ -41,11 +61,19 @@ 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'}, } - 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, **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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint.py index 3c4db7a3272e..be6fa72ad6cd 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint.py @@ -33,18 +33,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. @@ -75,12 +77,15 @@ 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 delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. :type delivery_policy: @@ -91,6 +96,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' @@ -117,9 +125,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'}, @@ -127,18 +135,20 @@ 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'}, 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, '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) @@ -146,8 +156,10 @@ 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.delivery_policy = kwargs.get('delivery_policy', 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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_py3.py index 9c6a32cc6bd9..bbd0bf3c17fb 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_py3.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_py3.py @@ -33,18 +33,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. @@ -75,12 +77,15 @@ 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 delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. :type delivery_policy: @@ -91,6 +96,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' @@ -117,9 +125,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'}, @@ -127,18 +135,20 @@ 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'}, 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, '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, **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, delivery_policy=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 @@ -146,8 +156,10 @@ 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.delivery_policy = delivery_policy self.host_name = None self.origins = origins + self.origin_groups = origin_groups self.resource_state = None self.provisioning_state = None diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters.py index 0a1ed8c7706d..0bcef4d0b8ed 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters.py @@ -17,18 +17,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. @@ -59,12 +61,15 @@ 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 delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. :type delivery_policy: @@ -73,9 +78,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'}, @@ -83,15 +88,16 @@ 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'}, 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, } 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) @@ -99,4 +105,5 @@ 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.delivery_policy = kwargs.get('delivery_policy', None) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters_py3.py index e18452cae71f..4d90774adfb8 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters_py3.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters_py3.py @@ -17,18 +17,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. @@ -59,12 +61,15 @@ 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 delivery_policy: A policy that specifies the delivery rules to be used for an endpoint. :type delivery_policy: @@ -73,9 +78,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'}, @@ -83,15 +88,16 @@ 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'}, 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, } - 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, **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, delivery_policy=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 @@ -99,4 +105,5 @@ 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.delivery_policy = delivery_policy diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/health_probe_parameters.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/health_probe_parameters.py new file mode 100644 index 000000000000..37c59f600449 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/health_probe_parameters.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/health_probe_parameters_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/health_probe_parameters_py3.py new file mode 100644 index 000000000000..19375af77cba --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/health_probe_parameters_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/http_error_range_parameters.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/http_error_range_parameters.py new file mode 100644 index 000000000000..49a4ccbe84f6 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/http_error_range_parameters.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/http_error_range_parameters_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/http_error_range_parameters_py3.py new file mode 100644 index 000000000000..e882050a5e22 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/http_error_range_parameters_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin.py index c8d08d32e39c..87337f56067e 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin.py @@ -33,14 +33,30 @@ 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 :ivar resource_state: Resource status of the origin. Possible values include: 'Creating', 'Active', 'Deleting' :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState @@ -53,9 +69,10 @@ 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}, } @@ -69,6 +86,10 @@ 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'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -78,5 +99,9 @@ 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.resource_state = None self.provisioning_state = None diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group.py new file mode 100644 index 000000000000..383dba4f7fcf --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_paged.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_paged.py new file mode 100644 index 000000000000..15dc83b17609 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_py3.py new file mode 100644 index 000000000000..beb072df1bf2 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_update_parameters.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_update_parameters.py new file mode 100644 index 000000000000..e51186eadd8d --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_update_parameters.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_update_parameters_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_update_parameters_py3.py new file mode 100644 index 000000000000..ee43819d3015 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_group_update_parameters_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_py3.py index 11d56f13d920..dc969b73f380 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_py3.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_py3.py @@ -33,14 +33,30 @@ 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 :ivar resource_state: Resource status of the origin. Possible values include: 'Creating', 'Active', 'Deleting' :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState @@ -53,9 +69,10 @@ 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}, } @@ -69,14 +86,22 @@ 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'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', '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, **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.resource_state = None self.provisioning_state = None diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters.py index 605a78e80f8b..90f18c52f044 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters.py @@ -13,31 +13,61 @@ 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 """ _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'}, } 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) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters_py3.py index 29be582b9a42..7e604b195f97 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters_py3.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters_py3.py @@ -13,31 +13,61 @@ 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 """ _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'}, } - 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, **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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_reference.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_reference.py new file mode 100644 index 000000000000..f60004c7dcba --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_reference.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_reference_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_reference_py3.py new file mode 100644 index 000000000000..0501cf71543a --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_reference_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/response_based_origin_error_detection_parameters.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/response_based_origin_error_detection_parameters.py new file mode 100644 index 000000000000..b9928f7613ef --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/response_based_origin_error_detection_parameters.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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) diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/response_based_origin_error_detection_parameters_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/response_based_origin_error_detection_parameters_py3.py new file mode 100644 index 000000000000..cf4b638d3792 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/response_based_origin_error_detection_parameters_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters.py index 1153a4f390d3..80530b46ce38 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters.py @@ -22,6 +22,9 @@ class UserManagedHttpsParameters(CustomDomainHttpsParameters): used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType + :param minimum_tls_version: TLS protocol version that will be used for + Https. Possible values include: 'None', 'TLS10', 'TLS12' + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion :param certificate_source: Required. Constant filled by server. :type certificate_source: str :param certificate_source_parameters: Required. Defines the certificate @@ -38,6 +41,7 @@ class UserManagedHttpsParameters(CustomDomainHttpsParameters): _attribute_map = { 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'MinimumTlsVersion'}, 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, 'certificate_source_parameters': {'key': 'certificateSourceParameters', 'type': 'KeyVaultCertificateSourceParameters'}, } diff --git a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters_py3.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters_py3.py index 7a87fe51b92c..ee03188794d0 100644 --- a/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters_py3.py +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters_py3.py @@ -22,6 +22,9 @@ class UserManagedHttpsParameters(CustomDomainHttpsParameters): used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' :type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType + :param minimum_tls_version: TLS protocol version that will be used for + Https. Possible values include: 'None', 'TLS10', 'TLS12' + :type minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion :param certificate_source: Required. Constant filled by server. :type certificate_source: str :param certificate_source_parameters: Required. Defines the certificate @@ -38,11 +41,12 @@ class UserManagedHttpsParameters(CustomDomainHttpsParameters): _attribute_map = { 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'minimum_tls_version': {'key': 'minimumTlsVersion', 'type': 'MinimumTlsVersion'}, 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, 'certificate_source_parameters': {'key': 'certificateSourceParameters', 'type': 'KeyVaultCertificateSourceParameters'}, } - def __init__(self, *, protocol_type, certificate_source_parameters, **kwargs) -> None: - super(UserManagedHttpsParameters, self).__init__(protocol_type=protocol_type, **kwargs) + def __init__(self, *, protocol_type, certificate_source_parameters, minimum_tls_version=None, **kwargs) -> None: + super(UserManagedHttpsParameters, self).__init__(protocol_type=protocol_type, minimum_tls_version=minimum_tls_version, **kwargs) self.certificate_source_parameters = certificate_source_parameters self.certificate_source = 'AzureKeyVault' 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 4a59e48a8459..7ac27daec9ba 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 @@ -21,6 +22,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 f24572ef6125..f07edf9497ba 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 @@ -24,7 +24,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-04-15". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-12-31". """ 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-04-15" + self.api_version = "2019-12-31" 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 0cd4485594d5..e593054a5b86 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 @@ -22,7 +22,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-04-15". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-12-31". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-04-15" + self.api_version = "2019-12-31" 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 73acbe5a525e..b5a0073c8ba7 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 @@ -24,7 +24,7 @@ class EndpointsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-04-15". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-12-31". """ 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-04-15" + self.api_version = "2019-12-31" self.config = config @@ -342,10 +342,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/operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/operations.py index 52b4c6870266..5dcf5f8e44a4 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 @@ -22,7 +22,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-04-15". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-12-31". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-04-15" + self.api_version = "2019-12-31" 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..a79cae2e4331 --- /dev/null +++ b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/origin_groups_operations.py @@ -0,0 +1,504 @@ +# 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. + + :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: "2019-12-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-31" + + 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 internal_paging(next_link=None, raw=False): + + 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) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OriginGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OriginGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + 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 cfaa0fff394b..f4776ad0d3ec 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 @@ -24,7 +24,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-04-15". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-12-31". """ 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-04-15" + self.api_version = "2019-12-31" self.config = config @@ -185,6 +185,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 @@ -297,3 +412,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/profiles_operations.py b/sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/profiles_operations.py index 4083cbd2d8e9..ccada0f37845 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 @@ -24,7 +24,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-04-15". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-12-31". """ 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-04-15" + self.api_version = "2019-12-31" 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 db649c9ceedb..9f20e020e6e7 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 @@ -22,7 +22,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-04-15". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2019-12-31". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-04-15" + self.api_version = "2019-12-31" self.config = config