Skip to content

Commit 382ba61

Browse files
Added examples for WAF create and update
1 parent 47194b8 commit 382ba61

2 files changed

Lines changed: 12 additions & 16 deletions

File tree

src/nginx/azext_nginx/_help.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,3 @@
99
# pylint: disable=too-many-lines
1010

1111
from knack.help_files import helps # pylint: disable=unused-import
12-
13-
helps['nginx deployment waf-policy create'] = """
14-
type: command
15-
short-summary: Create a WAF policy for an nginx deployment.
16-
examples:
17-
- name: Create a default WAF policy
18-
text: az nginx deployment waf-policy create --name mypolicyname --deployment-name mydeploymentname --resource-group myresourcegroupname --filepath /path/to/my/policy.json --content mycontentfileinbase64encoding
19-
"""
20-
21-
helps['nginx deployment waf-policy update'] = """
22-
type: command
23-
short-summary: Update a WAF policy for an nginx deployment.
24-
examples:
25-
- name: Update a default WAF policy
26-
text: az nginx deployment waf-policy update --name mypolicyname --deployment-name mydeploymentname --resource-group myresourcegroupname --filepath /path/to/my/policy.json --content mycontentfileinbase64encoding
27-
"""

src/nginx/azext_nginx/commands.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@ def load_command_table(self, _): # pylint: disable=unused-argument
99
with self.command_group('nginx deployment configuration'):
1010
from .custom import ConfigurationUpdate
1111
self.command_table["nginx deployment configuration update"] = ConfigurationUpdate(loader=self)
12+
13+
with self.command_group('nginx deployment waf-policy') as g:
14+
g.command('create', 'create_waf_policy', examples=[
15+
{'name': 'Create a WAF policy',
16+
'text': 'az nginx deployment waf-policy create --name mypolicyname --deployment-name mydeploymentname --resource-group myresourcegroupname --filepath /path/to/my/policy.json --content mycontentfileinbase64encoding'}
17+
])
18+
19+
with self.command_group('nginx deployment waf-policy') as g:
20+
g.command('update', 'update_waf_policy', examples=[
21+
{'name': 'Update a WAF policy',
22+
'text': 'az nginx deployment waf-policy update --name mypolicyname --deployment-name mydeploymentname --resource-group myresourcegroupname --filepath /path/to/my/policy.json --content mycontentfileinbase64encoding'}
23+
])

0 commit comments

Comments
 (0)