Skip to content

Commit 8be8a91

Browse files
committed
add examples
1 parent 8216a3f commit 8be8a91

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

src/front-door/azext_front_door/_help.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
helps['network front-door create'] = """
1717
type: command
1818
short-summary: Create a Front Door.
19+
examples:
20+
- name: Create a Front Door.
21+
text: az network front-door create -g rg -n frontdoor --backend-address 202.120.2.3
1922
"""
2023

2124
helps['network front-door list'] = """
@@ -69,6 +72,9 @@
6972
Since a backend pool must contain a backend, this command
7073
also creates the first backend. To add additional backends,
7174
use the `az network front-door backend-pool backend add` command.
75+
examples:
76+
- name: Create a Front Door backend pool.
77+
text: az network front-door backend-pool create -f frontdoor -g rg -n bkp1 --address 202.120.2.3 --load-balancing DefaultLoadBalancingSettings --probe DefaultProbeSettings
7278
"""
7379

7480
helps['network front-door backend-pool list'] = """
@@ -96,6 +102,9 @@
96102
helps['network front-door backend-pool backend add'] = """
97103
type: command
98104
short-summary: Add a backend to a Front Door backend pool.
105+
examples:
106+
- name: Add a backend to a Front Door backend pool.
107+
text: az network front-door backend-pool backend add -g rg --front-door-name myfrontdoor --pool-name pool --address 202.120.2.3 --backend-host-header "" --disabled true --http-port 80 --https-port 443 --priority 2 --weight 1
99108
"""
100109

101110
helps['network front-door backend-pool backend update'] = """
@@ -123,6 +132,9 @@
123132
helps['network front-door frontend-endpoint create'] = """
124133
type: command
125134
short-summary: Create a Front Door frontend endpoint.
135+
examples:
136+
- name: Create a Front Door frontend endpoint.
137+
text: az network front-door frontend-endpoint create -g rg -f frontdoor -n endpoint --host-name www.contoso.com --session-affinity-enabled
126138
"""
127139

128140
helps['network front-door frontend-endpoint list'] = """
@@ -171,6 +183,9 @@
171183
helps['network front-door load-balancing create'] = """
172184
type: command
173185
short-summary: Create Front Door load-balancing settings.
186+
examples:
187+
- name: Create Front Door load-balancing settings.
188+
text: az network front-door load-balancing create -f frontdoor -g rg -n lb --sample-size 5 --successful-samples-required 1 --additional-latency 100
174189
"""
175190

176191
helps['network front-door load-balancing list'] = """
@@ -203,6 +218,9 @@
203218
helps['network front-door probe create'] = """
204219
type: command
205220
short-summary: Create Front Door health probe settings.
221+
examples:
222+
- name: Create Front Door health probe settings.
223+
text: az network front-door probe create -f frontdoor -g rg -n pb --interval 100 --path /abc --enabled Disabled --probeMethod GET --protocol Http
206224
"""
207225

208226
helps['network front-door probe list'] = """
@@ -289,6 +307,9 @@
289307
This command allows creating Rules Engine configuration with Header
290308
action type. To add additional actions like Route overrides,
291309
use the `az network front-door rules-engine rule action add` command.
310+
examples:
311+
- name: Create a Rules Engine rule for a Front Door.
312+
text: az network front-door rules-engine rule create -f frontdoor -g rg --rules-engine-name rulesengine --name rule --priority 2 --action-type ResponseHeader --header-action Append --header-name Security --header-value Strict --match-variable RequestPath --operator Contains --match-values private
292313
"""
293314

294315
helps['network front-door rules-engine rule update'] = """
@@ -319,6 +340,9 @@
319340
helps['network front-door rules-engine rule action add'] = """
320341
type: command
321342
short-summary: Add an action to a Rules Engine rule.
343+
examples:
344+
- name: Add an action to a Rules Engine rule.
345+
text: az network front-door rules-engine rule action add -f frontdoor -g rg -r rulesengine --name rule1 --action-type RedirectRouteOverride --custom-path /redirect
322346
"""
323347

324348
helps['network front-door rules-engine rule action list'] = """
@@ -339,6 +363,9 @@
339363
helps['network front-door rules-engine rule condition add'] = """
340364
type: command
341365
short-summary: Add a match condition to a Rules Engine rule.
366+
examples:
367+
- name: Add a match condition to a Rules Engine rule.
368+
text: az network front-door rules-engine rule condition add -f frontdoor -g rg -r rulesengine --name rule1 --match-variable RequestPath --operator Any
342369
"""
343370

344371
helps['network front-door rules-engine rule condition list'] = """
@@ -361,6 +388,9 @@
361388
helps['network front-door waf-policy create'] = """
362389
type: command
363390
short-summary: Create a WAF policy.
391+
examples:
392+
- name: Create a WAF policy.
393+
text: az network front-door waf-policy create -g rg -n policy --mode prevention
364394
"""
365395

366396
helps['network front-door waf-policy list'] = """
@@ -409,6 +439,9 @@
409439
Variable allowed values: {variables}
410440
411441
Operator allowed values: {operators}
442+
examples:
443+
- name: Add a match-condition to a WAF policy custom rule.
444+
text: az network front-door waf-policy rule match-condition add -g rg --policy-name policy -n custom1 --match-variable RequestBody --operator RegEx --values "hello"
412445
""".format(
413446
variables=', '.join([x.value for x in MatchVariable]),
414447
operators=', '.join([x.value for x in Operator])
@@ -459,6 +492,9 @@
459492
short-summary: Add a managed rule set to a WAF policy.
460493
long-summary: >
461494
Use 'az network front-door waf-policy managed-rule-definition list' to see the available managed rulesets.
495+
examples:
496+
- name: Add a managed rule set to a WAF policy.
497+
text: az network front-door waf-policy managed-rules add -g rg --policy-name policy1 --type DefaultRuleSet --version 1.0
462498
"""
463499

464500
helps['network front-door waf-policy managed-rules remove'] = """
@@ -471,6 +507,9 @@
471507
short-summary: Add an override on a managed rule within a managed rule set.
472508
long-summary: >
473509
Use 'az network front-door waf-policy managed-rule-definition list' to see the available rules.
510+
example:
511+
- name: Add an override on a managed rule within a managed rule set.
512+
text: az network front-door waf-policy managed-rules override add -g rg --policy-name policy1 --type DefaultRuleSet --rule-group-id SQLI --rule-id id --action Block --disabled
474513
"""
475514

476515
helps['network front-door waf-policy managed-rules override remove'] = """
@@ -499,6 +538,9 @@
499538
long-summary: >
500539
Prevents the rule set, rule group, or rule from being applied to the content of the specified variable.
501540
Use 'az network front-door waf-policy managed-rule-definition list' to see the available rules.
541+
examples:
542+
- name: Add an exclusion on a managed rule set, rule group, or rule within a managed rule set.
543+
text: az network front-door waf-policy managed-rules exclusion add -g rg --policy-name policy1 --type DefaultRuleSet --match-variable RequestHeaderNames --operator Contains --value ignoreme
502544
"""
503545

504546
helps['network front-door waf-policy managed-rules exclusion remove'] = """

0 commit comments

Comments
 (0)