Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR cdn/resource-manager] Add rulesEngine support to CDN #5064

Merged
merged 6 commits into from
May 6, 2019
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 @@ -95,7 +95,7 @@ def __init__(
super(CdnManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2017-10-12'
self.api_version = '2019-04-15'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
121 changes: 112 additions & 9 deletions azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,40 @@
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_action_py3 import DeliveryRuleAction
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 .remote_address_match_condition_parameters_py3 import RemoteAddressMatchConditionParameters
from .delivery_rule_remote_address_condition_py3 import DeliveryRuleRemoteAddressCondition
from .request_method_match_condition_parameters_py3 import RequestMethodMatchConditionParameters
from .delivery_rule_request_method_condition_py3 import DeliveryRuleRequestMethodCondition
from .query_string_match_condition_parameters_py3 import QueryStringMatchConditionParameters
from .delivery_rule_query_string_condition_py3 import DeliveryRuleQueryStringCondition
from .post_args_match_condition_parameters_py3 import PostArgsMatchConditionParameters
from .delivery_rule_post_args_condition_py3 import DeliveryRulePostArgsCondition
from .request_uri_match_condition_parameters_py3 import RequestUriMatchConditionParameters
from .delivery_rule_request_uri_condition_py3 import DeliveryRuleRequestUriCondition
from .request_header_match_condition_parameters_py3 import RequestHeaderMatchConditionParameters
from .delivery_rule_request_header_condition_py3 import DeliveryRuleRequestHeaderCondition
from .request_body_match_condition_parameters_py3 import RequestBodyMatchConditionParameters
from .delivery_rule_request_body_condition_py3 import DeliveryRuleRequestBodyCondition
from .request_scheme_match_condition_parameters_py3 import RequestSchemeMatchConditionParameters
from .delivery_rule_request_scheme_condition_py3 import DeliveryRuleRequestSchemeCondition
from .url_path_match_condition_parameters_py3 import UrlPathMatchConditionParameters
from .delivery_rule_url_path_condition_py3 import DeliveryRuleUrlPathCondition
from .url_file_extension_condition_parameters_py3 import UrlFileExtensionConditionParameters
from .url_file_extension_match_condition_parameters_py3 import UrlFileExtensionMatchConditionParameters
from .delivery_rule_url_file_extension_condition_py3 import DeliveryRuleUrlFileExtensionCondition
from .url_file_name_match_condition_parameters_py3 import UrlFileNameMatchConditionParameters
from .delivery_rule_url_file_name_condition_py3 import DeliveryRuleUrlFileNameCondition
from .is_device_match_condition_parameters_py3 import IsDeviceMatchConditionParameters
from .delivery_rule_is_device_condition_py3 import DeliveryRuleIsDeviceCondition
from .url_redirect_action_parameters_py3 import UrlRedirectActionParameters
from .url_redirect_action_py3 import UrlRedirectAction
from .header_action_parameters_py3 import HeaderActionParameters
from .delivery_rule_request_header_action_py3 import DeliveryRuleRequestHeaderAction
from .delivery_rule_response_header_action_py3 import DeliveryRuleResponseHeaderAction
from .cache_expiration_action_parameters_py3 import CacheExpirationActionParameters
from .delivery_rule_cache_expiration_action_py3 import DeliveryRuleCacheExpirationAction
from .purge_parameters_py3 import PurgeParameters
Expand Down Expand Up @@ -65,15 +90,40 @@
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_action import DeliveryRuleAction
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 .remote_address_match_condition_parameters import RemoteAddressMatchConditionParameters
from .delivery_rule_remote_address_condition import DeliveryRuleRemoteAddressCondition
from .request_method_match_condition_parameters import RequestMethodMatchConditionParameters
from .delivery_rule_request_method_condition import DeliveryRuleRequestMethodCondition
from .query_string_match_condition_parameters import QueryStringMatchConditionParameters
from .delivery_rule_query_string_condition import DeliveryRuleQueryStringCondition
from .post_args_match_condition_parameters import PostArgsMatchConditionParameters
from .delivery_rule_post_args_condition import DeliveryRulePostArgsCondition
from .request_uri_match_condition_parameters import RequestUriMatchConditionParameters
from .delivery_rule_request_uri_condition import DeliveryRuleRequestUriCondition
from .request_header_match_condition_parameters import RequestHeaderMatchConditionParameters
from .delivery_rule_request_header_condition import DeliveryRuleRequestHeaderCondition
from .request_body_match_condition_parameters import RequestBodyMatchConditionParameters
from .delivery_rule_request_body_condition import DeliveryRuleRequestBodyCondition
from .request_scheme_match_condition_parameters import RequestSchemeMatchConditionParameters
from .delivery_rule_request_scheme_condition import DeliveryRuleRequestSchemeCondition
from .url_path_match_condition_parameters import UrlPathMatchConditionParameters
from .delivery_rule_url_path_condition import DeliveryRuleUrlPathCondition
from .url_file_extension_condition_parameters import UrlFileExtensionConditionParameters
from .url_file_extension_match_condition_parameters import UrlFileExtensionMatchConditionParameters
from .delivery_rule_url_file_extension_condition import DeliveryRuleUrlFileExtensionCondition
from .url_file_name_match_condition_parameters import UrlFileNameMatchConditionParameters
from .delivery_rule_url_file_name_condition import DeliveryRuleUrlFileNameCondition
from .is_device_match_condition_parameters import IsDeviceMatchConditionParameters
from .delivery_rule_is_device_condition import DeliveryRuleIsDeviceCondition
from .url_redirect_action_parameters import UrlRedirectActionParameters
from .url_redirect_action import UrlRedirectAction
from .header_action_parameters import HeaderActionParameters
from .delivery_rule_request_header_action import DeliveryRuleRequestHeaderAction
from .delivery_rule_response_header_action import DeliveryRuleResponseHeaderAction
from .cache_expiration_action_parameters import CacheExpirationActionParameters
from .delivery_rule_cache_expiration_action import DeliveryRuleCacheExpirationAction
from .purge_parameters import PurgeParameters
Expand Down Expand Up @@ -117,6 +167,20 @@
EndpointResourceState,
QueryStringCachingBehavior,
GeoFilterActions,
RemoteAddressOperator,
Transform,
QueryStringOperator,
PostArgsOperator,
RequestUriOperator,
RequestHeaderOperator,
RequestBodyOperator,
UrlPathOperator,
UrlFileExtensionOperator,
UrlFileNameOperator,
RedirectType,
DestinationProtocol,
HeaderAction,
CacheBehavior,
OriginResourceState,
CustomDomainResourceState,
CustomHttpsProvisioningState,
Expand All @@ -135,15 +199,40 @@
'DeepCreatedOrigin',
'Endpoint',
'GeoFilter',
'DeliveryRuleAction',
'DeliveryRuleCondition',
'DeliveryRuleAction',
'DeliveryRule',
'EndpointPropertiesUpdateParametersDeliveryPolicy',
'EndpointUpdateParameters',
'UrlPathConditionParameters',
'RemoteAddressMatchConditionParameters',
'DeliveryRuleRemoteAddressCondition',
'RequestMethodMatchConditionParameters',
'DeliveryRuleRequestMethodCondition',
'QueryStringMatchConditionParameters',
'DeliveryRuleQueryStringCondition',
'PostArgsMatchConditionParameters',
'DeliveryRulePostArgsCondition',
'RequestUriMatchConditionParameters',
'DeliveryRuleRequestUriCondition',
'RequestHeaderMatchConditionParameters',
'DeliveryRuleRequestHeaderCondition',
'RequestBodyMatchConditionParameters',
'DeliveryRuleRequestBodyCondition',
'RequestSchemeMatchConditionParameters',
'DeliveryRuleRequestSchemeCondition',
'UrlPathMatchConditionParameters',
'DeliveryRuleUrlPathCondition',
'UrlFileExtensionConditionParameters',
'UrlFileExtensionMatchConditionParameters',
'DeliveryRuleUrlFileExtensionCondition',
'UrlFileNameMatchConditionParameters',
'DeliveryRuleUrlFileNameCondition',
'IsDeviceMatchConditionParameters',
'DeliveryRuleIsDeviceCondition',
'UrlRedirectActionParameters',
'UrlRedirectAction',
'HeaderActionParameters',
'DeliveryRuleRequestHeaderAction',
'DeliveryRuleResponseHeaderAction',
'CacheExpirationActionParameters',
'DeliveryRuleCacheExpirationAction',
'PurgeParameters',
Expand Down Expand Up @@ -186,6 +275,20 @@
'EndpointResourceState',
'QueryStringCachingBehavior',
'GeoFilterActions',
'RemoteAddressOperator',
'Transform',
'QueryStringOperator',
'PostArgsOperator',
'RequestUriOperator',
'RequestHeaderOperator',
'RequestBodyOperator',
'UrlPathOperator',
'UrlFileExtensionOperator',
'UrlFileNameOperator',
'RedirectType',
'DestinationProtocol',
'HeaderAction',
'CacheBehavior',
'OriginResourceState',
'CustomDomainResourceState',
'CustomHttpsProvisioningState',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class CacheExpirationActionParameters(Model):
All required parameters must be populated in order to send to Azure.

:ivar odatatype: Required. Default value:
"Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" .
"#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
:param cache_behavior: Required. Caching behavior for the requests.
Possible values include: 'BypassCache', 'Override', 'SetIfMissing'
:type cache_behavior: str or ~azure.mgmt.cdn.models.CacheBehavior
:ivar cache_type: Required. The level at which the content needs to be
cached. Default value: "All" .
:vartype cache_type: str
Expand All @@ -48,7 +48,7 @@ class CacheExpirationActionParameters(Model):
'cache_duration': {'key': 'cacheDuration', 'type': 'str'},
}

odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters"
odatatype = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters"

cache_type = "All"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class CacheExpirationActionParameters(Model):
All required parameters must be populated in order to send to Azure.

:ivar odatatype: Required. Default value:
"Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters" .
"#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
:param cache_behavior: Required. Caching behavior for the requests.
Possible values include: 'BypassCache', 'Override', 'SetIfMissing'
:type cache_behavior: str or ~azure.mgmt.cdn.models.CacheBehavior
:ivar cache_type: Required. The level at which the content needs to be
cached. Default value: "All" .
:vartype cache_type: str
Expand All @@ -48,7 +48,7 @@ class CacheExpirationActionParameters(Model):
'cache_duration': {'key': 'cacheDuration', 'type': 'str'},
}

odatatype = "Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters"
odatatype = "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters"

cache_type = "All"

Expand Down
148 changes: 147 additions & 1 deletion azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_management_client_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class SkuName(str, Enum):
custom_verizon = "Custom_Verizon"
standard_akamai = "Standard_Akamai"
standard_china_cdn = "Standard_ChinaCdn"
premium_china_cdn = "Premium_ChinaCdn"
standard_microsoft = "Standard_Microsoft"


Expand Down Expand Up @@ -64,6 +63,153 @@ class GeoFilterActions(str, Enum):
allow = "Allow"


class RemoteAddressOperator(str, Enum):

any = "Any"
ip_match = "IPMatch"
geo_match = "GeoMatch"


class Transform(str, Enum):

lowercase = "Lowercase"
uppercase = "Uppercase"


class QueryStringOperator(str, Enum):

any = "Any"
equal = "Equal"
contains = "Contains"
begins_with = "BeginsWith"
ends_with = "EndsWith"
less_than = "LessThan"
less_than_or_equal = "LessThanOrEqual"
greater_than = "GreaterThan"
greater_than_or_equal = "GreaterThanOrEqual"


class PostArgsOperator(str, Enum):

any = "Any"
equal = "Equal"
contains = "Contains"
begins_with = "BeginsWith"
ends_with = "EndsWith"
less_than = "LessThan"
less_than_or_equal = "LessThanOrEqual"
greater_than = "GreaterThan"
greater_than_or_equal = "GreaterThanOrEqual"


class RequestUriOperator(str, Enum):

any = "Any"
equal = "Equal"
contains = "Contains"
begins_with = "BeginsWith"
ends_with = "EndsWith"
less_than = "LessThan"
less_than_or_equal = "LessThanOrEqual"
greater_than = "GreaterThan"
greater_than_or_equal = "GreaterThanOrEqual"


class RequestHeaderOperator(str, Enum):

any = "Any"
equal = "Equal"
contains = "Contains"
begins_with = "BeginsWith"
ends_with = "EndsWith"
less_than = "LessThan"
less_than_or_equal = "LessThanOrEqual"
greater_than = "GreaterThan"
greater_than_or_equal = "GreaterThanOrEqual"


class RequestBodyOperator(str, Enum):

any = "Any"
equal = "Equal"
contains = "Contains"
begins_with = "BeginsWith"
ends_with = "EndsWith"
less_than = "LessThan"
less_than_or_equal = "LessThanOrEqual"
greater_than = "GreaterThan"
greater_than_or_equal = "GreaterThanOrEqual"


class UrlPathOperator(str, Enum):

any = "Any"
equal = "Equal"
contains = "Contains"
begins_with = "BeginsWith"
ends_with = "EndsWith"
less_than = "LessThan"
less_than_or_equal = "LessThanOrEqual"
greater_than = "GreaterThan"
greater_than_or_equal = "GreaterThanOrEqual"
wildcard = "Wildcard"


class UrlFileExtensionOperator(str, Enum):

any = "Any"
equal = "Equal"
contains = "Contains"
begins_with = "BeginsWith"
ends_with = "EndsWith"
less_than = "LessThan"
less_than_or_equal = "LessThanOrEqual"
greater_than = "GreaterThan"
greater_than_or_equal = "GreaterThanOrEqual"


class UrlFileNameOperator(str, Enum):

any = "Any"
equal = "Equal"
contains = "Contains"
begins_with = "BeginsWith"
ends_with = "EndsWith"
less_than = "LessThan"
less_than_or_equal = "LessThanOrEqual"
greater_than = "GreaterThan"
greater_than_or_equal = "GreaterThanOrEqual"


class RedirectType(str, Enum):

moved = "Moved"
found = "Found"
temporary_redirect = "TemporaryRedirect"
permanent_redirect = "PermanentRedirect"


class DestinationProtocol(str, Enum):

match_request = "MatchRequest"
http = "Http"
https = "Https"


class HeaderAction(str, Enum):

append = "Append"
overwrite = "Overwrite"
delete = "Delete"


class CacheBehavior(str, Enum):

bypass_cache = "BypassCache"
override = "Override"
set_if_missing = "SetIfMissing"


class OriginResourceState(str, Enum):

creating = "Creating"
Expand Down
Loading