Skip to content

Commit 1421726

Browse files
committed
codegen
1 parent 5103af8 commit 1421726

File tree

3 files changed

+52
-12
lines changed

3 files changed

+52
-12
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,24 @@ def _build_arguments_schema(cls, *args, **kwargs):
6666
options=["--sku"],
6767
help="SKU of the route server.",
6868
)
69+
_args_schema.auto_scale_config = AAZObjectArg(
70+
options=["--auto-scale-config"],
71+
help="The VirtualHub Router autoscale configuration.",
72+
)
6973
_args_schema.tags = AAZDictArg(
7074
options=["--tags"],
7175
help="Space-separated tags: key[=value] [key[=value] ...].",
7276
)
7377

78+
auto_scale_config = cls._args_schema.auto_scale_config
79+
auto_scale_config.min_capacity = AAZIntArg(
80+
options=["min-capacity"],
81+
help="The minimum number of scale units for VirtualHub Router.",
82+
fmt=AAZIntArgFormat(
83+
minimum=0,
84+
),
85+
)
86+
7487
tags = cls._args_schema.tags
7588
tags.Element = AAZStrArg()
7689

@@ -211,6 +224,11 @@ def content(self):
211224
if properties is not None:
212225
properties.set_prop("hubRoutingPreference", AAZStrType, ".hub_routing_preference")
213226
properties.set_prop("sku", AAZStrType, ".sku")
227+
properties.set_prop("virtualRouterAutoScaleConfiguration", AAZObjectType, ".auto_scale_config")
228+
229+
virtual_router_auto_scale_configuration = _builder.get(".properties.virtualRouterAutoScaleConfiguration")
230+
if virtual_router_auto_scale_configuration is not None:
231+
virtual_router_auto_scale_configuration.set_prop("minCapacity", AAZIntType, ".min_capacity")
214232

215233
tags = _builder.get(".tags")
216234
if tags is not None:

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/routeserver/_list.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class List(AAZCommand):
2929
]
3030
}
3131

32+
AZ_SUPPORT_PAGINATION = True
33+
3234
def _handler(self, command_args):
3335
super()._handler(command_args)
3436
return self.build_paging(self._execute_operations, self._output)
@@ -49,12 +51,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
4951

5052
def _execute_operations(self):
5153
self.pre_operations()
52-
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
53-
condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
54+
condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
55+
condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
5456
if condition_0:
55-
self.VirtualHubsListByResourceGroup(ctx=self.ctx)()
56-
if condition_1:
5757
self.VirtualHubsList(ctx=self.ctx)()
58+
if condition_1:
59+
self.VirtualHubsListByResourceGroup(ctx=self.ctx)()
5860
self.post_operations()
5961

6062
@register_callback
@@ -70,7 +72,7 @@ def _output(self, *args, **kwargs):
7072
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
7173
return result, next_link
7274

73-
class VirtualHubsListByResourceGroup(AAZHttpOperation):
75+
class VirtualHubsList(AAZHttpOperation):
7476
CLIENT_TYPE = "MgmtClient"
7577

7678
def __call__(self, *args, **kwargs):
@@ -84,7 +86,7 @@ def __call__(self, *args, **kwargs):
8486
@property
8587
def url(self):
8688
return self.client.format_url(
87-
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs",
89+
"/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs",
8890
**self.url_parameters
8991
)
9092

@@ -99,10 +101,6 @@ def error_format(self):
99101
@property
100102
def url_parameters(self):
101103
parameters = {
102-
**self.serialize_url_param(
103-
"resourceGroupName", self.ctx.args.resource_group,
104-
required=True,
105-
),
106104
**self.serialize_url_param(
107105
"subscriptionId", self.ctx.subscription_id,
108106
required=True,
@@ -335,7 +333,7 @@ def _build_schema_on_200(cls):
335333

336334
return cls._schema_on_200
337335

338-
class VirtualHubsList(AAZHttpOperation):
336+
class VirtualHubsListByResourceGroup(AAZHttpOperation):
339337
CLIENT_TYPE = "MgmtClient"
340338

341339
def __call__(self, *args, **kwargs):
@@ -349,7 +347,7 @@ def __call__(self, *args, **kwargs):
349347
@property
350348
def url(self):
351349
return self.client.format_url(
352-
"/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs",
350+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs",
353351
**self.url_parameters
354352
)
355353

@@ -364,6 +362,10 @@ def error_format(self):
364362
@property
365363
def url_parameters(self):
366364
parameters = {
365+
**self.serialize_url_param(
366+
"resourceGroupName", self.ctx.args.resource_group,
367+
required=True,
368+
),
367369
**self.serialize_url_param(
368370
"subscriptionId", self.ctx.subscription_id,
369371
required=True,

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/routeserver/_update.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,27 @@ def _build_arguments_schema(cls, *args, **kwargs):
6767
nullable=True,
6868
enum={"ASPath": "ASPath", "ExpressRoute": "ExpressRoute", "VpnGateway": "VpnGateway"},
6969
)
70+
_args_schema.auto_scale_config = AAZObjectArg(
71+
options=["--auto-scale-config"],
72+
help="The VirtualHub Router autoscale configuration.",
73+
nullable=True,
74+
)
7075
_args_schema.tags = AAZDictArg(
7176
options=["--tags"],
7277
help="Space-separated tags: key[=value] [key[=value] ...].",
7378
nullable=True,
7479
)
7580

81+
auto_scale_config = cls._args_schema.auto_scale_config
82+
auto_scale_config.min_capacity = AAZIntArg(
83+
options=["min-capacity"],
84+
help="The minimum number of scale units for VirtualHub Router.",
85+
nullable=True,
86+
fmt=AAZIntArgFormat(
87+
minimum=0,
88+
),
89+
)
90+
7691
tags = cls._args_schema.tags
7792
tags.Element = AAZStrArg(
7893
nullable=True,
@@ -346,6 +361,11 @@ def _update_instance(self, instance):
346361
if properties is not None:
347362
properties.set_prop("allowBranchToBranchTraffic", AAZBoolType, ".allow_b2b_traffic")
348363
properties.set_prop("hubRoutingPreference", AAZStrType, ".hub_routing_preference")
364+
properties.set_prop("virtualRouterAutoScaleConfiguration", AAZObjectType, ".auto_scale_config")
365+
366+
virtual_router_auto_scale_configuration = _builder.get(".properties.virtualRouterAutoScaleConfiguration")
367+
if virtual_router_auto_scale_configuration is not None:
368+
virtual_router_auto_scale_configuration.set_prop("minCapacity", AAZIntType, ".min_capacity")
349369

350370
tags = _builder.get(".tags")
351371
if tags is not None:

0 commit comments

Comments
 (0)