-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[CDN] Add support for Rules engine feature #11854
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
Changes from 5 commits
5e06fed
ee69967
fccbe22
8c9563d
f08caf9
37f4c99
292b5da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ def get_origin(self, values, option_string): | |
| return deep_created_origin | ||
|
|
||
|
|
||
| # pylint:disable=too-many-statements | ||
| def load_arguments(self, _): | ||
|
|
||
| name_arg_type = CLIArgumentType(options_list=('--name', '-n'), metavar='NAME') | ||
|
|
@@ -82,6 +83,60 @@ def load_arguments(self, _): | |
| c.argument('content_types_to_compress', nargs='+') | ||
| c.argument('profile_name', help=profile_name_help, id_part='name') | ||
|
|
||
| with self.argument_context('cdn endpoint rule') as c: | ||
| c.argument('rule_name', help='Name of the rule.') | ||
| c.argument('order', help='The order of the rule. The order number must start from 0 and consecutive.\ | ||
| Rule with higher order will be applied later.') | ||
| c.argument('match_variable', arg_group="Match Condition", help='Name of the match condition.') | ||
| c.argument('operator', arg_group="Match Condition", help='Operator of the match condition.') | ||
| c.argument('selector', arg_group="Match Condition", help='Selector of the match condition.') | ||
| c.argument('match_values', arg_group="Match Condition", nargs='+', | ||
| help='Match values of the match condition (comma separated).') | ||
| c.argument('transform', arg_group="Match Condition", arg_type=get_enum_type(['Lowercase', 'Uppercase']), | ||
| nargs='+', help='Transform to apply before matching.') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you support multiple values like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you still support list of arguments like |
||
| c.argument('negate_condition', arg_group="Match Condition", arg_type=get_three_state_flag(), | ||
| help='If true, negates the condition') | ||
| c.argument('action_name', arg_group="Action", help='Name of the action.') | ||
| c.argument('cache_behavior', arg_group="Action", | ||
| arg_type=get_enum_type(['BypassCache', 'Override', 'SetIfMissing']), | ||
| help='Caching behavior for the requests.') | ||
| c.argument('cache_duration', arg_group="Action", | ||
| help='The duration for which the content needs to be cached. \ | ||
| Allowed format is [d.]hh:mm:ss.') | ||
| c.argument('header_action', arg_group="Action", | ||
| arg_type=get_enum_type(['Append', 'Overwrite', 'Delete']), | ||
| help='Header action for the requests.') | ||
| c.argument('header_name', arg_group="Action", help='Name of the header to modify.') | ||
| c.argument('header_value', arg_group="Action", help='Value of the header.') | ||
| c.argument('redirect_type', arg_group="Action", | ||
| arg_type=get_enum_type(['Moved', 'Found', 'TemporaryRedirect', 'PermanentRedirect']), | ||
| help='The redirect type the rule will use when redirecting traffic.') | ||
| c.argument('redirect_protocol', arg_group="Action", | ||
| arg_type=get_enum_type(['MatchRequest', 'Http', 'Https']), | ||
| help='Protocol to use for the redirect.') | ||
| c.argument('custom_hostname', arg_group="Action", help='Host to redirect. \ | ||
| Leave empty to use the incoming host as the destination host.') | ||
| c.argument('custom_path', arg_group="Action", | ||
| help='The full path to redirect. Path cannot be empty and must start with /. \ | ||
| Leave empty to use the incoming path as destination path.') | ||
| c.argument('custom_querystring', arg_group="Action", | ||
| help='The set of query strings to be placed in the redirect URL. \ | ||
| leave empty to preserve the incoming query string.') | ||
| c.argument('custom_fragment', arg_group="Action", help='Fragment to add to the redirect URL.') | ||
| c.argument('query_string_behavior', arg_group="Action", | ||
| arg_type=get_enum_type(['Include', 'IncludeAll', 'Exclude', 'ExcludeAll']), | ||
| help='Query string behavior for the requests.') | ||
| c.argument('query_parameters', arg_group="Action", | ||
| help='Query parameters to include or exclude (comma separated).') | ||
| c.argument('source_pattern', arg_group="Action", | ||
| help='A request URI pattern that identifies the type of requests that may be rewritten.') | ||
| c.argument('destination', help='The destination path to be used in the rewrite.') | ||
| c.argument('preserve_unmatched_path', arg_group="Action", | ||
| arg_type=get_three_state_flag(), | ||
| help='If True, the remaining path after the source \ | ||
| pattern will be appended to the new destination path.') | ||
| c.argument('index', type=int, help='The index of the condition/action') | ||
|
|
||
| with self.argument_context('cdn endpoint create') as c: | ||
| c.argument('name', name_arg_type, id_part='name', help='Name of the CDN endpoint.') | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.