diff --git a/azure-mgmt-cdn/HISTORY.rst b/azure-mgmt-cdn/HISTORY.rst index e5efca86d3ed..cabe733fd844 100644 --- a/azure-mgmt-cdn/HISTORY.rst +++ b/azure-mgmt-cdn/HISTORY.rst @@ -3,6 +3,46 @@ Release History =============== +3.0.0 (2018-05-25) +++++++++++++++++++ + +**Features** + +- Add client method check_name_availability_with_subscription +- Model EndpointUpdateParameters has a new parameter delivery_policy +- Model Endpoint has a new parameter delivery_policy +- Client class can be used as a context manager to keep the underlying HTTP session open for performance + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes. + +- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments. + To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments. +- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, and are documented here: + https://docs.python.org/3/library/enum.html#others + At a glance: + + - "is" should not be used at all. + - "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered. + +- New Long Running Operation: + + - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, + the response of the initial call will be returned without polling. + - `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away. + +**Bugfixes** + +- Compatibility of the sdist with wheel 0.31.0 + + 2.0.0 (2017-10-26) ++++++++++++++++++ diff --git a/azure-mgmt-cdn/README.rst b/azure-mgmt-cdn/README.rst index 3fa0733220fa..3943e79785f4 100644 --- a/azure-mgmt-cdn/README.rst +++ b/azure-mgmt-cdn/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure CDN Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -36,9 +36,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `CDN Resource Management -`__ -on readthedocs.org. +For code examples, see `CDN Management +`__ +on docs.microsoft.com. Provide Feedback diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/cdn_management_client.py b/azure-mgmt-cdn/azure/mgmt/cdn/cdn_management_client.py index 31fb6353d261..afba70d709ab 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/cdn_management_client.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/cdn_management_client.py @@ -9,12 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from msrest.pipeline import ClientRawResponse -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.profiles_operations import ProfilesOperations from .operations.endpoints_operations import EndpointsOperations @@ -58,7 +59,7 @@ def __init__( self.subscription_id = subscription_id -class CdnManagementClient(object): +class CdnManagementClient(SDKClient): """Use these APIs to manage Azure CDN resources through the Azure Resource Manager. You must make sure that requests made to these resources are secure. :ivar config: Configuration for client. @@ -91,10 +92,10 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = CdnManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + 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 = '2017-04-02' + self.api_version = '2017-10-12' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -173,6 +174,70 @@ def check_name_availability( return deserialized check_name_availability.metadata = {'url': '/providers/Microsoft.Cdn/checkNameAvailability'} + def check_name_availability_with_subscription( + self, name, custom_headers=None, raw=False, **operation_config): + """Check the availability of a resource name. This is needed for resources + where name is globally unique, such as a CDN endpoint. + + :param name: The resource name to validate. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameAvailabilityOutput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cdn.models.CheckNameAvailabilityOutput or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + check_name_availability_input = models.CheckNameAvailabilityInput(name=name) + + # Construct URL + url = self.check_name_availability_with_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(check_name_availability_input, 'CheckNameAvailabilityInput') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityOutput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability_with_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkNameAvailability'} + def validate_probe( self, probe_url, custom_headers=None, raw=False, **operation_config): """Check if the probe path is a valid path and the file can be accessed. diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py index 9d21eedae8cb..4c839265f66b 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py @@ -9,37 +9,90 @@ # regenerated. # -------------------------------------------------------------------------- -from .sku import Sku -from .profile import Profile -from .profile_update_parameters import ProfileUpdateParameters -from .sso_uri import SsoUri -from .supported_optimization_types_list_result import SupportedOptimizationTypesListResult -from .deep_created_origin import DeepCreatedOrigin -from .endpoint import Endpoint -from .geo_filter import GeoFilter -from .endpoint_update_parameters import EndpointUpdateParameters -from .purge_parameters import PurgeParameters -from .load_parameters import LoadParameters -from .origin import Origin -from .origin_update_parameters import OriginUpdateParameters -from .custom_domain import CustomDomain -from .custom_domain_parameters import CustomDomainParameters -from .validate_custom_domain_input import ValidateCustomDomainInput -from .validate_custom_domain_output import ValidateCustomDomainOutput -from .check_name_availability_input import CheckNameAvailabilityInput -from .check_name_availability_output import CheckNameAvailabilityOutput -from .validate_probe_input import ValidateProbeInput -from .validate_probe_output import ValidateProbeOutput -from .resource_usage import ResourceUsage -from .operation_display import OperationDisplay -from .operation import Operation -from .cidr_ip_address import CidrIpAddress -from .ip_address_group import IpAddressGroup -from .edge_node import EdgeNode -from .resource import Resource -from .tracked_resource import TrackedResource -from .proxy_resource import ProxyResource -from .error_response import ErrorResponse, ErrorResponseException +try: + from .sku_py3 import Sku + from .profile_py3 import Profile + from .profile_update_parameters_py3 import ProfileUpdateParameters + from .sso_uri_py3 import SsoUri + from .supported_optimization_types_list_result_py3 import SupportedOptimizationTypesListResult + from .deep_created_origin_py3 import DeepCreatedOrigin + from .endpoint_py3 import Endpoint + from .geo_filter_py3 import GeoFilter + from .delivery_rule_action_py3 import DeliveryRuleAction + from .delivery_rule_condition_py3 import DeliveryRuleCondition + from .delivery_rule_py3 import DeliveryRule + from .endpoint_properties_update_parameters_delivery_policy_py3 import EndpointPropertiesUpdateParametersDeliveryPolicy + from .endpoint_update_parameters_py3 import EndpointUpdateParameters + from .url_path_condition_parameters_py3 import UrlPathConditionParameters + from .delivery_rule_url_path_condition_py3 import DeliveryRuleUrlPathCondition + from .url_file_extension_condition_parameters_py3 import UrlFileExtensionConditionParameters + from .delivery_rule_url_file_extension_condition_py3 import DeliveryRuleUrlFileExtensionCondition + from .cache_expiration_action_parameters_py3 import CacheExpirationActionParameters + from .delivery_rule_cache_expiration_action_py3 import DeliveryRuleCacheExpirationAction + from .purge_parameters_py3 import PurgeParameters + from .load_parameters_py3 import LoadParameters + from .origin_py3 import Origin + from .origin_update_parameters_py3 import OriginUpdateParameters + from .custom_domain_py3 import CustomDomain + from .custom_domain_parameters_py3 import CustomDomainParameters + from .validate_custom_domain_input_py3 import ValidateCustomDomainInput + from .validate_custom_domain_output_py3 import ValidateCustomDomainOutput + from .check_name_availability_input_py3 import CheckNameAvailabilityInput + from .check_name_availability_output_py3 import CheckNameAvailabilityOutput + from .validate_probe_input_py3 import ValidateProbeInput + from .validate_probe_output_py3 import ValidateProbeOutput + from .resource_usage_py3 import ResourceUsage + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .cidr_ip_address_py3 import CidrIpAddress + from .ip_address_group_py3 import IpAddressGroup + from .edge_node_py3 import EdgeNode + from .resource_py3 import Resource + from .tracked_resource_py3 import TrackedResource + from .proxy_resource_py3 import ProxyResource + from .error_response_py3 import ErrorResponse, ErrorResponseException +except (SyntaxError, ImportError): + from .sku import Sku + from .profile import Profile + from .profile_update_parameters import ProfileUpdateParameters + from .sso_uri import SsoUri + from .supported_optimization_types_list_result import SupportedOptimizationTypesListResult + from .deep_created_origin import DeepCreatedOrigin + from .endpoint import Endpoint + from .geo_filter import GeoFilter + from .delivery_rule_action import DeliveryRuleAction + from .delivery_rule_condition import DeliveryRuleCondition + from .delivery_rule import DeliveryRule + from .endpoint_properties_update_parameters_delivery_policy import EndpointPropertiesUpdateParametersDeliveryPolicy + from .endpoint_update_parameters import EndpointUpdateParameters + from .url_path_condition_parameters import UrlPathConditionParameters + from .delivery_rule_url_path_condition import DeliveryRuleUrlPathCondition + from .url_file_extension_condition_parameters import UrlFileExtensionConditionParameters + from .delivery_rule_url_file_extension_condition import DeliveryRuleUrlFileExtensionCondition + from .cache_expiration_action_parameters import CacheExpirationActionParameters + from .delivery_rule_cache_expiration_action import DeliveryRuleCacheExpirationAction + from .purge_parameters import PurgeParameters + from .load_parameters import LoadParameters + from .origin import Origin + from .origin_update_parameters import OriginUpdateParameters + from .custom_domain import CustomDomain + from .custom_domain_parameters import CustomDomainParameters + from .validate_custom_domain_input import ValidateCustomDomainInput + from .validate_custom_domain_output import ValidateCustomDomainOutput + from .check_name_availability_input import CheckNameAvailabilityInput + from .check_name_availability_output import CheckNameAvailabilityOutput + from .validate_probe_input import ValidateProbeInput + from .validate_probe_output import ValidateProbeOutput + from .resource_usage import ResourceUsage + from .operation_display import OperationDisplay + from .operation import Operation + from .cidr_ip_address import CidrIpAddress + from .ip_address_group import IpAddressGroup + from .edge_node import EdgeNode + from .resource import Resource + from .tracked_resource import TrackedResource + from .proxy_resource import ProxyResource + from .error_response import ErrorResponse, ErrorResponseException from .profile_paged import ProfilePaged from .resource_usage_paged import ResourceUsagePaged from .endpoint_paged import EndpointPaged @@ -70,7 +123,17 @@ 'DeepCreatedOrigin', 'Endpoint', 'GeoFilter', + 'DeliveryRuleAction', + 'DeliveryRuleCondition', + 'DeliveryRule', + 'EndpointPropertiesUpdateParametersDeliveryPolicy', 'EndpointUpdateParameters', + 'UrlPathConditionParameters', + 'DeliveryRuleUrlPathCondition', + 'UrlFileExtensionConditionParameters', + 'DeliveryRuleUrlFileExtensionCondition', + 'CacheExpirationActionParameters', + 'DeliveryRuleCacheExpirationAction', 'PurgeParameters', 'LoadParameters', 'Origin', diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/cache_expiration_action_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/cache_expiration_action_parameters.py new file mode 100644 index 000000000000..733f37ee6e40 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/cache_expiration_action_parameters.py @@ -0,0 +1,58 @@ +# 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 CacheExpirationActionParameters(Model): + """Defines the parameters for the cache expiration action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odatatype: Required. Default value: + "Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" . + :vartype odatatype: str + :param cache_behavior: Required. Caching behavior for the requests that + include query strings. Possible values include: 'BypassCache', 'Override', + 'SetIfMissing' + :type cache_behavior: str or ~azure.mgmt.cdn.models.enum + :ivar cache_type: Required. The level at which the content needs to be + cached. Default value: "All" . + :vartype cache_type: str + :param cache_duration: The duration for which the the content needs to be + cached. Allowed format is [d.]hh:mm:ss + :type cache_duration: str + """ + + _validation = { + 'odatatype': {'required': True, 'constant': True}, + 'cache_behavior': {'required': True}, + 'cache_type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + 'cache_behavior': {'key': 'cacheBehavior', 'type': 'str'}, + 'cache_type': {'key': 'cacheType', 'type': 'str'}, + 'cache_duration': {'key': 'cacheDuration', 'type': 'str'}, + } + + odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" + + cache_type = "All" + + def __init__(self, **kwargs): + super(CacheExpirationActionParameters, self).__init__(**kwargs) + self.cache_behavior = kwargs.get('cache_behavior', None) + self.cache_duration = kwargs.get('cache_duration', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/cache_expiration_action_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/cache_expiration_action_parameters_py3.py new file mode 100644 index 000000000000..b962f37e0b09 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/cache_expiration_action_parameters_py3.py @@ -0,0 +1,58 @@ +# 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 CacheExpirationActionParameters(Model): + """Defines the parameters for the cache expiration action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odatatype: Required. Default value: + "Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" . + :vartype odatatype: str + :param cache_behavior: Required. Caching behavior for the requests that + include query strings. Possible values include: 'BypassCache', 'Override', + 'SetIfMissing' + :type cache_behavior: str or ~azure.mgmt.cdn.models.enum + :ivar cache_type: Required. The level at which the content needs to be + cached. Default value: "All" . + :vartype cache_type: str + :param cache_duration: The duration for which the the content needs to be + cached. Allowed format is [d.]hh:mm:ss + :type cache_duration: str + """ + + _validation = { + 'odatatype': {'required': True, 'constant': True}, + 'cache_behavior': {'required': True}, + 'cache_type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + 'cache_behavior': {'key': 'cacheBehavior', 'type': 'str'}, + 'cache_type': {'key': 'cacheType', 'type': 'str'}, + 'cache_duration': {'key': 'cacheDuration', 'type': 'str'}, + } + + odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" + + cache_type = "All" + + def __init__(self, *, cache_behavior, cache_duration: str=None, **kwargs) -> None: + super(CacheExpirationActionParameters, self).__init__(**kwargs) + self.cache_behavior = cache_behavior + self.cache_duration = cache_duration diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_management_client_enums.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_management_client_enums.py index 2f443d08b56e..591e7b58f03e 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_management_client_enums.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_management_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class SkuName(Enum): +class SkuName(str, Enum): standard_verizon = "Standard_Verizon" premium_verizon = "Premium_Verizon" @@ -21,7 +21,7 @@ class SkuName(Enum): standard_china_cdn = "Standard_ChinaCdn" -class ProfileResourceState(Enum): +class ProfileResourceState(str, Enum): creating = "Creating" active = "Active" @@ -29,7 +29,7 @@ class ProfileResourceState(Enum): disabled = "Disabled" -class OptimizationType(Enum): +class OptimizationType(str, Enum): general_web_delivery = "GeneralWebDelivery" general_media_streaming = "GeneralMediaStreaming" @@ -38,7 +38,7 @@ class OptimizationType(Enum): dynamic_site_acceleration = "DynamicSiteAcceleration" -class EndpointResourceState(Enum): +class EndpointResourceState(str, Enum): creating = "Creating" deleting = "Deleting" @@ -48,7 +48,7 @@ class EndpointResourceState(Enum): stopping = "Stopping" -class QueryStringCachingBehavior(Enum): +class QueryStringCachingBehavior(str, Enum): ignore_query_string = "IgnoreQueryString" bypass_caching = "BypassCaching" @@ -56,27 +56,27 @@ class QueryStringCachingBehavior(Enum): not_set = "NotSet" -class GeoFilterActions(Enum): +class GeoFilterActions(str, Enum): block = "Block" allow = "Allow" -class OriginResourceState(Enum): +class OriginResourceState(str, Enum): creating = "Creating" active = "Active" deleting = "Deleting" -class CustomDomainResourceState(Enum): +class CustomDomainResourceState(str, Enum): creating = "Creating" active = "Active" deleting = "Deleting" -class CustomHttpsProvisioningState(Enum): +class CustomHttpsProvisioningState(str, Enum): enabling = "Enabling" enabled = "Enabled" @@ -85,7 +85,7 @@ class CustomHttpsProvisioningState(Enum): failed = "Failed" -class CustomHttpsProvisioningSubstate(Enum): +class CustomHttpsProvisioningSubstate(str, Enum): submitting_domain_control_validation_request = "SubmittingDomainControlValidationRequest" pending_domain_control_validation_request_approval = "PendingDomainControlValidationREquestApproval" @@ -99,6 +99,6 @@ class CustomHttpsProvisioningSubstate(Enum): certificate_deleted = "CertificateDeleted" -class ResourceType(Enum): +class ResourceType(str, Enum): microsoft_cdn_profiles_endpoints = "Microsoft.Cdn/Profiles/Endpoints" diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_input.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_input.py index 5496f2db2544..4a6593482eb8 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_input.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_input.py @@ -18,10 +18,12 @@ class CheckNameAvailabilityInput(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The resource name to validate. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The resource name to validate. :type name: str - :ivar type: The type of the resource whose name is to be validated. - Default value: "Microsoft.Cdn/Profiles/Endpoints" . + :ivar type: Required. The type of the resource whose name is to be + validated. Default value: "Microsoft.Cdn/Profiles/Endpoints" . :vartype type: str """ @@ -37,6 +39,6 @@ class CheckNameAvailabilityInput(Model): type = "Microsoft.Cdn/Profiles/Endpoints" - def __init__(self, name): - super(CheckNameAvailabilityInput, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(CheckNameAvailabilityInput, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_input_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_input_py3.py new file mode 100644 index 000000000000..42eab59591f1 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_input_py3.py @@ -0,0 +1,44 @@ +# 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 CheckNameAvailabilityInput(Model): + """Input of CheckNameAvailability API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The resource name to validate. + :type name: str + :ivar type: Required. The type of the resource whose name is to be + validated. Default value: "Microsoft.Cdn/Profiles/Endpoints" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Cdn/Profiles/Endpoints" + + def __init__(self, *, name: str, **kwargs) -> None: + super(CheckNameAvailabilityInput, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_output.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_output.py index b24761c2f8e3..7ec032b77912 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_output.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_output.py @@ -39,8 +39,8 @@ class CheckNameAvailabilityOutput(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(CheckNameAvailabilityOutput, self).__init__() + def __init__(self, **kwargs): + super(CheckNameAvailabilityOutput, self).__init__(**kwargs) self.name_available = None self.reason = None self.message = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_output_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_output_py3.py new file mode 100644 index 000000000000..4ed87f02d7d7 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/check_name_availability_output_py3.py @@ -0,0 +1,46 @@ +# 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 CheckNameAvailabilityOutput(Model): + """Output of check name availability API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Indicates whether the name is available. + :vartype name_available: bool + :ivar reason: The reason why the name is not available. + :vartype reason: str + :ivar message: The detailed error message describing why the name is not + available. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityOutput, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/cidr_ip_address.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/cidr_ip_address.py index 32461c4c9c59..c37e0ac9b254 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/cidr_ip_address.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/cidr_ip_address.py @@ -26,7 +26,7 @@ class CidrIpAddress(Model): 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, } - def __init__(self, base_ip_address=None, prefix_length=None): - super(CidrIpAddress, self).__init__() - self.base_ip_address = base_ip_address - self.prefix_length = prefix_length + def __init__(self, **kwargs): + super(CidrIpAddress, self).__init__(**kwargs) + self.base_ip_address = kwargs.get('base_ip_address', None) + self.prefix_length = kwargs.get('prefix_length', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/cidr_ip_address_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/cidr_ip_address_py3.py new file mode 100644 index 000000000000..6eba08681803 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/cidr_ip_address_py3.py @@ -0,0 +1,32 @@ +# 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 CidrIpAddress(Model): + """CIDR Ip address. + + :param base_ip_address: Ip adress itself. + :type base_ip_address: str + :param prefix_length: The length of the prefix of the ip address. + :type prefix_length: int + """ + + _attribute_map = { + 'base_ip_address': {'key': 'baseIpAddress', 'type': 'str'}, + 'prefix_length': {'key': 'prefixLength', 'type': 'int'}, + } + + def __init__(self, *, base_ip_address: str=None, prefix_length: int=None, **kwargs) -> None: + super(CidrIpAddress, self).__init__(**kwargs) + self.base_ip_address = base_ip_address + self.prefix_length = prefix_length diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain.py index ea3df9faa471..06bfef84aca2 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain.py @@ -19,14 +19,16 @@ class CustomDomain(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param host_name: The host name of the custom domain. Must be a domain - name. + :param host_name: Required. The host name of the custom domain. Must be a + domain name. :type host_name: str :ivar resource_state: Resource status of the custom domain. Possible values include: 'Creating', 'Active', 'Deleting' @@ -79,11 +81,11 @@ class CustomDomain(ProxyResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, host_name, validation_data=None): - super(CustomDomain, self).__init__() - self.host_name = host_name + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) self.resource_state = None self.custom_https_provisioning_state = None self.custom_https_provisioning_substate = None - self.validation_data = validation_data + self.validation_data = kwargs.get('validation_data', None) self.provisioning_state = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_parameters.py index 2b21bd7e011c..07ac9c4ea739 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_parameters.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_parameters.py @@ -15,8 +15,10 @@ class CustomDomainParameters(Model): """The customDomain JSON object required for custom domain creation or update. - :param host_name: The host name of the custom domain. Must be a domain - name. + All required parameters must be populated in order to send to Azure. + + :param host_name: Required. The host name of the custom domain. Must be a + domain name. :type host_name: str """ @@ -28,6 +30,6 @@ class CustomDomainParameters(Model): 'host_name': {'key': 'properties.hostName', 'type': 'str'}, } - def __init__(self, host_name): - super(CustomDomainParameters, self).__init__() - self.host_name = host_name + def __init__(self, **kwargs): + super(CustomDomainParameters, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_parameters_py3.py new file mode 100644 index 000000000000..3830c7b64c75 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 CustomDomainParameters(Model): + """The customDomain JSON object required for custom domain creation or update. + + All required parameters must be populated in order to send to Azure. + + :param host_name: Required. The host name of the custom domain. Must be a + domain name. + :type host_name: str + """ + + _validation = { + 'host_name': {'required': True}, + } + + _attribute_map = { + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + } + + def __init__(self, *, host_name: str, **kwargs) -> None: + super(CustomDomainParameters, self).__init__(**kwargs) + self.host_name = host_name diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_py3.py new file mode 100644 index 000000000000..e0679e355d60 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_py3.py @@ -0,0 +1,91 @@ +# 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 CustomDomain(ProxyResource): + """Friendly domain name mapping to the endpoint hostname that the customer + provides for branding purposes, e.g. www.consoto.com. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param host_name: Required. The host name of the custom domain. Must be a + domain name. + :type host_name: str + :ivar resource_state: Resource status of the custom domain. Possible + values include: 'Creating', 'Active', 'Deleting' + :vartype resource_state: str or + ~azure.mgmt.cdn.models.CustomDomainResourceState + :ivar custom_https_provisioning_state: Provisioning status of Custom Https + of the custom domain. Possible values include: 'Enabling', 'Enabled', + 'Disabling', 'Disabled', 'Failed' + :vartype custom_https_provisioning_state: str or + ~azure.mgmt.cdn.models.CustomHttpsProvisioningState + :ivar custom_https_provisioning_substate: Provisioning substate shows the + progress of custom HTTPS enabling/disabling process step by step. Possible + values include: 'SubmittingDomainControlValidationRequest', + 'PendingDomainControlValidationREquestApproval', + 'DomainControlValidationRequestApproved', + 'DomainControlValidationRequestRejected', + 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', + 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', + 'CertificateDeleted' + :vartype custom_https_provisioning_substate: str or + ~azure.mgmt.cdn.models.CustomHttpsProvisioningSubstate + :param validation_data: Special validation or data may be required when + delivering CDN to some regions due to local compliance reasons. E.g. ICP + license number of a custom domain is required to deliver content in China. + :type validation_data: str + :ivar provisioning_state: Provisioning status of the custom domain. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'host_name': {'required': True}, + 'resource_state': {'readonly': True}, + 'custom_https_provisioning_state': {'readonly': True}, + 'custom_https_provisioning_substate': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'custom_https_provisioning_state': {'key': 'properties.customHttpsProvisioningState', 'type': 'str'}, + 'custom_https_provisioning_substate': {'key': 'properties.customHttpsProvisioningSubstate', 'type': 'str'}, + 'validation_data': {'key': 'properties.validationData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, host_name: str, validation_data: str=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.host_name = host_name + self.resource_state = None + self.custom_https_provisioning_state = None + self.custom_https_provisioning_substate = None + self.validation_data = validation_data + self.provisioning_state = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin.py index 1320dd04d9ce..16ff46a21a21 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin.py @@ -15,10 +15,12 @@ class DeepCreatedOrigin(Model): """The main origin of CDN content which is added when creating a CDN endpoint. - :param name: Origin name + All required parameters must be populated in order to send to Azure. + + :param name: Required. Origin name :type name: str - :param host_name: The address of the origin. It can be a domain name, IPv4 - address, or IPv6 address. + :param host_name: Required. The address of the origin. It can be a domain + name, IPv4 address, or IPv6 address. :type host_name: str :param http_port: The value of the HTTP port. Must be between 1 and 65535 :type http_port: int @@ -41,9 +43,9 @@ class DeepCreatedOrigin(Model): 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, } - def __init__(self, name, host_name, http_port=None, https_port=None): - super(DeepCreatedOrigin, self).__init__() - self.name = name - self.host_name = host_name - self.http_port = http_port - self.https_port = https_port + def __init__(self, **kwargs): + super(DeepCreatedOrigin, self).__init__(**kwargs) + self.name = kwargs.get('name', 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) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_py3.py new file mode 100644 index 000000000000..1de34bb5580a --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/deep_created_origin_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeepCreatedOrigin(Model): + """The main origin of CDN content which is added when creating a CDN endpoint. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Origin name + :type name: str + :param host_name: Required. The address of the origin. It can be a domain + name, IPv4 address, or IPv6 address. + :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 + """ + + _validation = { + 'name': {'required': True}, + 'host_name': {'required': True}, + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + } + + def __init__(self, *, name: str, host_name: str, http_port: int=None, https_port: int=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 diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule.py new file mode 100644 index 000000000000..63f57602843d --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule.py @@ -0,0 +1,49 @@ +# 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 DeliveryRule(Model): + """A rule that specifies a set of actions and conditions. + + All required parameters must be populated in order to send to Azure. + + :param order: Required. The order in which the rules are applied for the + endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will + be applied before a rule with a greater order. Rule with order 0 is a + special rule. It does not require any condition and actions listed in it + will always be applied. + :type order: int + :param actions: Required. A list of actions that are executed when all the + conditions of a rule are satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :param conditions: A list of conditions that must be matched for the + actions to be executed + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + """ + + _validation = { + 'order': {'required': True}, + 'actions': {'required': True}, + } + + _attribute_map = { + 'order': {'key': 'order', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[DeliveryRuleAction]'}, + 'conditions': {'key': 'conditions', 'type': '[DeliveryRuleCondition]'}, + } + + def __init__(self, **kwargs): + super(DeliveryRule, self).__init__(**kwargs) + self.order = kwargs.get('order', None) + self.actions = kwargs.get('actions', None) + self.conditions = kwargs.get('conditions', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_action.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_action.py new file mode 100644 index 000000000000..c3bd94a0ea7e --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_action.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeliveryRuleAction(Model): + """An action for the delivery rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DeliveryRuleCacheExpirationAction + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Constant filled by server. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'name': {'CacheExpiration': 'DeliveryRuleCacheExpirationAction'} + } + + def __init__(self, **kwargs): + super(DeliveryRuleAction, self).__init__(**kwargs) + self.name = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_action_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_action_py3.py new file mode 100644 index 000000000000..10d60ce7ce31 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_action_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeliveryRuleAction(Model): + """An action for the delivery rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DeliveryRuleCacheExpirationAction + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Constant filled by server. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'name': {'CacheExpiration': 'DeliveryRuleCacheExpirationAction'} + } + + def __init__(self, **kwargs) -> None: + super(DeliveryRuleAction, self).__init__(**kwargs) + self.name = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_cache_expiration_action.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_cache_expiration_action.py new file mode 100644 index 000000000000..7a52d1019a6b --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_cache_expiration_action.py @@ -0,0 +1,39 @@ +# 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 .delivery_rule_action import DeliveryRuleAction + + +class DeliveryRuleCacheExpirationAction(DeliveryRuleAction): + """Defines the cache expiration action for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Constant filled by server. + :type name: str + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.CacheExpirationActionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'CacheExpirationActionParameters'}, + } + + def __init__(self, **kwargs): + super(DeliveryRuleCacheExpirationAction, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) + self.name = 'CacheExpiration' diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_cache_expiration_action_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_cache_expiration_action_py3.py new file mode 100644 index 000000000000..9074de9c66ad --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_cache_expiration_action_py3.py @@ -0,0 +1,39 @@ +# 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 .delivery_rule_action_py3 import DeliveryRuleAction + + +class DeliveryRuleCacheExpirationAction(DeliveryRuleAction): + """Defines the cache expiration action for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Constant filled by server. + :type name: str + :param parameters: Required. Defines the parameters for the action. + :type parameters: ~azure.mgmt.cdn.models.CacheExpirationActionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'CacheExpirationActionParameters'}, + } + + def __init__(self, *, parameters, **kwargs) -> None: + super(DeliveryRuleCacheExpirationAction, self).__init__(**kwargs) + self.parameters = parameters + self.name = 'CacheExpiration' diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_condition.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_condition.py new file mode 100644 index 000000000000..ad81c9f7b533 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_condition.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeliveryRuleCondition(Model): + """A condition for the delivery rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DeliveryRuleUrlPathCondition, + DeliveryRuleUrlFileExtensionCondition + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Constant filled by server. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'name': {'UrlPath': 'DeliveryRuleUrlPathCondition', 'UrlFileExtension': 'DeliveryRuleUrlFileExtensionCondition'} + } + + def __init__(self, **kwargs): + super(DeliveryRuleCondition, self).__init__(**kwargs) + self.name = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_condition_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_condition_py3.py new file mode 100644 index 000000000000..e50925b7db4f --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_condition_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeliveryRuleCondition(Model): + """A condition for the delivery rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DeliveryRuleUrlPathCondition, + DeliveryRuleUrlFileExtensionCondition + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Constant filled by server. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'name': {'UrlPath': 'DeliveryRuleUrlPathCondition', 'UrlFileExtension': 'DeliveryRuleUrlFileExtensionCondition'} + } + + def __init__(self, **kwargs) -> None: + super(DeliveryRuleCondition, self).__init__(**kwargs) + self.name = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_py3.py new file mode 100644 index 000000000000..b6f1c33b003e --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_py3.py @@ -0,0 +1,49 @@ +# 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 DeliveryRule(Model): + """A rule that specifies a set of actions and conditions. + + All required parameters must be populated in order to send to Azure. + + :param order: Required. The order in which the rules are applied for the + endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will + be applied before a rule with a greater order. Rule with order 0 is a + special rule. It does not require any condition and actions listed in it + will always be applied. + :type order: int + :param actions: Required. A list of actions that are executed when all the + conditions of a rule are satisfied. + :type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction] + :param conditions: A list of conditions that must be matched for the + actions to be executed + :type conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition] + """ + + _validation = { + 'order': {'required': True}, + 'actions': {'required': True}, + } + + _attribute_map = { + 'order': {'key': 'order', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[DeliveryRuleAction]'}, + 'conditions': {'key': 'conditions', 'type': '[DeliveryRuleCondition]'}, + } + + def __init__(self, *, order: int, actions, conditions=None, **kwargs) -> None: + super(DeliveryRule, self).__init__(**kwargs) + self.order = order + self.actions = actions + self.conditions = conditions diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_file_extension_condition.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_file_extension_condition.py new file mode 100644 index 000000000000..d215d3cd4b2d --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_file_extension_condition.py @@ -0,0 +1,40 @@ +# 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 .delivery_rule_condition import DeliveryRuleCondition + + +class DeliveryRuleUrlFileExtensionCondition(DeliveryRuleCondition): + """Defines the URL file extension condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Constant filled by server. + :type name: str + :param parameters: Required. Defines the parameters for the condition. + :type parameters: + ~azure.mgmt.cdn.models.UrlFileExtensionConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'UrlFileExtensionConditionParameters'}, + } + + def __init__(self, **kwargs): + super(DeliveryRuleUrlFileExtensionCondition, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) + self.name = 'UrlFileExtension' diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_file_extension_condition_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_file_extension_condition_py3.py new file mode 100644 index 000000000000..f97f2cac2d0f --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_file_extension_condition_py3.py @@ -0,0 +1,40 @@ +# 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 .delivery_rule_condition_py3 import DeliveryRuleCondition + + +class DeliveryRuleUrlFileExtensionCondition(DeliveryRuleCondition): + """Defines the URL file extension condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Constant filled by server. + :type name: str + :param parameters: Required. Defines the parameters for the condition. + :type parameters: + ~azure.mgmt.cdn.models.UrlFileExtensionConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'UrlFileExtensionConditionParameters'}, + } + + def __init__(self, *, parameters, **kwargs) -> None: + super(DeliveryRuleUrlFileExtensionCondition, self).__init__(**kwargs) + self.parameters = parameters + self.name = 'UrlFileExtension' diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_path_condition.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_path_condition.py new file mode 100644 index 000000000000..b3eb2578b72e --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_path_condition.py @@ -0,0 +1,39 @@ +# 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 .delivery_rule_condition import DeliveryRuleCondition + + +class DeliveryRuleUrlPathCondition(DeliveryRuleCondition): + """Defines the URL path condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Constant filled by server. + :type name: str + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.UrlPathConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'UrlPathConditionParameters'}, + } + + def __init__(self, **kwargs): + super(DeliveryRuleUrlPathCondition, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) + self.name = 'UrlPath' diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_path_condition_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_path_condition_py3.py new file mode 100644 index 000000000000..730fdcaec98a --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_url_path_condition_py3.py @@ -0,0 +1,39 @@ +# 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 .delivery_rule_condition_py3 import DeliveryRuleCondition + + +class DeliveryRuleUrlPathCondition(DeliveryRuleCondition): + """Defines the URL path condition for the delivery rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Constant filled by server. + :type name: str + :param parameters: Required. Defines the parameters for the condition. + :type parameters: ~azure.mgmt.cdn.models.UrlPathConditionParameters + """ + + _validation = { + 'name': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'UrlPathConditionParameters'}, + } + + def __init__(self, *, parameters, **kwargs) -> None: + super(DeliveryRuleUrlPathCondition, self).__init__(**kwargs) + self.parameters = parameters + self.name = 'UrlPath' diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/edge_node.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/edge_node.py index 591913291670..bd3e8b15c596 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/edge_node.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/edge_node.py @@ -19,13 +19,15 @@ class EdgeNode(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param ip_address_groups: List of ip address groups. + :param ip_address_groups: Required. List of ip address groups. :type ip_address_groups: list[~azure.mgmt.cdn.models.IpAddressGroup] """ @@ -43,6 +45,6 @@ class EdgeNode(ProxyResource): 'ip_address_groups': {'key': 'properties.ipAddressGroups', 'type': '[IpAddressGroup]'}, } - def __init__(self, ip_address_groups): - super(EdgeNode, self).__init__() - self.ip_address_groups = ip_address_groups + def __init__(self, **kwargs): + super(EdgeNode, self).__init__(**kwargs) + self.ip_address_groups = kwargs.get('ip_address_groups', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/edge_node_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/edge_node_py3.py new file mode 100644 index 000000000000..8c0f7f60121a --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/edge_node_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 .proxy_resource_py3 import ProxyResource + + +class EdgeNode(ProxyResource): + """Edgenode is a global Point of Presence (POP) location used to deliver CDN + content to end users. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param ip_address_groups: Required. List of ip address groups. + :type ip_address_groups: list[~azure.mgmt.cdn.models.IpAddressGroup] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_address_groups': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_address_groups': {'key': 'properties.ipAddressGroups', 'type': '[IpAddressGroup]'}, + } + + def __init__(self, *, ip_address_groups, **kwargs) -> None: + super(EdgeNode, self).__init__(**kwargs) + self.ip_address_groups = ip_address_groups diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint.py index 254a295a45a8..ae5f039a3f00 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint.py @@ -21,13 +21,15 @@ class Endpoint(TrackedResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Resource location. + :param location: Required. Resource location. :type location: str :param tags: Resource tags. :type tags: dict[str, str] @@ -79,10 +81,15 @@ class Endpoint(TrackedResource): CDN endpoint. Each geo filter defines an acess rule to a specified path or content, e.g. block APAC for path /pictures/ :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param delivery_policy: A policy that specifies the delivery rules to be + used for an endpoint. + :type delivery_policy: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. consoto.azureedge.net :vartype host_name: str - :param origins: The source of the content being delivered via CDN. + :param origins: Required. The source of the content being delivered via + CDN. :type origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin] :ivar resource_state: Resource status of the endpoint. Possible values include: 'Creating', 'Deleting', 'Running', 'Starting', 'Stopped', @@ -120,25 +127,27 @@ class Endpoint(TrackedResource): 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, + 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, 'host_name': {'key': 'properties.hostName', 'type': 'str'}, 'origins': {'key': 'properties.origins', 'type': '[DeepCreatedOrigin]'}, 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, origins, tags=None, origin_host_header=None, origin_path=None, content_types_to_compress=None, is_compression_enabled=None, is_http_allowed=None, is_https_allowed=None, query_string_caching_behavior=None, optimization_type=None, probe_path=None, geo_filters=None): - super(Endpoint, self).__init__(location=location, tags=tags) - self.origin_host_header = origin_host_header - self.origin_path = origin_path - self.content_types_to_compress = content_types_to_compress - self.is_compression_enabled = is_compression_enabled - self.is_http_allowed = is_http_allowed - self.is_https_allowed = is_https_allowed - self.query_string_caching_behavior = query_string_caching_behavior - self.optimization_type = optimization_type - self.probe_path = probe_path - self.geo_filters = geo_filters + 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.is_compression_enabled = kwargs.get('is_compression_enabled', None) + self.is_http_allowed = kwargs.get('is_http_allowed', None) + self.is_https_allowed = kwargs.get('is_https_allowed', None) + self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) + self.optimization_type = kwargs.get('optimization_type', None) + self.probe_path = kwargs.get('probe_path', None) + self.geo_filters = kwargs.get('geo_filters', None) + self.delivery_policy = kwargs.get('delivery_policy', None) self.host_name = None - self.origins = origins + self.origins = kwargs.get('origins', None) self.resource_state = None self.provisioning_state = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_properties_update_parameters_delivery_policy.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_properties_update_parameters_delivery_policy.py new file mode 100644 index 000000000000..aa35c0e0c09d --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_properties_update_parameters_delivery_policy.py @@ -0,0 +1,38 @@ +# 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 EndpointPropertiesUpdateParametersDeliveryPolicy(Model): + """A policy that specifies the delivery rules to be used for an endpoint. + + All required parameters must be populated in order to send to Azure. + + :param description: User-friendly description of the policy. + :type description: str + :param rules: Required. A list of the delivery rules. + :type rules: list[~azure.mgmt.cdn.models.DeliveryRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[DeliveryRule]'}, + } + + def __init__(self, **kwargs): + super(EndpointPropertiesUpdateParametersDeliveryPolicy, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_properties_update_parameters_delivery_policy_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_properties_update_parameters_delivery_policy_py3.py new file mode 100644 index 000000000000..efd432c3fc53 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_properties_update_parameters_delivery_policy_py3.py @@ -0,0 +1,38 @@ +# 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 EndpointPropertiesUpdateParametersDeliveryPolicy(Model): + """A policy that specifies the delivery rules to be used for an endpoint. + + All required parameters must be populated in order to send to Azure. + + :param description: User-friendly description of the policy. + :type description: str + :param rules: Required. A list of the delivery rules. + :type rules: list[~azure.mgmt.cdn.models.DeliveryRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[DeliveryRule]'}, + } + + def __init__(self, *, rules, description: str=None, **kwargs) -> None: + super(EndpointPropertiesUpdateParametersDeliveryPolicy, self).__init__(**kwargs) + self.description = description + self.rules = rules diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_py3.py new file mode 100644 index 000000000000..2f44460c0f4b --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_py3.py @@ -0,0 +1,153 @@ +# 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 .tracked_resource_py3 import TrackedResource + + +class Endpoint(TrackedResource): + """CDN endpoint is the entity within a CDN profile containing configuration + information such as origin, protocol, content caching and delivery + behavior. The CDN endpoint uses the URL format + .azureedge.net. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: 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 + retreive 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 is_compression_enabled: Indicates whether content compression is + enabled on CDN. Default value is false. If compression is enabled, content + will be served as compressed if user requests for a compressed version. + Content won't be compressed on CDN when requested content is smaller than + 1 byte or larger than 1 MB. + :type is_compression_enabled: bool + :param is_http_allowed: Indicates whether HTTP traffic is allowed on the + endpoint. Default value is true. At least one protocol (HTTP or HTTPS) + must be allowed. + :type is_http_allowed: bool + :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the + endpoint. Default value is true. At least one protocol (HTTP or HTTPS) + must be allowed. + :type is_https_allowed: bool + :param query_string_caching_behavior: Defines how CDN caches requests that + include query strings. You can ignore any query strings when caching, + bypass caching to prevent requests that contain query strings from being + cached, or cache every request with a unique URL. Possible values include: + 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet' + :type query_string_caching_behavior: str or + ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this + CDN endpoint to optimize for, e.g. Download, Media services. With this + information, CDN can apply scenario driven optimization. Possible values + include: 'GeneralWebDelivery', 'GeneralMediaStreaming', + 'VideoOnDemandMediaStreaming', 'LargeFileDownload', + 'DynamicSiteAcceleration' + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param probe_path: Path to a file hosted on the origin which helps + accelerate delivery of the dynamic content and calculate the most optimal + routes for the CDN. This is relative to the origin path. + :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 acess rule to a specified path or + content, e.g. block APAC for path /pictures/ + :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param delivery_policy: A policy that specifies the delivery rules to be + used for an endpoint. + :type delivery_policy: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy + :ivar host_name: The host name of the endpoint structured as + {endpointName}.{DNSZone}, e.g. consoto.azureedge.net + :vartype host_name: str + :param origins: Required. The source of the content being delivered via + CDN. + :type origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin] + :ivar resource_state: Resource status of the endpoint. Possible values + include: 'Creating', 'Deleting', 'Running', 'Starting', 'Stopped', + 'Stopping' + :vartype resource_state: str or + ~azure.mgmt.cdn.models.EndpointResourceState + :ivar provisioning_state: Provisioning status of the endpoint. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'host_name': {'readonly': True}, + 'origins': {'required': True}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'origin_host_header': {'key': 'properties.originHostHeader', 'type': 'str'}, + 'origin_path': {'key': 'properties.originPath', 'type': 'str'}, + 'content_types_to_compress': {'key': 'properties.contentTypesToCompress', 'type': '[str]'}, + 'is_compression_enabled': {'key': 'properties.isCompressionEnabled', 'type': 'bool'}, + 'is_http_allowed': {'key': 'properties.isHttpAllowed', 'type': 'bool'}, + 'is_https_allowed': {'key': 'properties.isHttpsAllowed', 'type': 'bool'}, + 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'QueryStringCachingBehavior'}, + 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, + 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, + 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, + 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'origins': {'key': 'properties.origins', 'type': '[DeepCreatedOrigin]'}, + '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: + 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.is_compression_enabled = is_compression_enabled + self.is_http_allowed = is_http_allowed + self.is_https_allowed = is_https_allowed + self.query_string_caching_behavior = query_string_caching_behavior + self.optimization_type = optimization_type + self.probe_path = probe_path + self.geo_filters = geo_filters + self.delivery_policy = delivery_policy + self.host_name = None + self.origins = origins + self.resource_state = None + self.provisioning_state = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters.py index d4002dc577d3..36ec115ceb78 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters.py @@ -65,6 +65,10 @@ class EndpointUpdateParameters(Model): CDN endpoint. Each geo filter defines an acess rule to a specified path or content, e.g. block APAC for path /pictures/ :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param delivery_policy: A policy that specifies the delivery rules to be + used for an endpoint. + :type delivery_policy: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy """ _attribute_map = { @@ -79,18 +83,20 @@ class EndpointUpdateParameters(Model): 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, + 'delivery_policy': {'key': 'properties.deliveryPolicy', 'type': 'EndpointPropertiesUpdateParametersDeliveryPolicy'}, } - def __init__(self, tags=None, origin_host_header=None, origin_path=None, content_types_to_compress=None, is_compression_enabled=None, is_http_allowed=None, is_https_allowed=None, query_string_caching_behavior=None, optimization_type=None, probe_path=None, geo_filters=None): - super(EndpointUpdateParameters, self).__init__() - 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.is_compression_enabled = is_compression_enabled - self.is_http_allowed = is_http_allowed - self.is_https_allowed = is_https_allowed - self.query_string_caching_behavior = query_string_caching_behavior - self.optimization_type = optimization_type - self.probe_path = probe_path - self.geo_filters = geo_filters + 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.is_compression_enabled = kwargs.get('is_compression_enabled', None) + self.is_http_allowed = kwargs.get('is_http_allowed', None) + self.is_https_allowed = kwargs.get('is_https_allowed', None) + self.query_string_caching_behavior = kwargs.get('query_string_caching_behavior', None) + self.optimization_type = kwargs.get('optimization_type', None) + self.probe_path = kwargs.get('probe_path', None) + self.geo_filters = kwargs.get('geo_filters', None) + self.delivery_policy = kwargs.get('delivery_policy', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters_py3.py new file mode 100644 index 000000000000..ed4a7fdd9d60 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint_update_parameters_py3.py @@ -0,0 +1,102 @@ +# 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 EndpointUpdateParameters(Model): + """Properties required to create or update an endpoint. + + :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 + retreive 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 is_compression_enabled: Indicates whether content compression is + enabled on CDN. Default value is false. If compression is enabled, content + will be served as compressed if user requests for a compressed version. + Content won't be compressed on CDN when requested content is smaller than + 1 byte or larger than 1 MB. + :type is_compression_enabled: bool + :param is_http_allowed: Indicates whether HTTP traffic is allowed on the + endpoint. Default value is true. At least one protocol (HTTP or HTTPS) + must be allowed. + :type is_http_allowed: bool + :param is_https_allowed: Indicates whether HTTPS traffic is allowed on the + endpoint. Default value is true. At least one protocol (HTTP or HTTPS) + must be allowed. + :type is_https_allowed: bool + :param query_string_caching_behavior: Defines how CDN caches requests that + include query strings. You can ignore any query strings when caching, + bypass caching to prevent requests that contain query strings from being + cached, or cache every request with a unique URL. Possible values include: + 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet' + :type query_string_caching_behavior: str or + ~azure.mgmt.cdn.models.QueryStringCachingBehavior + :param optimization_type: Specifies what scenario the customer wants this + CDN endpoint to optimize for, e.g. Download, Media services. With this + information, CDN can apply scenario driven optimization. Possible values + include: 'GeneralWebDelivery', 'GeneralMediaStreaming', + 'VideoOnDemandMediaStreaming', 'LargeFileDownload', + 'DynamicSiteAcceleration' + :type optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType + :param probe_path: Path to a file hosted on the origin which helps + accelerate delivery of the dynamic content and calculate the most optimal + routes for the CDN. This is relative to the origin path. + :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 acess rule to a specified path or + content, e.g. block APAC for path /pictures/ + :type geo_filters: list[~azure.mgmt.cdn.models.GeoFilter] + :param delivery_policy: A policy that specifies the delivery rules to be + used for an endpoint. + :type delivery_policy: + ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy + """ + + _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]'}, + 'is_compression_enabled': {'key': 'properties.isCompressionEnabled', 'type': 'bool'}, + 'is_http_allowed': {'key': 'properties.isHttpAllowed', 'type': 'bool'}, + 'is_https_allowed': {'key': 'properties.isHttpsAllowed', 'type': 'bool'}, + 'query_string_caching_behavior': {'key': 'properties.queryStringCachingBehavior', 'type': 'QueryStringCachingBehavior'}, + 'optimization_type': {'key': 'properties.optimizationType', 'type': 'str'}, + 'probe_path': {'key': 'properties.probePath', 'type': 'str'}, + 'geo_filters': {'key': 'properties.geoFilters', 'type': '[GeoFilter]'}, + '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: + 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.is_compression_enabled = is_compression_enabled + self.is_http_allowed = is_http_allowed + self.is_https_allowed = is_https_allowed + self.query_string_caching_behavior = query_string_caching_behavior + self.optimization_type = optimization_type + self.probe_path = probe_path + self.geo_filters = geo_filters + self.delivery_policy = delivery_policy diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/error_response.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/error_response.py index 9148d5b7d058..2e1c74ac09c5 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/error_response.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/error_response.py @@ -36,8 +36,8 @@ class ErrorResponse(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(ErrorResponse, self).__init__() + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) self.code = None self.message = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/error_response_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/error_response_py3.py new file mode 100644 index 000000000000..89e755f309dc --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/error_response_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error reponse indicates CDN service is not able to process the incoming + request. The reason is provided in the error message. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/geo_filter.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/geo_filter.py index 563f16a6cd1d..414d0579d275 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/geo_filter.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/geo_filter.py @@ -15,14 +15,16 @@ class GeoFilter(Model): """Rules defining user's geo access within a CDN endpoint. - :param relative_path: Relative path applicable to geo filter. (e.g. - '/mypictures', '/mypicture/kitty.jpg', and etc.) + All required parameters must be populated in order to send to Azure. + + :param relative_path: Required. Relative path applicable to geo filter. + (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.) :type relative_path: str - :param action: Action of the geo filter, i.e. allow or block access. - Possible values include: 'Block', 'Allow' + :param action: Required. Action of the geo filter, i.e. allow or block + access. Possible values include: 'Block', 'Allow' :type action: str or ~azure.mgmt.cdn.models.GeoFilterActions - :param country_codes: Two letter country codes defining user country - access in a geo filter, e.g. AU, MX, US. + :param country_codes: Required. Two letter country codes defining user + country access in a geo filter, e.g. AU, MX, US. :type country_codes: list[str] """ @@ -38,8 +40,8 @@ class GeoFilter(Model): 'country_codes': {'key': 'countryCodes', 'type': '[str]'}, } - def __init__(self, relative_path, action, country_codes): - super(GeoFilter, self).__init__() - self.relative_path = relative_path - self.action = action - self.country_codes = country_codes + def __init__(self, **kwargs): + super(GeoFilter, self).__init__(**kwargs) + self.relative_path = kwargs.get('relative_path', None) + self.action = kwargs.get('action', None) + self.country_codes = kwargs.get('country_codes', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/geo_filter_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/geo_filter_py3.py new file mode 100644 index 000000000000..43449273efa5 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/geo_filter_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 GeoFilter(Model): + """Rules defining user's geo access within a CDN endpoint. + + All required parameters must be populated in order to send to Azure. + + :param relative_path: Required. Relative path applicable to geo filter. + (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.) + :type relative_path: str + :param action: Required. Action of the geo filter, i.e. allow or block + access. Possible values include: 'Block', 'Allow' + :type action: str or ~azure.mgmt.cdn.models.GeoFilterActions + :param country_codes: Required. Two letter country codes defining user + country access in a geo filter, e.g. AU, MX, US. + :type country_codes: list[str] + """ + + _validation = { + 'relative_path': {'required': True}, + 'action': {'required': True}, + 'country_codes': {'required': True}, + } + + _attribute_map = { + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'GeoFilterActions'}, + 'country_codes': {'key': 'countryCodes', 'type': '[str]'}, + } + + def __init__(self, *, relative_path: str, action, country_codes, **kwargs) -> None: + super(GeoFilter, self).__init__(**kwargs) + self.relative_path = relative_path + self.action = action + self.country_codes = country_codes diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/ip_address_group.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/ip_address_group.py index 0cfa23c22699..3c376a9670cc 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/ip_address_group.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/ip_address_group.py @@ -29,8 +29,8 @@ class IpAddressGroup(Model): 'ipv6_addresses': {'key': 'ipv6Addresses', 'type': '[CidrIpAddress]'}, } - def __init__(self, delivery_region=None, ipv4_addresses=None, ipv6_addresses=None): - super(IpAddressGroup, self).__init__() - self.delivery_region = delivery_region - self.ipv4_addresses = ipv4_addresses - self.ipv6_addresses = ipv6_addresses + def __init__(self, **kwargs): + super(IpAddressGroup, self).__init__(**kwargs) + self.delivery_region = kwargs.get('delivery_region', None) + self.ipv4_addresses = kwargs.get('ipv4_addresses', None) + self.ipv6_addresses = kwargs.get('ipv6_addresses', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/ip_address_group_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/ip_address_group_py3.py new file mode 100644 index 000000000000..9f9e71f411ea --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/ip_address_group_py3.py @@ -0,0 +1,36 @@ +# 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 IpAddressGroup(Model): + """CDN Ip address group. + + :param delivery_region: The delivery region of the ip address group + :type delivery_region: str + :param ipv4_addresses: The list of ip v4 addresses. + :type ipv4_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress] + :param ipv6_addresses: The list of ip v6 addresses. + :type ipv6_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress] + """ + + _attribute_map = { + 'delivery_region': {'key': 'deliveryRegion', 'type': 'str'}, + 'ipv4_addresses': {'key': 'ipv4Addresses', 'type': '[CidrIpAddress]'}, + 'ipv6_addresses': {'key': 'ipv6Addresses', 'type': '[CidrIpAddress]'}, + } + + def __init__(self, *, delivery_region: str=None, ipv4_addresses=None, ipv6_addresses=None, **kwargs) -> None: + super(IpAddressGroup, self).__init__(**kwargs) + self.delivery_region = delivery_region + self.ipv4_addresses = ipv4_addresses + self.ipv6_addresses = ipv6_addresses diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/load_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/load_parameters.py index c4a0f2bd97a8..d265e3eec5ec 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/load_parameters.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/load_parameters.py @@ -15,8 +15,10 @@ class LoadParameters(Model): """Parameters required for content load. - :param content_paths: The path to the content to be loaded. Path should be - a relative file URL of the origin. + All required parameters must be populated in order to send to Azure. + + :param content_paths: Required. The path to the content to be loaded. Path + should be a relative file URL of the origin. :type content_paths: list[str] """ @@ -28,6 +30,6 @@ class LoadParameters(Model): 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, } - def __init__(self, content_paths): - super(LoadParameters, self).__init__() - self.content_paths = content_paths + def __init__(self, **kwargs): + super(LoadParameters, self).__init__(**kwargs) + self.content_paths = kwargs.get('content_paths', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/load_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/load_parameters_py3.py new file mode 100644 index 000000000000..78ba0d9e5e19 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/load_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 LoadParameters(Model): + """Parameters required for content load. + + All required parameters must be populated in order to send to Azure. + + :param content_paths: Required. The path to the content to be loaded. Path + should be a relative file URL of the origin. + :type content_paths: list[str] + """ + + _validation = { + 'content_paths': {'required': True}, + } + + _attribute_map = { + 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + } + + def __init__(self, *, content_paths, **kwargs) -> None: + super(LoadParameters, self).__init__(**kwargs) + self.content_paths = content_paths diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/operation.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/operation.py index 71f7a8be9ac6..1c874210ed7f 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/operation.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/operation.py @@ -33,7 +33,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, display=None): - super(Operation, self).__init__() + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) self.name = None - self.display = display + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/operation_display.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/operation_display.py index 687c9f952b18..581b161945af 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/operation_display.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/operation_display.py @@ -39,8 +39,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self): - super(OperationDisplay, self).__init__() + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) self.provider = None self.resource = None self.operation = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/operation_display_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/operation_display_py3.py new file mode 100644 index 000000000000..b36de399b412 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/operation_display_py3.py @@ -0,0 +1,46 @@ +# 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 OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.Cdn + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/operation_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/operation_py3.py new file mode 100644 index 000000000000..b061aa952e3b --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/operation_py3.py @@ -0,0 +1,39 @@ +# 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 Operation(Model): + """CDN REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation} + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.cdn.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/origin.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/origin.py index 57ccdc35e7a4..c8d08d32e39c 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/origin.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/origin.py @@ -21,18 +21,20 @@ class Origin(TrackedResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Resource location. + :param location: Required. Resource location. :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param host_name: The address of the origin. Domain names, IPv4 addresses, - and IPv6 addresses are supported. + :param host_name: Required. The address of the origin. Domain names, IPv4 + addresses, and IPv6 addresses are supported. :type host_name: str :param http_port: The value of the HTTP port. Must be between 1 and 65535. :type http_port: int @@ -71,10 +73,10 @@ class Origin(TrackedResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, host_name, tags=None, http_port=None, https_port=None): - super(Origin, self).__init__(location=location, tags=tags) - self.host_name = host_name - self.http_port = http_port - self.https_port = https_port + def __init__(self, **kwargs): + super(Origin, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) + self.http_port = kwargs.get('http_port', None) + self.https_port = kwargs.get('https_port', None) self.resource_state = None self.provisioning_state = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_py3.py new file mode 100644 index 000000000000..11d56f13d920 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_py3.py @@ -0,0 +1,82 @@ +# 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 .tracked_resource_py3 import TrackedResource + + +class Origin(TrackedResource): + """CDN origin is the source of the content being delivered via CDN. When the + edge nodes represented by an endpoint do not have the requested content + cached, they attempt to fetch it from one or more of the configured + origins. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: 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. + :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 + :ivar resource_state: Resource status of the origin. Possible values + include: 'Creating', 'Active', 'Deleting' + :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState + :ivar provisioning_state: Provisioning status of the origin. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + '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}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + '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: + 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.resource_state = None + self.provisioning_state = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters.py index c850ee4a2116..605a78e80f8b 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters.py @@ -36,8 +36,8 @@ class OriginUpdateParameters(Model): 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, } - def __init__(self, host_name=None, http_port=None, https_port=None): - super(OriginUpdateParameters, self).__init__() - self.host_name = host_name - self.http_port = http_port - self.https_port = https_port + def __init__(self, **kwargs): + super(OriginUpdateParameters, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) + self.http_port = kwargs.get('http_port', None) + self.https_port = kwargs.get('https_port', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters_py3.py new file mode 100644 index 000000000000..29be582b9a42 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/origin_update_parameters_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OriginUpdateParameters(Model): + """Origin properties needed for origin creation or update. + + :param host_name: The address of the origin. Domain names, IPv4 addresses, + and IPv6 addresses are supported. + :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 + """ + + _validation = { + 'http_port': {'maximum': 65535, 'minimum': 1}, + 'https_port': {'maximum': 65535, 'minimum': 1}, + } + + _attribute_map = { + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'http_port': {'key': 'properties.httpPort', 'type': 'int'}, + 'https_port': {'key': 'properties.httpsPort', 'type': 'int'}, + } + + def __init__(self, *, host_name: str=None, http_port: int=None, https_port: int=None, **kwargs) -> None: + super(OriginUpdateParameters, self).__init__(**kwargs) + self.host_name = host_name + self.http_port = http_port + self.https_port = https_port diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/profile.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/profile.py index 410b143880ac..1f9b83f67bae 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/profile.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/profile.py @@ -19,18 +19,20 @@ class Profile(TrackedResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Resource location. + :param location: Required. Resource location. :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param sku: The pricing tier (defines a CDN provider, feature list and - rate) of the CDN profile. + :param sku: Required. The pricing tier (defines a CDN provider, feature + list and rate) of the CDN profile. :type sku: ~azure.mgmt.cdn.models.Sku :ivar resource_state: Resource status of the profile. Possible values include: 'Creating', 'Active', 'Deleting', 'Disabled' @@ -61,8 +63,8 @@ class Profile(TrackedResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, sku, tags=None): - super(Profile, self).__init__(location=location, tags=tags) - self.sku = sku + def __init__(self, **kwargs): + super(Profile, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) self.resource_state = None self.provisioning_state = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/profile_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/profile_py3.py new file mode 100644 index 000000000000..189f3d9cb4cc --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/profile_py3.py @@ -0,0 +1,70 @@ +# 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 .tracked_resource_py3 import TrackedResource + + +class Profile(TrackedResource): + """CDN profile is a logical grouping of endpoints that share the same + settings, such as CDN provider and pricing tier. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: Required. The pricing tier (defines a CDN provider, feature + list and rate) of the CDN profile. + :type sku: ~azure.mgmt.cdn.models.Sku + :ivar resource_state: Resource status of the profile. Possible values + include: 'Creating', 'Active', 'Deleting', 'Disabled' + :vartype resource_state: str or + ~azure.mgmt.cdn.models.ProfileResourceState + :ivar provisioning_state: Provisioning status of the profile. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'resource_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, sku, tags=None, **kwargs) -> None: + super(Profile, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.resource_state = None + self.provisioning_state = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/profile_update_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/profile_update_parameters.py index fd0ef7f2c4c7..914f51eb2dff 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/profile_update_parameters.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/profile_update_parameters.py @@ -23,6 +23,6 @@ class ProfileUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - super(ProfileUpdateParameters, self).__init__() - self.tags = tags + def __init__(self, **kwargs): + super(ProfileUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/profile_update_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/profile_update_parameters_py3.py new file mode 100644 index 000000000000..fbf2f8090603 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/profile_update_parameters_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 ProfileUpdateParameters(Model): + """Properties required to update a profile. + + :param tags: Profile tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ProfileUpdateParameters, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/proxy_resource.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/proxy_resource.py index 867983bc956d..012ff087a08b 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/proxy_resource.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/proxy_resource.py @@ -33,5 +33,11 @@ class ProxyResource(Resource): 'type': {'readonly': True}, } - def __init__(self): - super(ProxyResource, self).__init__() + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/proxy_resource_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/proxy_resource_py3.py new file mode 100644 index 000000000000..63938413f36c --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/proxy_resource_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/purge_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/purge_parameters.py index 824a1909a4f4..4731664fed6a 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/purge_parameters.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/purge_parameters.py @@ -15,8 +15,10 @@ class PurgeParameters(Model): """Parameters required for content purge. - :param content_paths: The path to the content to be purged. Can describe a - file path or a wild card directory. + All required parameters must be populated in order to send to Azure. + + :param content_paths: Required. The path to the content to be purged. Can + describe a file path or a wild card directory. :type content_paths: list[str] """ @@ -28,6 +30,6 @@ class PurgeParameters(Model): 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, } - def __init__(self, content_paths): - super(PurgeParameters, self).__init__() - self.content_paths = content_paths + def __init__(self, **kwargs): + super(PurgeParameters, self).__init__(**kwargs) + self.content_paths = kwargs.get('content_paths', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/purge_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/purge_parameters_py3.py new file mode 100644 index 000000000000..31cdefb06e5b --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/purge_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 PurgeParameters(Model): + """Parameters required for content purge. + + All required parameters must be populated in order to send to Azure. + + :param content_paths: Required. The path to the content to be purged. Can + describe a file path or a wild card directory. + :type content_paths: list[str] + """ + + _validation = { + 'content_paths': {'required': True}, + } + + _attribute_map = { + 'content_paths': {'key': 'contentPaths', 'type': '[str]'}, + } + + def __init__(self, *, content_paths, **kwargs) -> None: + super(PurgeParameters, self).__init__(**kwargs) + self.content_paths = content_paths diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/resource.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/resource.py index d4619be996a7..67c78c7fb464 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/resource.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/resource.py @@ -38,8 +38,8 @@ class Resource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_py3.py new file mode 100644 index 000000000000..ee416b984937 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The core properties of ARM resources. + + 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_usage.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_usage.py index 2fa7f31f4971..ba216e259427 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_usage.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_usage.py @@ -42,8 +42,8 @@ class ResourceUsage(Model): 'limit': {'key': 'limit', 'type': 'int'}, } - def __init__(self): - super(ResourceUsage, self).__init__() + def __init__(self, **kwargs): + super(ResourceUsage, self).__init__(**kwargs) self.resource_type = None self.unit = None self.current_value = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_usage_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_usage_py3.py new file mode 100644 index 000000000000..a7f557b5ecae --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/resource_usage_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 ResourceUsage(Model): + """Output of check resource usage API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: Resource type for which the usage is provided. + :vartype resource_type: str + :ivar unit: Unit of the usage. e.g. Count. + :vartype unit: str + :ivar current_value: Actual value of usage on the specified resource type. + :vartype current_value: int + :ivar limit: Quota of the specified resource type. + :vartype limit: int + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceUsage, self).__init__(**kwargs) + self.resource_type = None + self.unit = None + self.current_value = None + self.limit = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/sku.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/sku.py index b6c090159405..88b809ac026f 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/sku.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/sku.py @@ -26,6 +26,6 @@ class Sku(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(Sku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/sku_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/sku_py3.py new file mode 100644 index 000000000000..d4471b8a4dd4 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/sku_py3.py @@ -0,0 +1,31 @@ +# 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 Sku(Model): + """The pricing tier (defines a CDN provider, feature list and rate) of the CDN + profile. + + :param name: Name of the pricing tier. Possible values include: + 'Standard_Verizon', 'Premium_Verizon', 'Custom_Verizon', + 'Standard_Akamai', 'Standard_ChinaCdn' + :type name: str or ~azure.mgmt.cdn.models.SkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/sso_uri.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/sso_uri.py index f27d2e633ba4..1a2f7c408e19 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/sso_uri.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/sso_uri.py @@ -30,6 +30,6 @@ class SsoUri(Model): 'sso_uri_value': {'key': 'ssoUriValue', 'type': 'str'}, } - def __init__(self): - super(SsoUri, self).__init__() + def __init__(self, **kwargs): + super(SsoUri, self).__init__(**kwargs) self.sso_uri_value = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/sso_uri_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/sso_uri_py3.py new file mode 100644 index 000000000000..269f00d84d24 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/sso_uri_py3.py @@ -0,0 +1,35 @@ +# 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 SsoUri(Model): + """The URI required to login to the supplemental portal from the Azure portal. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar sso_uri_value: The URI used to login to the supplemental portal. + :vartype sso_uri_value: str + """ + + _validation = { + 'sso_uri_value': {'readonly': True}, + } + + _attribute_map = { + 'sso_uri_value': {'key': 'ssoUriValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SsoUri, self).__init__(**kwargs) + self.sso_uri_value = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/supported_optimization_types_list_result.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/supported_optimization_types_list_result.py index 4bc86dc0282c..cfe69fb01272 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/supported_optimization_types_list_result.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/supported_optimization_types_list_result.py @@ -32,6 +32,6 @@ class SupportedOptimizationTypesListResult(Model): 'supported_optimization_types': {'key': 'supportedOptimizationTypes', 'type': '[str]'}, } - def __init__(self): - super(SupportedOptimizationTypesListResult, self).__init__() + def __init__(self, **kwargs): + super(SupportedOptimizationTypesListResult, self).__init__(**kwargs) self.supported_optimization_types = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/supported_optimization_types_list_result_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/supported_optimization_types_list_result_py3.py new file mode 100644 index 000000000000..e8056adcb936 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/supported_optimization_types_list_result_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 SupportedOptimizationTypesListResult(Model): + """The result of the GetSupportedOptimizationTypes API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar supported_optimization_types: Supported optimization types for a + profile. + :vartype supported_optimization_types: list[str or + ~azure.mgmt.cdn.models.OptimizationType] + """ + + _validation = { + 'supported_optimization_types': {'readonly': True}, + } + + _attribute_map = { + 'supported_optimization_types': {'key': 'supportedOptimizationTypes', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(SupportedOptimizationTypesListResult, self).__init__(**kwargs) + self.supported_optimization_types = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/tracked_resource.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/tracked_resource.py index 89da055e8f69..0cc6df63f05b 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/tracked_resource.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/tracked_resource.py @@ -18,13 +18,15 @@ class TrackedResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Resource location. + :param location: Required. Resource location. :type location: str :param tags: Resource tags. :type tags: dict[str, str] @@ -45,7 +47,7 @@ class TrackedResource(Resource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(TrackedResource, self).__init__() - self.location = location - self.tags = tags + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/tracked_resource_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/tracked_resource_py3.py new file mode 100644 index 000000000000..32b78c0d83f2 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/tracked_resource_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/url_file_extension_condition_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/url_file_extension_condition_parameters.py new file mode 100644 index 000000000000..d94baf881a31 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/url_file_extension_condition_parameters.py @@ -0,0 +1,46 @@ +# 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 UrlFileExtensionConditionParameters(Model): + """Defines the parameters for the URL file extension condition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odatatype: Required. Default value: + "Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFileExtensionConditionParameters" + . + :vartype odatatype: str + :param extensions: Required. A list of extensions for the condition of the + delivery rule. + :type extensions: list[str] + """ + + _validation = { + 'odatatype': {'required': True, 'constant': True}, + 'extensions': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + 'extensions': {'key': 'extensions', 'type': '[str]'}, + } + + odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFileExtensionConditionParameters" + + def __init__(self, **kwargs): + super(UrlFileExtensionConditionParameters, self).__init__(**kwargs) + self.extensions = kwargs.get('extensions', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/url_file_extension_condition_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/url_file_extension_condition_parameters_py3.py new file mode 100644 index 000000000000..450c880794ce --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/url_file_extension_condition_parameters_py3.py @@ -0,0 +1,46 @@ +# 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 UrlFileExtensionConditionParameters(Model): + """Defines the parameters for the URL file extension condition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odatatype: Required. Default value: + "Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFileExtensionConditionParameters" + . + :vartype odatatype: str + :param extensions: Required. A list of extensions for the condition of the + delivery rule. + :type extensions: list[str] + """ + + _validation = { + 'odatatype': {'required': True, 'constant': True}, + 'extensions': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + 'extensions': {'key': 'extensions', 'type': '[str]'}, + } + + odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleUrlFileExtensionConditionParameters" + + def __init__(self, *, extensions, **kwargs) -> None: + super(UrlFileExtensionConditionParameters, self).__init__(**kwargs) + self.extensions = extensions diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/url_path_condition_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/url_path_condition_parameters.py new file mode 100644 index 000000000000..06b005be5c26 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/url_path_condition_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 UrlPathConditionParameters(Model): + """Defines the parameters for the URL path condition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odatatype: Required. Default value: + "Microsoft.Azure.Cdn.Models.DeliveryRuleUrlPathConditionParameters" . + :vartype odatatype: str + :param path: Required. A URL path for the condition of the delivery rule + :type path: str + :param match_type: Required. The match type for the condition of the + delivery rule. Possible values include: 'Literal', 'Wildcard' + :type match_type: str or ~azure.mgmt.cdn.models.enum + """ + + _validation = { + 'odatatype': {'required': True, 'constant': True}, + 'path': {'required': True}, + 'match_type': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'match_type': {'key': 'matchType', 'type': 'str'}, + } + + odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleUrlPathConditionParameters" + + def __init__(self, **kwargs): + super(UrlPathConditionParameters, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.match_type = kwargs.get('match_type', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/url_path_condition_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/url_path_condition_parameters_py3.py new file mode 100644 index 000000000000..c1049a0260d9 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/url_path_condition_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 UrlPathConditionParameters(Model): + """Defines the parameters for the URL path condition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar odatatype: Required. Default value: + "Microsoft.Azure.Cdn.Models.DeliveryRuleUrlPathConditionParameters" . + :vartype odatatype: str + :param path: Required. A URL path for the condition of the delivery rule + :type path: str + :param match_type: Required. The match type for the condition of the + delivery rule. Possible values include: 'Literal', 'Wildcard' + :type match_type: str or ~azure.mgmt.cdn.models.enum + """ + + _validation = { + 'odatatype': {'required': True, 'constant': True}, + 'path': {'required': True}, + 'match_type': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'match_type': {'key': 'matchType', 'type': 'str'}, + } + + odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleUrlPathConditionParameters" + + def __init__(self, *, path: str, match_type, **kwargs) -> None: + super(UrlPathConditionParameters, self).__init__(**kwargs) + self.path = path + self.match_type = match_type diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_input.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_input.py index 86eadac85045..5ccf7293966d 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_input.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_input.py @@ -15,8 +15,10 @@ class ValidateCustomDomainInput(Model): """Input of the custom domain to be validated for DNS mapping. - :param host_name: The host name of the custom domain. Must be a domain - name. + All required parameters must be populated in order to send to Azure. + + :param host_name: Required. The host name of the custom domain. Must be a + domain name. :type host_name: str """ @@ -28,6 +30,6 @@ class ValidateCustomDomainInput(Model): 'host_name': {'key': 'hostName', 'type': 'str'}, } - def __init__(self, host_name): - super(ValidateCustomDomainInput, self).__init__() - self.host_name = host_name + def __init__(self, **kwargs): + super(ValidateCustomDomainInput, self).__init__(**kwargs) + self.host_name = kwargs.get('host_name', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_input_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_input_py3.py new file mode 100644 index 000000000000..ad915548dba8 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_input_py3.py @@ -0,0 +1,35 @@ +# 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 ValidateCustomDomainInput(Model): + """Input of the custom domain to be validated for DNS mapping. + + All required parameters must be populated in order to send to Azure. + + :param host_name: Required. The host name of the custom domain. Must be a + domain name. + :type host_name: str + """ + + _validation = { + 'host_name': {'required': True}, + } + + _attribute_map = { + 'host_name': {'key': 'hostName', 'type': 'str'}, + } + + def __init__(self, *, host_name: str, **kwargs) -> None: + super(ValidateCustomDomainInput, self).__init__(**kwargs) + self.host_name = host_name diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_output.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_output.py index 82c6a949d99a..d330e0f93521 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_output.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_output.py @@ -40,8 +40,8 @@ class ValidateCustomDomainOutput(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(ValidateCustomDomainOutput, self).__init__() + def __init__(self, **kwargs): + super(ValidateCustomDomainOutput, self).__init__(**kwargs) self.custom_domain_validated = None self.reason = None self.message = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_output_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_output_py3.py new file mode 100644 index 000000000000..a3d2b9339b9b --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_custom_domain_output_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 ValidateCustomDomainOutput(Model): + """Output of custom domain validation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar custom_domain_validated: Indicates whether the custom domain is + valid or not. + :vartype custom_domain_validated: bool + :ivar reason: The reason why the custom domain is not valid. + :vartype reason: str + :ivar message: Error message describing why the custom domain is not + valid. + :vartype message: str + """ + + _validation = { + 'custom_domain_validated': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'custom_domain_validated': {'key': 'customDomainValidated', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ValidateCustomDomainOutput, self).__init__(**kwargs) + self.custom_domain_validated = None + self.reason = None + self.message = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_input.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_input.py index b3b7818b02d4..4df6dc0ae167 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_input.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_input.py @@ -15,7 +15,9 @@ class ValidateProbeInput(Model): """Input of the validate probe API. - :param probe_url: The probe URL to validate. + All required parameters must be populated in order to send to Azure. + + :param probe_url: Required. The probe URL to validate. :type probe_url: str """ @@ -27,6 +29,6 @@ class ValidateProbeInput(Model): 'probe_url': {'key': 'probeURL', 'type': 'str'}, } - def __init__(self, probe_url): - super(ValidateProbeInput, self).__init__() - self.probe_url = probe_url + def __init__(self, **kwargs): + super(ValidateProbeInput, self).__init__(**kwargs) + self.probe_url = kwargs.get('probe_url', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_input_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_input_py3.py new file mode 100644 index 000000000000..c82e5af3927c --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_input_py3.py @@ -0,0 +1,34 @@ +# 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 ValidateProbeInput(Model): + """Input of the validate probe API. + + All required parameters must be populated in order to send to Azure. + + :param probe_url: Required. The probe URL to validate. + :type probe_url: str + """ + + _validation = { + 'probe_url': {'required': True}, + } + + _attribute_map = { + 'probe_url': {'key': 'probeURL', 'type': 'str'}, + } + + def __init__(self, *, probe_url: str, **kwargs) -> None: + super(ValidateProbeInput, self).__init__(**kwargs) + self.probe_url = probe_url diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_output.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_output.py index dcbc8b9a6228..8bf0b4d5a9b1 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_output.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_output.py @@ -40,8 +40,8 @@ class ValidateProbeOutput(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(ValidateProbeOutput, self).__init__() + def __init__(self, **kwargs): + super(ValidateProbeOutput, self).__init__(**kwargs) self.is_valid = None self.error_code = None self.message = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_output_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_output_py3.py new file mode 100644 index 000000000000..b865a3a978b5 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/validate_probe_output_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 ValidateProbeOutput(Model): + """Output of the validate probe API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar is_valid: Indicates whether the probe URL is accepted or not. + :vartype is_valid: bool + :ivar error_code: Specifies the error code when the probe url is not + accepted. + :vartype error_code: str + :ivar message: The detailed error message describing why the probe URL is + not accepted. + :vartype message: str + """ + + _validation = { + 'is_valid': {'readonly': True}, + 'error_code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ValidateProbeOutput, self).__init__(**kwargs) + self.is_valid = None + self.error_code = None + self.message = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/operations/custom_domains_operations.py b/azure-mgmt-cdn/azure/mgmt/cdn/operations/custom_domains_operations.py index b94b84441fdf..581915ce50cf 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/operations/custom_domains_operations.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/operations/custom_domains_operations.py @@ -11,8 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -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: "2017-04-02". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2017-10-12". """ 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 = "2017-04-02" + self.api_version = "2017-10-12" self.config = config @@ -242,7 +242,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, profile_name, endpoint_name, custom_domain_name, host_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, endpoint_name, custom_domain_name, host_name, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a new custom domain within an endpoint. :param resource_group_name: Name of the Resource group within the @@ -261,13 +261,16 @@ def create( name. :type host_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 - :return: An instance of AzureOperationPoller that returns CustomDomain - or ClientRawResponse if raw=true + :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 CustomDomain or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.CustomDomain] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.CustomDomain]] :raises: :class:`ErrorResponseException` """ @@ -281,28 +284,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('CustomDomain', response) if raw: @@ -311,12 +294,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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}/customDomains/{customDomainName}'} @@ -366,7 +350,7 @@ def _delete_initial( return deserialized def delete( - self, resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes an existing custom domain within an endpoint. :param resource_group_name: Name of the Resource group within the @@ -382,13 +366,16 @@ def delete( endpoint. :type custom_domain_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 - :return: An instance of AzureOperationPoller that returns CustomDomain - or ClientRawResponse if raw=true + :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 CustomDomain or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.CustomDomain] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.CustomDomain]] :raises: :class:`ErrorResponseException` """ @@ -401,28 +388,8 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('CustomDomain', response) if raw: @@ -431,12 +398,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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}/customDomains/{customDomainName}'} def disable_custom_https( diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/operations/edge_nodes_operations.py b/azure-mgmt-cdn/azure/mgmt/cdn/operations/edge_nodes_operations.py index f700d35286f0..3d788cd2ce9f 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/operations/edge_nodes_operations.py +++ b/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: "2017-04-02". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2017-10-12". """ 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 = "2017-04-02" + self.api_version = "2017-10-12" self.config = config diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/operations/endpoints_operations.py b/azure-mgmt-cdn/azure/mgmt/cdn/operations/endpoints_operations.py index 906aace111dd..a363d2214d40 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/operations/endpoints_operations.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/operations/endpoints_operations.py @@ -11,8 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -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: "2017-04-02". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2017-10-12". """ 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 = "2017-04-02" + self.api_version = "2017-10-12" self.config = config @@ -232,7 +232,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, profile_name, endpoint_name, endpoint, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, endpoint_name, endpoint, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. @@ -248,13 +248,16 @@ def create( :param endpoint: Endpoint properties :type endpoint: ~azure.mgmt.cdn.models.Endpoint :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Endpoint or - ClientRawResponse if raw=true + :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 Endpoint or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.Endpoint] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.Endpoint]] :raises: :class:`ErrorResponseException` """ @@ -267,28 +270,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('Endpoint', response) if raw: @@ -297,12 +280,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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}'} @@ -357,7 +341,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers=None, raw=False, **operation_config): + 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 @@ -377,13 +361,16 @@ def update( :type endpoint_update_properties: ~azure.mgmt.cdn.models.EndpointUpdateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Endpoint or - ClientRawResponse if raw=true + :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 Endpoint or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.Endpoint] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.Endpoint]] :raises: :class:`ErrorResponseException` """ @@ -396,28 +383,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('Endpoint', response) if raw: @@ -426,12 +393,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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}'} @@ -473,7 +441,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. @@ -487,12 +455,14 @@ def delete( 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 - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :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 - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`ErrorResponseException` """ @@ -504,38 +474,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - 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 - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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}'} @@ -586,7 +537,7 @@ def _start_initial( return deserialized def start( - self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts an existing CDN endpoint that is on a stopped state. :param resource_group_name: Name of the Resource group within the @@ -599,13 +550,16 @@ def start( 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 - :return: An instance of AzureOperationPoller that returns Endpoint or - ClientRawResponse if raw=true + :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 Endpoint or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.Endpoint] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.Endpoint]] :raises: :class:`ErrorResponseException` """ @@ -617,28 +571,8 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('Endpoint', response) if raw: @@ -647,12 +581,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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) start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start'} @@ -703,7 +638,7 @@ def _stop_initial( return deserialized def stop( - self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops an existing running CDN endpoint. :param resource_group_name: Name of the Resource group within the @@ -716,13 +651,16 @@ def stop( 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 - :return: An instance of AzureOperationPoller that returns Endpoint or - ClientRawResponse if raw=true + :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 Endpoint or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.Endpoint] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.Endpoint]] :raises: :class:`ErrorResponseException` """ @@ -734,28 +672,8 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('Endpoint', response) if raw: @@ -764,12 +682,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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) stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop'} @@ -817,7 +736,7 @@ def _purge_content_initial( return client_raw_response def purge_content( - self, resource_group_name, profile_name, endpoint_name, content_paths, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, endpoint_name, content_paths, custom_headers=None, raw=False, polling=True, **operation_config): """Removes a content from CDN. :param resource_group_name: Name of the Resource group within the @@ -833,12 +752,14 @@ def purge_content( describe a file path or a wild card directory. :type content_paths: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :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 - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`ErrorResponseException` """ @@ -851,38 +772,19 @@ def purge_content( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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) purge_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge'} @@ -930,7 +832,7 @@ def _load_content_initial( return client_raw_response def load_content( - self, resource_group_name, profile_name, endpoint_name, content_paths, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, endpoint_name, content_paths, custom_headers=None, raw=False, polling=True, **operation_config): """Pre-loads a content to CDN. Available for Verizon Profiles. :param resource_group_name: Name of the Resource group within the @@ -946,12 +848,14 @@ def load_content( should be a relative file URL of the origin. :type content_paths: list[str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :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 - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`ErrorResponseException` """ @@ -964,38 +868,19 @@ def load_content( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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) load_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load'} def validate_custom_domain( diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/operations/operations.py b/azure-mgmt-cdn/azure/mgmt/cdn/operations/operations.py index bee028226c2b..07eb4c2795ff 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/operations/operations.py +++ b/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: "2017-04-02". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2017-10-12". """ 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 = "2017-04-02" + self.api_version = "2017-10-12" self.config = config diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/operations/origins_operations.py b/azure-mgmt-cdn/azure/mgmt/cdn/operations/origins_operations.py index ab9ae02090af..e5a715ddacb5 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/operations/origins_operations.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/operations/origins_operations.py @@ -11,8 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -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: "2017-04-02". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2017-10-12". """ 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 = "2017-04-02" + self.api_version = "2017-10-12" self.config = config @@ -238,7 +238,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers=None, raw=False, polling=True, **operation_config): """Updates an existing origin within an endpoint. :param resource_group_name: Name of the Resource group within the @@ -257,13 +257,16 @@ def update( :type origin_update_properties: ~azure.mgmt.cdn.models.OriginUpdateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Origin or - ClientRawResponse if raw=true + :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 ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.Origin]] :raises: :class:`ErrorResponseException` """ @@ -277,28 +280,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('Origin', response) if raw: @@ -307,10 +290,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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}/origins/{originName}'} diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/operations/profiles_operations.py b/azure-mgmt-cdn/azure/mgmt/cdn/operations/profiles_operations.py index af12860c9eb5..438a69a9347d 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/operations/profiles_operations.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/operations/profiles_operations.py @@ -11,8 +11,8 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -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: "2017-04-02". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2017-10-12". """ 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 = "2017-04-02" + self.api_version = "2017-10-12" self.config = config @@ -287,7 +287,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, profile_name, profile, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, profile, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a new CDN profile with a profile name under the specified subscription and resource group. @@ -300,13 +300,16 @@ def create( :param profile: Profile properties needed to create a new profile. :type profile: ~azure.mgmt.cdn.models.Profile :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Profile or - ClientRawResponse if raw=true + :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 Profile or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.Profile] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.Profile]] :raises: :class:`ErrorResponseException` """ @@ -318,28 +321,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('Profile', response) if raw: @@ -348,12 +331,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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}'} @@ -409,7 +393,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, profile_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates an existing CDN profile with the specified profile name under the specified subscription and resource group. @@ -422,13 +406,16 @@ def update( :param tags: Profile tags :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Profile or - ClientRawResponse if raw=true + :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 Profile or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.Profile] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.Profile]] :raises: :class:`ErrorResponseException` """ @@ -440,28 +427,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - deserialized = self._deserialize('Profile', response) if raw: @@ -470,12 +437,13 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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}'} @@ -516,7 +484,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, profile_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all of the sub-resources including endpoints, origins and custom domains. @@ -528,12 +496,14 @@ def delete( the resource group. :type profile_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 - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :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 - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`ErrorResponseException` """ @@ -544,38 +514,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - 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 - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, 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}'} def generate_sso_uri( diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/operations/resource_usage_operations.py b/azure-mgmt-cdn/azure/mgmt/cdn/operations/resource_usage_operations.py index 707e5e31e414..57aaa52c4506 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/operations/resource_usage_operations.py +++ b/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: "2017-04-02". + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-02. Constant value: "2017-10-12". """ 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 = "2017-04-02" + self.api_version = "2017-10-12" self.config = config diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/version.py b/azure-mgmt-cdn/azure/mgmt/cdn/version.py index 53c4c7ea05e8..7f225c6aab41 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/version.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "3.0.0" diff --git a/azure-mgmt-cdn/sdk_packaging.toml b/azure-mgmt-cdn/sdk_packaging.toml new file mode 100644 index 000000000000..224bd7591a1c --- /dev/null +++ b/azure-mgmt-cdn/sdk_packaging.toml @@ -0,0 +1,5 @@ +[packaging] +package_name = "azure-mgmt-cdn" +package_pprint_name = "CDN Management" +package_doc_id = "cdn" +is_stable = true diff --git a/azure-mgmt-cdn/setup.py b/azure-mgmt-cdn/setup.py index 4deb2392c9d2..e2b7e3b2b712 100644 --- a/azure-mgmt-cdn/setup.py +++ b/azure-mgmt-cdn/setup.py @@ -64,12 +64,11 @@ author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', @@ -78,7 +77,7 @@ zip_safe=False, packages=find_packages(exclude=["tests"]), install_requires=[ - 'msrestazure~=0.4.11', + 'msrestazure>=0.4.27,<2.0.0', 'azure-common~=1.1', ], cmdclass=cmdclass diff --git a/azure-mgmt-cdn/tests/recordings/test_mgmt_cdn.test_cdn.yaml b/azure-mgmt-cdn/tests/recordings/test_mgmt_cdn.test_cdn.yaml index f782fe48b0f7..4f63a59df587 100644 --- a/azure-mgmt-cdn/tests/recordings/test_mgmt_cdn.test_cdn.yaml +++ b/azure-mgmt-cdn/tests/recordings/test_mgmt_cdn.test_cdn.yaml @@ -7,11 +7,11 @@ interactions: Connection: [keep-alive] Content-Length: ['72'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.17 - msrest_azure/0.4.15 cdnmanagementclient/2.0.0 Azure-SDK-For-Python] + User-Agent: [python/3.6.4 (Windows-10-10.0.17134-SP0) requests/2.18.4 msrest/0.4.28 + msrest_azure/0.4.31 azure-mgmt-cdn/3.0.0 Azure-SDK-For-Python] accept-language: [en-US] method: POST - uri: https://management.azure.com/providers/Microsoft.Cdn/checkNameAvailability?api-version=2017-04-02 + uri: https://management.azure.com/providers/Microsoft.Cdn/checkNameAvailability?api-version=2017-10-12 response: body: {string: "{\r\n \"nameAvailable\":true,\"reason\":null,\"message\":null\r\ \n}"} @@ -19,7 +19,7 @@ interactions: cache-control: [no-cache] content-length: ['57'] content-type: [application/json; odata.metadata=minimal] - date: ['Thu, 26 Oct 2017 16:58:01 GMT'] + date: ['Fri, 25 May 2018 19:24:53 GMT'] expires: ['-1'] odata-version: ['4.0'] pragma: [no-cache] @@ -28,6 +28,7 @@ interactions: transfer-encoding: [chunked] vary: [Accept-Encoding] x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] x-ms-ratelimit-remaining-tenant-writes: ['1199'] x-powered-by: [ASP.NET] status: {code: 200, message: OK}