Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions src/azure-firewall/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
1.4.0
++++++
* `az network firewall create`: Add parameters `--min-capacity` and `--max-capacity` to support autoscale configuration

1.3.0
++++++
* `az network firewall create`: Add parameter `--edge-zone` to support extended location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class Create(AAZCommand):

:example: Create a Basic SKU Firewall with Virtual Hub
az network firewall create -g MyResourceGroup -n MyFirewall --sku AZFW_Hub --tier Basic --vhub MyVHub --public-ip-count 2

:example: Create Azure Firewall With AutoscaleConfiguration
Comment thread
bewatersmsft marked this conversation as resolved.
az network firewall create -g MyResourceGroup -n MyFirewall --min-capacity 4
az network firewall create -g MyResourceGroup -n MyFirewall --min-capacity 10 --max-capacity 10
"""

_aaz_info = {
Expand Down Expand Up @@ -66,10 +70,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.extended_location = AAZObjectArg(
options=["--extended-location"],
help="The extended location of type local virtual network gateway.",
)
_args_schema.location = AAZResourceLocationArg(
help="Resource location.",
fmt=AAZResourceLocationArgFormat(
Expand Down Expand Up @@ -109,23 +109,34 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="Space-separated list of availability zones into which to provision the resource. Allowed values: 1, 2, 3.",
)

extended_location = cls._args_schema.extended_location
extended_location.name = AAZStrArg(
options=["name"],
help="The name of the extended location.",
)
extended_location.type = AAZStrArg(
options=["type"],
help="The type of the extended location.",
enum={"EdgeZone": "EdgeZone"},
)

tags = cls._args_schema.tags
tags.Element = AAZStrArg()

zones = cls._args_schema.zones
zones.Element = AAZStrArg()

# define Arg Group "AutoscaleConfiguration"

_args_schema = cls._args_schema
_args_schema.max_capacity = AAZIntArg(
options=["--max-capacity"],
arg_group="AutoscaleConfiguration",
help="The maximum number of capacity units for this azure firewall. Use null to reset the value to the service default.",
Comment thread
bewatersmsft marked this conversation as resolved.
nullable=True,
fmt=AAZIntArgFormat(
minimum=2,
),
)
_args_schema.min_capacity = AAZIntArg(
options=["--min-capacity"],
arg_group="AutoscaleConfiguration",
help="The minimum number of capacity units for this azure firewall. Use null to reset the value to the service default.",
Comment thread
bewatersmsft marked this conversation as resolved.
nullable=True,
fmt=AAZIntArgFormat(
minimum=2,
),
)

# define Arg Group "HubIpAddresses"

# define Arg Group "Management IP Configuration"
Expand All @@ -151,6 +162,24 @@ def _build_arguments_schema(cls, *args, **kwargs):

# define Arg Group "Parameters"

_args_schema = cls._args_schema
_args_schema.extended_location = AAZObjectArg(
options=["--extended-location"],
arg_group="Parameters",
help="The extended location of type local virtual network gateway.",
)

extended_location = cls._args_schema.extended_location
extended_location.name = AAZStrArg(
options=["name"],
help="The name of the extended location.",
)
extended_location.type = AAZStrArg(
options=["type"],
help="The type of the extended location.",
enum={"EdgeZone": "EdgeZone"},
)

# define Arg Group "Properties"

_args_schema = cls._args_schema
Expand Down Expand Up @@ -351,6 +380,7 @@ def content(self):
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("additionalProperties", AAZDictType, ".additional_properties")
properties.set_prop("autoscaleConfiguration", AAZObjectType)
properties.set_prop("firewallPolicy", AAZObjectType)
properties.set_prop("hubIPAddresses", AAZObjectType)
properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations")
Expand All @@ -363,6 +393,11 @@ def content(self):
if additional_properties is not None:
additional_properties.set_elements(AAZStrType, ".")

autoscale_configuration = _builder.get(".properties.autoscaleConfiguration")
if autoscale_configuration is not None:
autoscale_configuration.set_prop("maxCapacity", AAZIntType, ".max_capacity", typ_kwargs={"nullable": True})
autoscale_configuration.set_prop("minCapacity", AAZIntType, ".min_capacity", typ_kwargs={"nullable": True})

firewall_policy = _builder.get(".properties.firewallPolicy")
if firewall_policy is not None:
firewall_policy.set_prop("id", AAZStrType, ".firewall_policy")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.extended_location = AAZObjectArg(
options=["--extended-location"],
help="The extended location of type local virtual network gateway.",
nullable=True,
)
_args_schema.firewall_policy = AAZStrArg(
options=["--policy", "--firewall-policy"],
help="Name or ID of the firewallPolicy associated with this azure firewall.",
Expand Down Expand Up @@ -85,19 +80,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
nullable=True,
)

extended_location = cls._args_schema.extended_location
extended_location.name = AAZStrArg(
options=["name"],
help="The name of the extended location.",
nullable=True,
)
extended_location.type = AAZStrArg(
options=["type"],
help="The type of the extended location.",
nullable=True,
enum={"EdgeZone": "EdgeZone"},
)

tags = cls._args_schema.tags
tags.Element = AAZStrArg(
nullable=True,
Expand All @@ -108,6 +90,28 @@ def _build_arguments_schema(cls, *args, **kwargs):
nullable=True,
)

# define Arg Group "AutoscaleConfiguration"

_args_schema = cls._args_schema
_args_schema.max_capacity = AAZIntArg(
options=["--max-capacity"],
arg_group="AutoscaleConfiguration",
help="The maximum number of capacity units for this azure firewall. Use null to reset the value to the service default.",
Comment thread
bewatersmsft marked this conversation as resolved.
nullable=True,
fmt=AAZIntArgFormat(
minimum=2,
),
)
_args_schema.min_capacity = AAZIntArg(
options=["--min-capacity"],
arg_group="AutoscaleConfiguration",
help="The minimum number of capacity units for this azure firewall. Use null to reset the value to the service default.",
Comment thread
bewatersmsft marked this conversation as resolved.
nullable=True,
fmt=AAZIntArgFormat(
minimum=2,
),
)

# define Arg Group "HubIpAddresses"

_args_schema = cls._args_schema
Expand All @@ -132,6 +136,27 @@ def _build_arguments_schema(cls, *args, **kwargs):

# define Arg Group "Parameters"

_args_schema = cls._args_schema
_args_schema.extended_location = AAZObjectArg(
options=["--extended-location"],
arg_group="Parameters",
help="The extended location of type local virtual network gateway.",
nullable=True,
)

extended_location = cls._args_schema.extended_location
extended_location.name = AAZStrArg(
options=["name"],
help="The name of the extended location.",
nullable=True,
)
extended_location.type = AAZStrArg(
options=["type"],
help="The type of the extended location.",
nullable=True,
enum={"EdgeZone": "EdgeZone"},
)

# define Arg Group "Properties"

_args_schema = cls._args_schema
Expand Down Expand Up @@ -478,6 +503,7 @@ def _update_instance(self, instance):
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("additionalProperties", AAZDictType, ".additional_properties")
properties.set_prop("autoscaleConfiguration", AAZObjectType)
properties.set_prop("firewallPolicy", AAZObjectType)
properties.set_prop("hubIPAddresses", AAZObjectType)
properties.set_prop("sku", AAZObjectType)
Expand All @@ -488,6 +514,11 @@ def _update_instance(self, instance):
if additional_properties is not None:
additional_properties.set_elements(AAZStrType, ".")

autoscale_configuration = _builder.get(".properties.autoscaleConfiguration")
if autoscale_configuration is not None:
autoscale_configuration.set_prop("maxCapacity", AAZIntType, ".max_capacity", typ_kwargs={"nullable": True})
autoscale_configuration.set_prop("minCapacity", AAZIntType, ".min_capacity", typ_kwargs={"nullable": True})

firewall_policy = _builder.get(".properties.firewallPolicy")
if firewall_policy is not None:
firewall_policy.set_prop("id", AAZStrType, ".firewall_policy")
Expand Down
2 changes: 1 addition & 1 deletion src/azure-firewall/azext_firewall/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"azext.minCliCoreVersion": "2.67.0"
"azext.minCliCoreVersion": "2.75.0"
}
Loading
Loading