Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-mgmt-cdn/azure/mgmt/cdn/cdn_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(
self._client = ServiceClient(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)

Expand Down
20 changes: 20 additions & 0 deletions azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@
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
Expand Down Expand Up @@ -70,7 +80,17 @@
'DeepCreatedOrigin',
'Endpoint',
'GeoFilter',
'DeliveryRuleAction',
'DeliveryRuleCondition',
'DeliveryRule',
'EndpointPropertiesUpdateParametersDeliveryPolicy',
'EndpointUpdateParameters',
'UrlPathConditionParameters',
'DeliveryRuleUrlPathCondition',
'UrlFileExtensionConditionParameters',
'DeliveryRuleUrlFileExtensionCondition',
'CacheExpirationActionParameters',
'DeliveryRuleCacheExpirationAction',
'PurgeParameters',
'LoadParameters',
'Origin',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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.

:ivar odatatype: Default value:
"Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" .
:vartype odatatype: str
:param cache_behavior: 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: 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=None):
super(CacheExpirationActionParameters, self).__init__()
self.cache_behavior = cache_behavior
self.cache_duration = cache_duration
47 changes: 47 additions & 0 deletions azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule.py
Original file line number Diff line number Diff line change
@@ -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 DeliveryRule(Model):
"""A rule that specifies a set of actions and conditions.

:param order: The order in which the rules are applied for the endpoint.
Possible values {0,1,2,3,………}. A rule with a lesser order will be applied
before a rule with a greater order. Rule with order 0 is a special rule.
It does not require any condition and actions listed in it will always be
applied.
:type order: int
:param actions: A list of actions that are executed when all the
conditions of a rule are satisfied.
:type actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction]
:param 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, actions, conditions=None):
super(DeliveryRule, self).__init__()
self.order = order
self.actions = actions
self.conditions = conditions
39 changes: 39 additions & 0 deletions azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_action.py
Original file line number Diff line number Diff line change
@@ -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 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

:param name: 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):
super(DeliveryRuleAction, self).__init__()
self.name = None
Original file line number Diff line number Diff line change
@@ -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 .delivery_rule_action import DeliveryRuleAction


class DeliveryRuleCacheExpirationAction(DeliveryRuleAction):
"""Defines the cache expiration action for the delivery rule.

:param name: Constant filled by server.
:type name: str
:param parameters: 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):
super(DeliveryRuleCacheExpirationAction, self).__init__()
self.parameters = parameters
self.name = 'CacheExpiration'
40 changes: 40 additions & 0 deletions azure-mgmt-cdn/azure/mgmt/cdn/models/delivery_rule_condition.py
Original file line number Diff line number Diff line change
@@ -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 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

:param name: 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):
super(DeliveryRuleCondition, self).__init__()
self.name = None
Original file line number Diff line number Diff line change
@@ -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 .delivery_rule_condition import DeliveryRuleCondition


class DeliveryRuleUrlFileExtensionCondition(DeliveryRuleCondition):
"""Defines the URL file extension condition for the delivery rule.

:param name: Constant filled by server.
:type name: str
:param parameters: 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):
super(DeliveryRuleUrlFileExtensionCondition, self).__init__()
self.parameters = parameters
self.name = 'UrlFileExtension'
Original file line number Diff line number Diff line change
@@ -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 .delivery_rule_condition import DeliveryRuleCondition


class DeliveryRuleUrlPathCondition(DeliveryRuleCondition):
"""Defines the URL path condition for the delivery rule.

:param name: Constant filled by server.
:type name: str
:param parameters: 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):
super(DeliveryRuleUrlPathCondition, self).__init__()
self.parameters = parameters
self.name = 'UrlPath'
8 changes: 7 additions & 1 deletion azure-mgmt-cdn/azure/mgmt/cdn/models/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ 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
Expand Down Expand Up @@ -120,13 +124,14 @@ 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):
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, delivery_policy=None):
super(Endpoint, self).__init__(location=location, tags=tags)
self.origin_host_header = origin_host_header
self.origin_path = origin_path
Expand All @@ -138,6 +143,7 @@ def __init__(self, location, origins, tags=None, origin_host_header=None, origin
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
Expand Down
Loading