Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
783355f
add rulesEngine support
hytao Dec 31, 2019
1b43539
Fix typo in `KeyVaultMgmtScenarioTest` (#11722)
bim-msft Dec 31, 2019
cbacc40
[General][Minor]Update Code Onwers (#11705)
mmyyrroonn Dec 31, 2019
fc532b4
[Compute][Feature]az vm create: Support default data source settings …
mmyyrroonn Dec 31, 2019
1c88592
[RecoveryServices Backup]Added disk exclusion Feature for IAASVM (#11…
Jan 2, 2020
b1db572
fix typo in authoring_commands.md (#11730)
Jan 2, 2020
24c48b3
update codeowner for resource (#11739)
Juliehzl Jan 2, 2020
7afe0b8
Fix the test of test_managedapp (#11727)
zhoxing-ms Jan 2, 2020
cece44d
Fix the test of test_resource_policyset (#11723)
zhoxing-ms Jan 2, 2020
7565b12
add libc6-compat in dockerfile (#11742)
fengzhou-msft Jan 2, 2020
dfb9b34
Update Cosmos DB python package (#11551)
shurd Jan 2, 2020
594f6a0
[AppConfig] Adding new command 'set-keyvault' to kv subgroup (#11571)
avanigupta Jan 2, 2020
591db0d
Merge hotfix for version color into dev (#11741)
fengzhou-msft Jan 2, 2020
2de9058
[AppConfig] Support Import/Export of features in yaml files (#11637)
avanigupta Jan 3, 2020
71a4ff6
[App Service] Add az webapp up flag for HTML static sites (#11719)
ammanifold Jan 3, 2020
8ded942
udpate
Jan 3, 2020
1ebd51a
udpate changelog
Jan 3, 2020
a96aad8
update params.py
Jan 3, 2020
9152d87
update
Jan 3, 2020
c8b028d
[Compute] Feature issue #11203 Add new reapply command action for az …
arrownj Jan 3, 2020
585eb06
Added new parameters for account blob service properties to manage de…
zhoxing-ms Jan 3, 2020
4d684d2
[misc] Add 'az version' (#11680)
jiasli Jan 3, 2020
cae1b8f
update
Jan 3, 2020
0346d31
Removing ReceiveDisabled status from EventHub and ServiceBus CLI doc …
basilhariri Jan 3, 2020
85f04e7
[RBAC] Return exit code 3 if app or sp doesn't exist (#11725)
jiasli Jan 3, 2020
8213288
update azure-cli version to 2.0.79 (#11762)
Jan 3, 2020
dc0e83d
update history
Jan 3, 2020
0d0937f
fix params
Jan 3, 2020
ca85d63
retry CI
Jan 3, 2020
bfbb4b2
add codeonwer for sql (#11777)
Juliehzl Jan 6, 2020
7391ca4
fix: az monitor metric alert create. Fix test failure. (#11776)
mmyyrroonn Jan 6, 2020
fd1c960
updating BYOS commands to mark them as preview (#11755)
btardif Jan 6, 2020
ad8d70f
Fix: tox can use ADO default Python 2.7 (#11802)
Jan 9, 2020
347caa7
python3.8 migration for homebrew (#11803)
fengzhou-msft Jan 10, 2020
ab8b7df
[Storage] Support Table and Queue Encryption Service for storage acco…
Juliehzl Jan 10, 2020
7bb6319
update CODEOWNERS (#11814)
Juliehzl Jan 10, 2020
bf60878
[Webapp] Adding E2E tests for az webapp up (#11774)
panchagnula Jan 10, 2020
ddf6f45
[Doc] Try new features before release (#11784)
qwordy Jan 10, 2020
ce44655
Chore: move CredScansuppressions.json to codeownder guarded folder (#…
Jan 10, 2020
ec3f1cb
[Compute] disk update: Add --disk-encryption-set and --encryption-typ…
qwordy Jan 12, 2020
16d6ebf
[AKS] Update example help text to reflect change of defaults to Stand…
seanmck Jan 13, 2020
cde7498
Upgrade to Azure CLI 2.0.80 (#11826)
Jan 13, 2020
ac278b9
Add table output to backup commands (#11764)
Jan 13, 2020
bcf9c48
Fix typo in History.rst (#11835)
ankitkumarr Jan 14, 2020
51e26fa
[IoT Central] Add new sku name to iotcentral (#11810)
poanchen Jan 14, 2020
d369f9e
[Core] Expose example_provider hook to include AI examples (#10987)
mirdaki Jan 14, 2020
3a40b9f
fix: enabling monitoring for OpenShift managed cluster (#11778)
ganga1980 Jan 14, 2020
9629542
Update fedora install troubleshooting doc (#11827)
fengzhou-msft Jan 14, 2020
d735dbf
Fix: 'az redis update' operation for RDB/AOF enabled redis caches (#1…
MECHANDR Jan 14, 2020
0b41c91
Chore: disable CredScan job temporary for ADO security concern (#11844)
Jan 14, 2020
496f78d
add rulesEngine support
hytao Dec 31, 2019
ca4536a
udpate
Jan 3, 2020
8a6d577
udpate changelog
Jan 3, 2020
55a0994
update params.py
Jan 3, 2020
4aac0b4
update
Jan 3, 2020
8347cc8
update
Jan 3, 2020
487f5df
update history
Jan 3, 2020
ddacc2a
fix params
Jan 3, 2020
479f362
retry CI
Jan 3, 2020
0537052
update
Jan 14, 2020
4209ffd
Merge branch 'rulesEngine2' of https://github.com/hytao/azure-cli int…
Jan 14, 2020
9cdc78e
add rulesEngine support
hytao Dec 31, 2019
1b6f7f6
udpate
Jan 3, 2020
b1efd26
udpate changelog
Jan 3, 2020
706b2a0
update params.py
Jan 3, 2020
e691ffb
update
Jan 3, 2020
150d1ac
update
Jan 3, 2020
c3ee609
update history
Jan 3, 2020
75a22b5
fix params
Jan 3, 2020
7360ba2
retry CI
Jan 3, 2020
95be9d7
add rulesEngine support
hytao Dec 31, 2019
25f5404
update
Jan 14, 2020
5adaf2f
a
Jan 14, 2020
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
5 changes: 5 additions & 0 deletions src/azure-cli/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ Release History
* Fix `vm create` failure in Azure Stack profile.
* vm monitor metrics tail/list-definitions: support query metric and list definitions for a vm.

**Cdn**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your history is very stale. pls run git rebase dev for your branch to update

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created new PR to fix the versioning issue.


* Add support for rulesEngine feature
* Update azure-mgmt-cdn version to 4.0.0 to use api version 2019-04-15

**Storage**

* `az storage account create`: Remove preview flag for --enable-hierarchical-namespace parameter
Expand Down
110 changes: 110 additions & 0 deletions src/azure-cli/azure/cli/command_modules/cdn/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,116 @@
--enable-compression
"""

helps['cdn endpoint rule'] = """
type: group
short-summary: Manage delivery rules for an endpoint.
"""

helps['cdn endpoint rule add'] = """
type: command
short-summary: Add a delivery rule to a CDN endpoint.
examples:
- name: Create a global rule to disable caching.
text: >
az cdn endpoint rule add -g group -n endpoint --profile-name profile --order 0\\
--rule-name global --action-name CacheExpiration --cache-behavior BypassCache
- name: Create a rule for http to https redirect
text: >
az cdn endpoint rule add -g group -n endpoint --profile-name profile --order 1\\
--rule-name "redirect" --match-variable RequestScheme --operator Equal --match-values HTTPS\\
--action-name "UrlRedirect" --redirect-protocol Https --redirect-type Moved
"""

helps['cdn endpoint rule remove'] = """
type: command
short-summary: Remove a delivery rule from an endpoint.
examples:
- name: Remove the global rule.
text: >
az cdn endpoint rule remove -g group -n endpoint --profile-name profile --rule-name Global\\
"""

helps['cdn endpoint rule show'] = """
type: command
short-summary: Show delivery rules asscociate with the endpoint.
examples:
- name: show delivery rules asscociate with the endpoint.
text: >
az cdn endpoint rule show -g group --profile-name profile-name
"""

helps['cdn endpoint rule condition'] = """
type: group
short-summary: Manage delivery rule conditions for an endpoint.
"""

helps['cdn endpoint rule condition add'] = """
type: command
short-summary: Add a condition to a delivery rule.
examples:
- name: Add a remote address condition.
text: >
az cdn endpoint rule condition add -g group -n endpoint --profile-name profile --rule-name name\\
--match-variable RemoteAddress --operator GeoMatch --match-values "TH"
"""

helps['cdn endpoint rule condition remove'] = """
type: command
short-summary: Remove a condition from a delivery rule.
examples:
- name: Remove the first condition.
text: >
az cdn endpoint rule condition remove -g group -n endpoint --profile-name profile --rule-name name\\
--index 0
"""

helps['cdn endpoint rule condition show'] = """
type: command
short-summary: show delivery rules asscociate with the endpoint.
examples:
- name: show delivery rules asscociate with the endpoint.
text: >
az cdn endpoint rule condition show -g group --profile-name profile-name
"""

helps['cdn endpoint rule action'] = """
type: group
short-summary: Manage delivery rule actions for an endpoint.
"""

helps['cdn endpoint rule action add'] = """
type: command
short-summary: Add an action to a delivery rule.
examples:
- name: Add a redirect action.
text: >
az cdn endpoint rule action add -g group -n endpoint --profile-name profile --rule-name name\\
--action-name "UrlRedirect" --redirect-protocol HTTPS --redirect-type Moved
- name: Add a cache expiration action
text: >
az cdn endpoint rule action add -g group -n endpoint --profile-name profile --rule-name name\\
--action-name "CacheExpiration" --cache-behavior BypassCache
"""

helps['cdn endpoint rule action remove'] = """
type: command
short-summary: Remove an action from a delivery rule.
examples:
- name: Remove the first action.
text: >
az cdn endpoint rule action remove -g group -n endpoint --profile-name profile --rule-name name\\
--index 0
"""

helps['cdn endpoint rule action show'] = """
type: command
short-summary: show delivery rules asscociate with the endpoint.
examples:
- name: show delivery rules asscociate with the endpoint.
text: >
az cdn endpoint rule action show -g group --profile-name profile-name
"""

helps['cdn origin'] = """
type: group
short-summary: List or show existing origins related to CDN endpoints.
Expand Down
45 changes: 45 additions & 0 deletions src/azure-cli/azure/cli/command_modules/cdn/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -82,6 +83,50 @@ 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', help='Name of the match condition.')
c.argument('operator', help='Operator of the match condition.')
c.argument('selector', help='Selector of the match condition.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you group these parameters using arg_group="Match Condition"?

c.argument('match_values', help='Match values of the match condition (comma separated).')
c.argument('transform', arg_type=get_enum_type(['Lowercase', 'Uppercase']),
help='Transform to apply before matching.')
c.argument('negate_condition', arg_type=get_three_state_flag(), options_list='--negate-condition',
help='If true, negates the condition')
c.argument('action_name', help='Name of the action.')
c.argument('cache_behavior', arg_type=get_enum_type(['BypassCache', 'Override', 'SetIfMissing']),
help='Caching behavior for the requests.')
c.argument('cache_duration', help='The duration for which the content needs to be cached. \
Allowed format is [d.]hh:mm:ss.')
c.argument('header_action', arg_type=get_enum_type(['Append', 'Overwrite', 'Delete']),
help='Header action for the requests.')
c.argument('header_name', help='Name of the header to modify.')
c.argument('header_value', help='Value of the header.')
c.argument('redirect_type',
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_type=get_enum_type(['MatchRequest', 'Http', 'Https']),
help='Protocol to use for the redirect. Possible values are MatchRequest, Http, Https.')
c.argument('custom_hostname', help='Host to redirect. \
Leave empty to use the incoming host as the destination host.')
c.argument('custom_path', 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', 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', help='Fragment to add to the redirect URL.')
c.argument('query_string_behavior', arg_type=get_enum_type(['Include', 'IncludeAll', 'Exclude', 'ExcludeAll']),
help='Query string behavior for the requests.')
c.argument('query_parameters', help='Query parameters to include or exclude (comma separated).')
c.argument('source_pattern', 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_type=get_three_state_flag(), options_list='--preserve-unmatched-path',
help='If True, the remaining path after the source \
pattern will be appended to the new destination path.')
c.argument('index', 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.')

Expand Down
34 changes: 34 additions & 0 deletions src/azure-cli/azure/cli/command_modules/cdn/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
cf_edge_nodes)


# pylint: disable=too-many-statements
def load_command_table(self, _):

def _not_found(message):
Expand Down Expand Up @@ -91,6 +92,39 @@ def _inner_not_found(ex):
doc_string_source='azure.mgmt.cdn.models#EndpointUpdateParameters',
supports_no_wait=True)

with self.command_group('cdn endpoint rule', cdn_endpoints_sdk) as g:
g.show_command('show', 'get')
g.generic_update_command('add', setter_name='update', setter_arg_name='endpoint_update_properties',
custom_func_name='add_rule',
doc_string_source='azure.mgmt.cdn.models#EndpointUpdateParameters',
supports_no_wait=True)
g.generic_update_command('remove', setter_name='update', setter_arg_name='endpoint_update_properties',
custom_func_name='remove_rule',
doc_string_source='azure.mgmt.cdn.models#EndpointUpdateParameters',
supports_no_wait=True)

with self.command_group('cdn endpoint rule condition', cdn_endpoints_sdk) as g:
g.show_command('show', 'get')
g.generic_update_command('add', setter_name='update', setter_arg_name='endpoint_update_properties',
custom_func_name='add_condition',
doc_string_source='azure.mgmt.cdn.models#EndpointUpdateParameters',
supports_no_wait=True)
g.generic_update_command('remove', setter_name='update', setter_arg_name='endpoint_update_properties',
custom_func_name='remove_condition',
doc_string_source='azure.mgmt.cdn.models#EndpointUpdateParameters',
supports_no_wait=True)

with self.command_group('cdn endpoint rule action', cdn_endpoints_sdk) as g:
g.show_command('show', 'get')
g.generic_update_command('add', setter_name='update', setter_arg_name='endpoint_update_properties',
custom_func_name='add_action',
doc_string_source='azure.mgmt.cdn.models#EndpointUpdateParameters',
supports_no_wait=True)
g.generic_update_command('remove', setter_name='update', setter_arg_name='endpoint_update_properties',
custom_func_name='remove_action',
doc_string_source='azure.mgmt.cdn.models#EndpointUpdateParameters',
supports_no_wait=True)

with self.command_group('cdn profile', cdn_profiles_sdk) as g:
g.show_command('show', 'get')
g.command('usage', 'list_resource_usage')
Expand Down
Loading