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
5 changes: 5 additions & 0 deletions src/network-manager/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Release History
===============
1.3.1
+++++
* Fix argument regex requirement (fix: https://github.com/Azure/azure-rest-api-specs/pull/31130)
* Stable version

1.3.0
+++++
* Add new cmd `az network manager ipam-pool`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command_group(
"network manager ipam-pool",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage IPAM pool with network.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command(
"network manager ipam-pool create",
is_preview=True,
)
class Create(AAZCommand):
"""Create the Pool resource.
Expand All @@ -23,16 +22,17 @@ class Create(AAZCommand):
"""

_aaz_info = {
"version": "2024-01-01-preview",
"version": "2024-05-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools/{}", "2024-01-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools/{}", "2024-05-01"],
]
}

AZ_SUPPORT_NO_WAIT = True

def _handler(self, command_args):
super()._handler(command_args)
self._execute_operations()
return self._output()
return self.build_lro_poller(self._execute_operations, self._output)

_args_schema = None

Expand All @@ -50,15 +50,15 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The name of the network manager.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.pool_name = AAZStrArg(
options=["-n", "--name", "--pool-name"],
help="IP Address Manager Pool resource name.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
Expand Down Expand Up @@ -116,7 +116,7 @@ def _build_arguments_schema(cls, *args, **kwargs):

def _execute_operations(self):
self.pre_operations()
self.IpamPoolsCreate(ctx=self.ctx)()
yield self.IpamPoolsCreate(ctx=self.ctx)()
self.post_operations()

@register_callback
Expand All @@ -137,8 +137,24 @@ class IpamPoolsCreate(AAZHttpOperation):
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200, 201]:
return self.on_200_201(session)
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)

return self.on_error(session.http_response)

Expand Down Expand Up @@ -183,7 +199,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-01-01-preview",
"api-version", "2024-05-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command(
"network manager ipam-pool delete",
is_preview=True,
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
Expand All @@ -24,9 +23,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2024-01-01-preview",
"version": "2024-05-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools/{}", "2024-01-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools/{}", "2024-05-01"],
]
}

Expand All @@ -53,7 +52,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.pool_name = AAZStrArg(
Expand All @@ -62,7 +61,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
Expand Down Expand Up @@ -160,7 +159,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-01-01-preview",
"api-version", "2024-05-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command(
"network manager ipam-pool get-pool-usage",
is_preview=True,
)
class GetPoolUsage(AAZCommand):
"""Get the Pool Usage.
Expand All @@ -23,9 +22,9 @@ class GetPoolUsage(AAZCommand):
"""

_aaz_info = {
"version": "2024-01-01-preview",
"version": "2024-05-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools/{}/getpoolusage", "2024-01-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools/{}/getpoolusage", "2024-05-01"],
]
}

Expand All @@ -51,7 +50,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.pool_name = AAZStrArg(
Expand All @@ -60,7 +59,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
Expand Down Expand Up @@ -137,7 +136,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-01-01-preview",
"api-version", "2024-05-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command(
"network manager ipam-pool list",
is_preview=True,
)
class List(AAZCommand):
"""List list of Pool resources at Network Manager level.
Expand All @@ -23,9 +22,9 @@ class List(AAZCommand):
"""

_aaz_info = {
"version": "2024-01-01-preview",
"version": "2024-05-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools", "2024-01-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools", "2024-05-01"],
]
}

Expand All @@ -51,7 +50,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The name of the network manager.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
Expand Down Expand Up @@ -162,7 +161,7 @@ def query_parameters(self):
"top", self.ctx.args.top,
),
**self.serialize_query_param(
"api-version", "2024-01-01-preview",
"api-version", "2024-05-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command(
"network manager ipam-pool list-associated-resource",
is_preview=True,
)
class ListAssociatedResource(AAZCommand):
"""List Associated Resource in the Pool.
Expand All @@ -23,9 +22,9 @@ class ListAssociatedResource(AAZCommand):
"""

_aaz_info = {
"version": "2024-01-01-preview",
"version": "2024-05-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools/{}/listassociatedresources", "2024-01-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools/{}/listassociatedresources", "2024-05-01"],
]
}

Expand All @@ -51,15 +50,15 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The name of the network manager.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.pool_name = AAZStrArg(
options=["-n", "--name", "--pool-name"],
help="Pool resource name.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
Expand Down Expand Up @@ -137,7 +136,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-01-01-preview",
"api-version", "2024-05-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command(
"network manager ipam-pool show",
is_preview=True,
)
class Show(AAZCommand):
"""Get the specific Pool resource.
Expand All @@ -23,9 +22,9 @@ class Show(AAZCommand):
"""

_aaz_info = {
"version": "2024-01-01-preview",
"version": "2024-05-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools/{}", "2024-01-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/ipampools/{}", "2024-05-01"],
]
}

Expand All @@ -51,7 +50,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.pool_name = AAZStrArg(
Expand All @@ -60,7 +59,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]*$",
pattern="^[0-9a-zA-Z]([0-9a-zA-Z_.-]{0,62}[0-9a-zA-Z_])?$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
Expand Down Expand Up @@ -137,7 +136,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-01-01-preview",
"api-version", "2024-05-01",
required=True,
),
}
Expand Down
Loading