Skip to content

Commit 6443216

Browse files
authored
[Network] az network application-gateway waf-policy managed-rule rule-set add/update: Support sensitivity for --rule parameter (Azure#30079)
* update recording * codegen * update command err msg, fix test * add sensitivity param
1 parent 3c29c45 commit 6443216

34 files changed

+6297
-4519
lines changed

src/azure-cli/azure/cli/command_modules/network/_actions.py

+2
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use
183183
d['action'] = v[0]
184184
elif kl == 'state':
185185
d['state'] = v[0]
186+
elif kl == 'sensitivity':
187+
d['sensitivity'] = v[0]
186188
else:
187189
raise UnrecognizedArgumentError('key error: key must be one of rule-id, action and state.')
188190
return d

src/azure-cli/azure/cli/command_modules/network/_help.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,8 @@
15351535
- name: --rule
15361536
short-summary: The rule that will be disabled. If none specified, all rules in the group will be disabled. If provided, --group-name must be provided too.
15371537
long-summary: |
1538-
Usage: --rule rule-id=MyID state=MyState action=MyAction
1538+
Usage: --rule rule-id=MyID state=MyState action=MyAction sensitivity=MySensitivity
1539+
Allowed values for sensitivity: High, Medium, Low, None
15391540
Multiple rules can be specified by using more than one `--rule` argument.
15401541
examples:
15411542
- name: Disable an attack protection rule
@@ -1557,7 +1558,8 @@
15571558
- name: --rule
15581559
short-summary: The rule that will be disabled. If none specified, all rules in the group will be disabled. If provided, --group-name must be provided too.
15591560
long-summary: |
1560-
Usage: --rule rule-id=MyID state=MyState action=MyAction
1561+
Usage: --rule rule-id=MyID state=MyState action=MyAction sensitivity=MySensitivity
1562+
Allowed values for sensitivity: High, Medium, Low, None
15611563
Multiple rules can be specified by using more than one `--rule` argument.
15621564
examples:
15631565
- name: Override rules under rule group EQUEST-921-PROTOCOL-ATTACK

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/application_gateway/waf_config/_list_rule_sets.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class ListRuleSets(AAZCommand):
3131
"""
3232

3333
_aaz_info = {
34-
"version": "2023-11-01",
34+
"version": "2024-03-01",
3535
"resources": [
36-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/applicationgatewayavailablewafrulesets", "2023-11-01"],
36+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/applicationgatewayavailablewafrulesets", "2024-03-01"],
3737
]
3838
}
3939

@@ -110,7 +110,7 @@ def url_parameters(self):
110110
def query_parameters(self):
111111
parameters = {
112112
**self.serialize_query_param(
113-
"api-version", "2023-11-01",
113+
"api-version", "2024-03-01",
114114
required=True,
115115
),
116116
}
@@ -207,6 +207,7 @@ def _build_schema_on_200(cls):
207207
_element.rule_id_string = AAZStrType(
208208
serialized_name="ruleIdString",
209209
)
210+
_element.sensitivity = AAZStrType()
210211
_element.state = AAZStrType()
211212

212213
tiers = cls._schema_on_200.value.Element.properties.tiers

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/application_gateway/waf_policy/_create.py

+315-68
Large diffs are not rendered by default.

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/application_gateway/waf_policy/_delete.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class Delete(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2023-11-01",
25+
"version": "2024-03-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationgatewaywebapplicationfirewallpolicies/{}", "2023-11-01"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationgatewaywebapplicationfirewallpolicies/{}", "2024-03-01"],
2828
]
2929
}
3030

@@ -145,7 +145,7 @@ def url_parameters(self):
145145
def query_parameters(self):
146146
parameters = {
147147
**self.serialize_query_param(
148-
"api-version", "2023-11-01",
148+
"api-version", "2024-03-01",
149149
required=True,
150150
),
151151
}

0 commit comments

Comments
 (0)