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
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.ipam_pool_prefix_allocations = AAZListArg(
options=["--ipam-allocations", "--ipam-pool-prefix-allocations"],
arg_group="AddressSpace",
help="A list of IPAM Pools allocating IP address prefixes. If provided, --address-prefixes would be empty and should not be specified.",
help="A list of IPAM Pools allocating IP address prefixes. If provided, --address-prefixes would be ignored and should not be specified.",
)

ipam_pool_prefix_allocations = cls._args_schema.ipam_pool_prefix_allocations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ def _build_arguments_schema(cls, *args, **kwargs):

def _execute_operations(self):
self.pre_operations()
condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
if condition_0:
self.VirtualNetworksListAll(ctx=self.ctx)()
if condition_1:
self.VirtualNetworksList(ctx=self.ctx)()
if condition_1:
self.VirtualNetworksListAll(ctx=self.ctx)()
self.post_operations()

@register_callback
Expand All @@ -78,7 +78,7 @@ def _output(self, *args, **kwargs):
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
return result, next_link

class VirtualNetworksListAll(AAZHttpOperation):
class VirtualNetworksList(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -92,7 +92,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks",
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks",
**self.url_parameters
)

Expand All @@ -107,6 +107,10 @@ def error_format(self):
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
Expand Down Expand Up @@ -376,7 +380,7 @@ def _build_schema_on_200(cls):

return cls._schema_on_200

class VirtualNetworksList(AAZHttpOperation):
class VirtualNetworksListAll(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -390,7 +394,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks",
"/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks",
**self.url_parameters
)

Expand All @@ -405,10 +409,6 @@ def error_format(self):
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.ipam_pool_prefix_allocations = AAZListArg(
options=["--ipam-allocations", "--ipam-pool-prefix-allocations"],
arg_group="AddressSpace",
help="A list of IPAM Pools allocating IP address prefixes. If provided, --address-prefixes would be empty and should not be specified.",
help="A list of IPAM Pools allocating IP address prefixes. If a non-empty value is provided, --address-prefixes would be ignored.",
nullable=True,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5575,7 +5575,7 @@ def _build_arguments_schema(cls, *args, **kwargs):

def pre_operations(self):
args = self.ctx.args
if has_value(args.ipam_pool_prefix_allocations):
if args.ipam_pool_prefix_allocations.to_serialized_data():
args.address_prefixes = []

def post_instance_update(self, instance):
Expand Down
Loading