Skip to content

Commit 5c7b1d9

Browse files
Firewall Packet Capture Operation Support (#9319)
* Firewall Packet Capture Operation Support * adding recording and updating history/setup * Apply suggestions from code review Making style changes as per pr bot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fixing secrets * redacting secret --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 96267e2 commit 5c7b1d9

File tree

7 files changed

+4617
-13
lines changed

7 files changed

+4617
-13
lines changed

src/azure-firewall/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
2.0.0
7+
++++++
8+
* `az network firewall packet-capture-operation`: Add packet capture operation support for the azure firewall
9+
610
1.5.0
711
++++++
812
* `az network firewall create`: Add parameter `--enable-dnstap-logging`

src/azure-firewall/azext_firewall/aaz/latest/network/firewall/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from ._learned_ip_prefix import *
1515
from ._list import *
1616
from ._list_fqdn_tags import *
17+
from ._packet_capture_operation import *
1718
from ._show import *
1819
from ._update import *
1920
from ._wait import *

src/azure-firewall/azext_firewall/aaz/latest/network/firewall/_list.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
4848

4949
def _execute_operations(self):
5050
self.pre_operations()
51-
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
52-
condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
51+
condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
52+
condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
5353
if condition_0:
54-
self.AzureFirewallsList(ctx=self.ctx)()
55-
if condition_1:
5654
self.AzureFirewallsListAll(ctx=self.ctx)()
55+
if condition_1:
56+
self.AzureFirewallsList(ctx=self.ctx)()
5757
self.post_operations()
5858

5959
@register_callback
@@ -69,7 +69,7 @@ def _output(self, *args, **kwargs):
6969
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
7070
return result, next_link
7171

72-
class AzureFirewallsList(AAZHttpOperation):
72+
class AzureFirewallsListAll(AAZHttpOperation):
7373
CLIENT_TYPE = "MgmtClient"
7474

7575
def __call__(self, *args, **kwargs):
@@ -83,7 +83,7 @@ def __call__(self, *args, **kwargs):
8383
@property
8484
def url(self):
8585
return self.client.format_url(
86-
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls",
86+
"/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls",
8787
**self.url_parameters
8888
)
8989

@@ -98,10 +98,6 @@ def error_format(self):
9898
@property
9999
def url_parameters(self):
100100
parameters = {
101-
**self.serialize_url_param(
102-
"resourceGroupName", self.ctx.args.resource_group,
103-
required=True,
104-
),
105101
**self.serialize_url_param(
106102
"subscriptionId", self.ctx.subscription_id,
107103
required=True,
@@ -488,7 +484,7 @@ def _build_schema_on_200(cls):
488484

489485
return cls._schema_on_200
490486

491-
class AzureFirewallsListAll(AAZHttpOperation):
487+
class AzureFirewallsList(AAZHttpOperation):
492488
CLIENT_TYPE = "MgmtClient"
493489

494490
def __call__(self, *args, **kwargs):
@@ -502,7 +498,7 @@ def __call__(self, *args, **kwargs):
502498
@property
503499
def url(self):
504500
return self.client.format_url(
505-
"/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls",
501+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls",
506502
**self.url_parameters
507503
)
508504

@@ -517,6 +513,10 @@ def error_format(self):
517513
@property
518514
def url_parameters(self):
519515
parameters = {
516+
**self.serialize_url_param(
517+
"resourceGroupName", self.ctx.args.resource_group,
518+
required=True,
519+
),
520520
**self.serialize_url_param(
521521
"subscriptionId", self.ctx.subscription_id,
522522
required=True,

0 commit comments

Comments
 (0)