Skip to content

Commit 13f2218

Browse files
author
Carlos Hinojosa Cavada
committed
Add StandbyPool API Version 2025-03-01
1 parent 046cc89 commit 13f2218

File tree

21 files changed

+4304
-1104
lines changed

21 files changed

+4304
-1104
lines changed

src/standbypool/HISTORY.rst

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

6+
2.0.0
7+
++++++
8+
* Upgrade api-version to 2025-03-01
9+
* `az standby-vm-pool status`: Add new StandbyPool Prediction and StandbyPool Health Status in the response.
10+
* `az standby-container-group-pool status`:Add new StandbyPool Prediction and StandbyPool Health Status in the response.
11+
* `az standby-container-group-pool create/update`: Add new properties `--zones` to support zonal StandbyPools.
12+
613
1.0.0
714
++++++
815
* Upgrade api-version to 2024-03-01

src/standbypool/azext_standbypool/aaz/latest/standby_container_group_pool/__cmd_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"standby-container-group-pool",
1616
)
1717
class __CMDGroup(AAZCommandGroup):
18-
"""Standby Container Group Pool Operations
18+
"""Manage Standby Container Group Pool
1919
"""
2020
pass
2121

src/standbypool/azext_standbypool/aaz/latest/standby_container_group_pool/_create.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616
)
1717
class Create(AAZCommand):
1818
"""Create a StandbyContainerGroupPoolResource
19-
20-
:example: Create Standby Container Group Pool
21-
az standby-container-group-pool create --resource-group myrg --name mypool --subscription 461fa159-654a-415f-853a-40b801021944 --container-profile-id /subscriptions/461fa159-654a-415f-853a-40b801021944/resourceGroups/myrg/providers/Microsoft.ContainerInstance/containerGroupProfiles/mycg --profile-revision 1 --subnet-ids [0].id=/subscriptions/461fa159-654a-415f-853a-40b801021944/resourceGroups/ru-cli-test-standbypool/providers/Microsoft.Network/virtualNetworks/ru-cli-test-standbypool-vnet/subnets/testSubnet --refill-policy always --max-ready-capacity 1 --location eastus
2219
"""
2320

2421
_aaz_info = {
25-
"version": "2024-03-01",
22+
"version": "2025-03-01",
2623
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2024-03-01"],
24+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2025-03-01"],
2825
]
2926
}
3027

@@ -46,11 +43,10 @@ def _build_arguments_schema(cls, *args, **kwargs):
4643

4744
_args_schema = cls._args_schema
4845
_args_schema.resource_group = AAZResourceGroupNameArg(
49-
help="The resource group",
5046
required=True,
5147
)
52-
_args_schema.name = AAZStrArg(
53-
options=["-n", "--name"],
48+
_args_schema.standby_container_group_pool_name = AAZStrArg(
49+
options=["-n", "--name", "--standby-container-group-pool-name"],
5450
help="Name of the standby container group pool",
5551
required=True,
5652
fmt=AAZStrArgFormat(
@@ -110,6 +106,18 @@ def _build_arguments_schema(cls, *args, **kwargs):
110106
enum={"always": "always"},
111107
)
112108

109+
# define Arg Group "Properties"
110+
111+
_args_schema = cls._args_schema
112+
_args_schema.zones = AAZListArg(
113+
options=["--zones"],
114+
arg_group="Properties",
115+
help="Specifies zones of standby container group pools.",
116+
)
117+
118+
zones = cls._args_schema.zones
119+
zones.Element = AAZStrArg()
120+
113121
# define Arg Group "Resource"
114122

115123
_args_schema = cls._args_schema
@@ -198,7 +206,7 @@ def url_parameters(self):
198206
required=True,
199207
),
200208
**self.serialize_url_param(
201-
"standbyContainerGroupPoolName", self.ctx.args.name,
209+
"standbyContainerGroupPoolName", self.ctx.args.standby_container_group_pool_name,
202210
required=True,
203211
),
204212
**self.serialize_url_param(
@@ -212,7 +220,7 @@ def url_parameters(self):
212220
def query_parameters(self):
213221
parameters = {
214222
**self.serialize_query_param(
215-
"api-version", "2024-03-01",
223+
"api-version", "2025-03-01",
216224
required=True,
217225
),
218226
}
@@ -245,6 +253,7 @@ def content(self):
245253
if properties is not None:
246254
properties.set_prop("containerGroupProperties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
247255
properties.set_prop("elasticityProfile", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
256+
properties.set_prop("zones", AAZListType, ".zones")
248257

249258
container_group_properties = _builder.get(".properties.containerGroupProperties")
250259
if container_group_properties is not None:
@@ -269,6 +278,10 @@ def content(self):
269278
elasticity_profile.set_prop("maxReadyCapacity", AAZIntType, ".max_ready_capacity", typ_kwargs={"flags": {"required": True}})
270279
elasticity_profile.set_prop("refillPolicy", AAZStrType, ".refill_policy")
271280

281+
zones = _builder.get(".properties.zones")
282+
if zones is not None:
283+
zones.set_elements(AAZStrType, ".")
284+
272285
tags = _builder.get(".tags")
273286
if tags is not None:
274287
tags.set_elements(AAZStrType, ".")
@@ -327,6 +340,7 @@ def _build_schema_on_200_201(cls):
327340
serialized_name="provisioningState",
328341
flags={"read_only": True},
329342
)
343+
properties.zones = AAZListType()
330344

331345
container_group_properties = cls._schema_on_200_201.properties.container_group_properties
332346
container_group_properties.container_group_profile = AAZObjectType(
@@ -360,6 +374,9 @@ def _build_schema_on_200_201(cls):
360374
serialized_name="refillPolicy",
361375
)
362376

377+
zones = cls._schema_on_200_201.properties.zones
378+
zones.Element = AAZStrType()
379+
363380
system_data = cls._schema_on_200_201.system_data
364381
system_data.created_at = AAZStrType(
365382
serialized_name="createdAt",

src/standbypool/azext_standbypool/aaz/latest/standby_container_group_pool/_delete.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@
1717
)
1818
class Delete(AAZCommand):
1919
"""Delete a StandbyContainerGroupPoolResource
20-
21-
:example: Delete Standby Container Group Pool
22-
az standby-container-group-pool delete --name mypool --subscription 461fa159-654a-415f-853a-40b801021944 --resource-group myrg
2320
"""
2421

2522
_aaz_info = {
26-
"version": "2024-03-01",
23+
"version": "2025-03-01",
2724
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2024-03-01"],
25+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2025-03-01"],
2926
]
3027
}
3128

@@ -47,7 +44,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
4744

4845
_args_schema = cls._args_schema
4946
_args_schema.resource_group = AAZResourceGroupNameArg(
50-
help="The resource group",
5147
required=True,
5248
)
5349
_args_schema.standby_container_group_pool_name = AAZStrArg(
@@ -147,7 +143,7 @@ def url_parameters(self):
147143
def query_parameters(self):
148144
parameters = {
149145
**self.serialize_query_param(
150-
"api-version", "2024-03-01",
146+
"api-version", "2025-03-01",
151147
required=True,
152148
),
153149
}

src/standbypool/azext_standbypool/aaz/latest/standby_container_group_pool/_list.py

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@
1515
"standby-container-group-pool list",
1616
)
1717
class List(AAZCommand):
18-
"""List StandbyContainerGroupPoolResource resources by subscription ID or by resource group
19-
20-
:example: List by subscription id by resource group
21-
az standby-container-pool list --subscription 461fa159-654a-415f-853a-40b801021944 --resource-group myrg
18+
"""List StandbyContainerGroupPoolResource resources by subscription ID by resource group
2219
"""
2320

2421
_aaz_info = {
25-
"version": "2024-03-01",
22+
"version": "2025-03-01",
2623
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2024-03-01"],
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2024-03-01"],
24+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2025-03-01"],
25+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2025-03-01"],
2926
]
3027
}
3128

@@ -46,19 +43,17 @@ def _build_arguments_schema(cls, *args, **kwargs):
4643
# define Arg Group ""
4744

4845
_args_schema = cls._args_schema
49-
_args_schema.resource_group = AAZResourceGroupNameArg(
50-
help="The resource group",
51-
)
46+
_args_schema.resource_group = AAZResourceGroupNameArg()
5247
return cls._args_schema
5348

5449
def _execute_operations(self):
5550
self.pre_operations()
56-
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
57-
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)
5853
if condition_0:
59-
self.StandbyContainerGroupPoolsListByResourceGroup(ctx=self.ctx)()
60-
if condition_1:
6154
self.StandbyContainerGroupPoolsListBySubscription(ctx=self.ctx)()
55+
if condition_1:
56+
self.StandbyContainerGroupPoolsListByResourceGroup(ctx=self.ctx)()
6257
self.post_operations()
6358

6459
@register_callback
@@ -74,7 +69,7 @@ def _output(self, *args, **kwargs):
7469
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
7570
return result, next_link
7671

77-
class StandbyContainerGroupPoolsListByResourceGroup(AAZHttpOperation):
72+
class StandbyContainerGroupPoolsListBySubscription(AAZHttpOperation):
7873
CLIENT_TYPE = "MgmtClient"
7974

8075
def __call__(self, *args, **kwargs):
@@ -88,7 +83,7 @@ def __call__(self, *args, **kwargs):
8883
@property
8984
def url(self):
9085
return self.client.format_url(
91-
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools",
86+
"/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyContainerGroupPools",
9287
**self.url_parameters
9388
)
9489

@@ -103,10 +98,6 @@ def error_format(self):
10398
@property
10499
def url_parameters(self):
105100
parameters = {
106-
**self.serialize_url_param(
107-
"resourceGroupName", self.ctx.args.resource_group,
108-
required=True,
109-
),
110101
**self.serialize_url_param(
111102
"subscriptionId", self.ctx.subscription_id,
112103
required=True,
@@ -118,7 +109,7 @@ def url_parameters(self):
118109
def query_parameters(self):
119110
parameters = {
120111
**self.serialize_query_param(
121-
"api-version", "2024-03-01",
112+
"api-version", "2025-03-01",
122113
required=True,
123114
),
124115
}
@@ -196,6 +187,7 @@ def _build_schema_on_200(cls):
196187
serialized_name="provisioningState",
197188
flags={"read_only": True},
198189
)
190+
properties.zones = AAZListType()
199191

200192
container_group_properties = cls._schema_on_200.value.Element.properties.container_group_properties
201193
container_group_properties.container_group_profile = AAZObjectType(
@@ -229,6 +221,9 @@ def _build_schema_on_200(cls):
229221
serialized_name="refillPolicy",
230222
)
231223

224+
zones = cls._schema_on_200.value.Element.properties.zones
225+
zones.Element = AAZStrType()
226+
232227
system_data = cls._schema_on_200.value.Element.system_data
233228
system_data.created_at = AAZStrType(
234229
serialized_name="createdAt",
@@ -254,7 +249,7 @@ def _build_schema_on_200(cls):
254249

255250
return cls._schema_on_200
256251

257-
class StandbyContainerGroupPoolsListBySubscription(AAZHttpOperation):
252+
class StandbyContainerGroupPoolsListByResourceGroup(AAZHttpOperation):
258253
CLIENT_TYPE = "MgmtClient"
259254

260255
def __call__(self, *args, **kwargs):
@@ -268,7 +263,7 @@ def __call__(self, *args, **kwargs):
268263
@property
269264
def url(self):
270265
return self.client.format_url(
271-
"/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyContainerGroupPools",
266+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools",
272267
**self.url_parameters
273268
)
274269

@@ -283,6 +278,10 @@ def error_format(self):
283278
@property
284279
def url_parameters(self):
285280
parameters = {
281+
**self.serialize_url_param(
282+
"resourceGroupName", self.ctx.args.resource_group,
283+
required=True,
284+
),
286285
**self.serialize_url_param(
287286
"subscriptionId", self.ctx.subscription_id,
288287
required=True,
@@ -294,7 +293,7 @@ def url_parameters(self):
294293
def query_parameters(self):
295294
parameters = {
296295
**self.serialize_query_param(
297-
"api-version", "2024-03-01",
296+
"api-version", "2025-03-01",
298297
required=True,
299298
),
300299
}
@@ -372,6 +371,7 @@ def _build_schema_on_200(cls):
372371
serialized_name="provisioningState",
373372
flags={"read_only": True},
374373
)
374+
properties.zones = AAZListType()
375375

376376
container_group_properties = cls._schema_on_200.value.Element.properties.container_group_properties
377377
container_group_properties.container_group_profile = AAZObjectType(
@@ -405,6 +405,9 @@ def _build_schema_on_200(cls):
405405
serialized_name="refillPolicy",
406406
)
407407

408+
zones = cls._schema_on_200.value.Element.properties.zones
409+
zones.Element = AAZStrType()
410+
408411
system_data = cls._schema_on_200.value.Element.system_data
409412
system_data.created_at = AAZStrType(
410413
serialized_name="createdAt",

src/standbypool/azext_standbypool/aaz/latest/standby_container_group_pool/_show.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616
)
1717
class Show(AAZCommand):
1818
"""Get a StandbyContainerGroupPoolResource
19-
20-
:example: Get standby container group pool
21-
az standby-container-group-pool show --subscription 461fa159-654a-415f-853a-40b801021944 --resource-group myrg --name mypool
2219
"""
2320

2421
_aaz_info = {
25-
"version": "2024-03-01",
22+
"version": "2025-03-01",
2623
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2024-03-01"],
24+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2025-03-01"],
2825
]
2926
}
3027

@@ -45,7 +42,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
4542

4643
_args_schema = cls._args_schema
4744
_args_schema.resource_group = AAZResourceGroupNameArg(
48-
help="The resource group",
4945
required=True,
5046
)
5147
_args_schema.standby_container_group_pool_name = AAZStrArg(
@@ -124,7 +120,7 @@ def url_parameters(self):
124120
def query_parameters(self):
125121
parameters = {
126122
**self.serialize_query_param(
127-
"api-version", "2024-03-01",
123+
"api-version", "2025-03-01",
128124
required=True,
129125
),
130126
}
@@ -191,6 +187,7 @@ def _build_schema_on_200(cls):
191187
serialized_name="provisioningState",
192188
flags={"read_only": True},
193189
)
190+
properties.zones = AAZListType()
194191

195192
container_group_properties = cls._schema_on_200.properties.container_group_properties
196193
container_group_properties.container_group_profile = AAZObjectType(
@@ -224,6 +221,9 @@ def _build_schema_on_200(cls):
224221
serialized_name="refillPolicy",
225222
)
226223

224+
zones = cls._schema_on_200.properties.zones
225+
zones.Element = AAZStrType()
226+
227227
system_data = cls._schema_on_200.system_data
228228
system_data.created_at = AAZStrType(
229229
serialized_name="createdAt",

0 commit comments

Comments
 (0)