Skip to content

Commit b5e3f47

Browse files
carlosh-msft2025Carlos Hinojosa Cavada
andauthored
Add StandbyPool API Version 2025-03-01 (#8676)
* Add StandbyPool API Version 2025-03-01 * update version in setup.py * Add examples, update param names, descriptions * generate update cmdlets using patch mode --------- Co-authored-by: Carlos Hinojosa Cavada <carlosh@microsoft.com>
1 parent b6b36f3 commit b5e3f47

File tree

22 files changed

+3790
-883
lines changed

22 files changed

+3790
-883
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: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
class Create(AAZCommand):
1818
"""Create a StandbyContainerGroupPoolResource
1919
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
20+
:example: StandbyContainerGroupPools_CreateOrUpdate
21+
az standby-container-group-pool create --resource-group rgstandbypool --name pool --max-ready-capacity 688 --refill-policy always --container-profile-id /subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile --profile-revision 1 --subnet-ids "[{id:/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet}]" --zones "[1,2,3]" --tags "{}" --location West US --subscription 00000000-0000-0000-0000-000000000009
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2024-03-01",
25+
"version": "2025-03-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2024-03-01"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2025-03-01"],
2828
]
2929
}
3030

@@ -110,6 +110,18 @@ def _build_arguments_schema(cls, *args, **kwargs):
110110
enum={"always": "always"},
111111
)
112112

113+
# define Arg Group "Properties"
114+
115+
_args_schema = cls._args_schema
116+
_args_schema.zones = AAZListArg(
117+
options=["--zones"],
118+
arg_group="Properties",
119+
help="Specifies zones of standby container group pools.",
120+
)
121+
122+
zones = cls._args_schema.zones
123+
zones.Element = AAZStrArg()
124+
113125
# define Arg Group "Resource"
114126

115127
_args_schema = cls._args_schema
@@ -212,7 +224,7 @@ def url_parameters(self):
212224
def query_parameters(self):
213225
parameters = {
214226
**self.serialize_query_param(
215-
"api-version", "2024-03-01",
227+
"api-version", "2025-03-01",
216228
required=True,
217229
),
218230
}
@@ -245,6 +257,7 @@ def content(self):
245257
if properties is not None:
246258
properties.set_prop("containerGroupProperties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
247259
properties.set_prop("elasticityProfile", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
260+
properties.set_prop("zones", AAZListType, ".zones")
248261

249262
container_group_properties = _builder.get(".properties.containerGroupProperties")
250263
if container_group_properties is not None:
@@ -269,6 +282,10 @@ def content(self):
269282
elasticity_profile.set_prop("maxReadyCapacity", AAZIntType, ".max_ready_capacity", typ_kwargs={"flags": {"required": True}})
270283
elasticity_profile.set_prop("refillPolicy", AAZStrType, ".refill_policy")
271284

285+
zones = _builder.get(".properties.zones")
286+
if zones is not None:
287+
zones.set_elements(AAZStrType, ".")
288+
272289
tags = _builder.get(".tags")
273290
if tags is not None:
274291
tags.set_elements(AAZStrType, ".")
@@ -327,6 +344,7 @@ def _build_schema_on_200_201(cls):
327344
serialized_name="provisioningState",
328345
flags={"read_only": True},
329346
)
347+
properties.zones = AAZListType()
330348

331349
container_group_properties = cls._schema_on_200_201.properties.container_group_properties
332350
container_group_properties.container_group_profile = AAZObjectType(
@@ -360,6 +378,9 @@ def _build_schema_on_200_201(cls):
360378
serialized_name="refillPolicy",
361379
)
362380

381+
zones = cls._schema_on_200_201.properties.zones
382+
zones.Element = AAZStrType()
383+
363384
system_data = cls._schema_on_200_201.system_data
364385
system_data.created_at = AAZStrType(
365386
serialized_name="createdAt",

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
class Delete(AAZCommand):
1919
"""Delete a StandbyContainerGroupPoolResource
2020
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
21+
:example: StandbyContainerGroupPools_Delete
22+
az standby-container-group-pool delete --resource-group rgstandbypool --name pool --subscription 00000000-0000-0000-0000-000000000009
2323
"""
2424

2525
_aaz_info = {
26-
"version": "2024-03-01",
26+
"version": "2025-03-01",
2727
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2024-03-01"],
28+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2025-03-01"],
2929
]
3030
}
3131

@@ -50,8 +50,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
5050
help="The resource group",
5151
required=True,
5252
)
53-
_args_schema.standby_container_group_pool_name = AAZStrArg(
54-
options=["-n", "--name", "--standby-container-group-pool-name"],
53+
_args_schema.name = AAZStrArg(
54+
options=["-n", "--name"],
5555
help="Name of the standby container group pool",
5656
required=True,
5757
id_part="name",
@@ -133,7 +133,7 @@ def url_parameters(self):
133133
required=True,
134134
),
135135
**self.serialize_url_param(
136-
"standbyContainerGroupPoolName", self.ctx.args.standby_container_group_pool_name,
136+
"standbyContainerGroupPoolName", self.ctx.args.name,
137137
required=True,
138138
),
139139
**self.serialize_url_param(
@@ -147,7 +147,7 @@ def url_parameters(self):
147147
def query_parameters(self):
148148
parameters = {
149149
**self.serialize_query_param(
150-
"api-version", "2024-03-01",
150+
"api-version", "2025-03-01",
151151
required=True,
152152
),
153153
}

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

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
"standby-container-group-pool list",
1616
)
1717
class List(AAZCommand):
18-
"""List StandbyContainerGroupPoolResource resources by subscription ID or by resource group
18+
"""List StandbyContainerGroupPoolResource resources by subscription ID by resource group
1919
20-
:example: List by subscription id by resource group
21-
az standby-container-pool list --subscription 461fa159-654a-415f-853a-40b801021944 --resource-group myrg
20+
:example: StandbyContainerGroupPools_ListBySubscription
21+
az standby-container-group-pool list --subscription 00000000-0000-0000-0000-000000000009 --resource-group resourceGroup
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2024-03-01",
25+
"version": "2025-03-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2024-03-01"],
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2024-03-01"],
27+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2025-03-01"],
28+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2025-03-01"],
2929
]
3030
}
3131

@@ -53,12 +53,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
5353

5454
def _execute_operations(self):
5555
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
56+
condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
57+
condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
5858
if condition_0:
59-
self.StandbyContainerGroupPoolsListByResourceGroup(ctx=self.ctx)()
60-
if condition_1:
6159
self.StandbyContainerGroupPoolsListBySubscription(ctx=self.ctx)()
60+
if condition_1:
61+
self.StandbyContainerGroupPoolsListByResourceGroup(ctx=self.ctx)()
6262
self.post_operations()
6363

6464
@register_callback
@@ -74,7 +74,7 @@ def _output(self, *args, **kwargs):
7474
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
7575
return result, next_link
7676

77-
class StandbyContainerGroupPoolsListByResourceGroup(AAZHttpOperation):
77+
class StandbyContainerGroupPoolsListBySubscription(AAZHttpOperation):
7878
CLIENT_TYPE = "MgmtClient"
7979

8080
def __call__(self, *args, **kwargs):
@@ -88,7 +88,7 @@ def __call__(self, *args, **kwargs):
8888
@property
8989
def url(self):
9090
return self.client.format_url(
91-
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools",
91+
"/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyContainerGroupPools",
9292
**self.url_parameters
9393
)
9494

@@ -103,10 +103,6 @@ def error_format(self):
103103
@property
104104
def url_parameters(self):
105105
parameters = {
106-
**self.serialize_url_param(
107-
"resourceGroupName", self.ctx.args.resource_group,
108-
required=True,
109-
),
110106
**self.serialize_url_param(
111107
"subscriptionId", self.ctx.subscription_id,
112108
required=True,
@@ -118,7 +114,7 @@ def url_parameters(self):
118114
def query_parameters(self):
119115
parameters = {
120116
**self.serialize_query_param(
121-
"api-version", "2024-03-01",
117+
"api-version", "2025-03-01",
122118
required=True,
123119
),
124120
}
@@ -196,6 +192,7 @@ def _build_schema_on_200(cls):
196192
serialized_name="provisioningState",
197193
flags={"read_only": True},
198194
)
195+
properties.zones = AAZListType()
199196

200197
container_group_properties = cls._schema_on_200.value.Element.properties.container_group_properties
201198
container_group_properties.container_group_profile = AAZObjectType(
@@ -229,6 +226,9 @@ def _build_schema_on_200(cls):
229226
serialized_name="refillPolicy",
230227
)
231228

229+
zones = cls._schema_on_200.value.Element.properties.zones
230+
zones.Element = AAZStrType()
231+
232232
system_data = cls._schema_on_200.value.Element.system_data
233233
system_data.created_at = AAZStrType(
234234
serialized_name="createdAt",
@@ -254,7 +254,7 @@ def _build_schema_on_200(cls):
254254

255255
return cls._schema_on_200
256256

257-
class StandbyContainerGroupPoolsListBySubscription(AAZHttpOperation):
257+
class StandbyContainerGroupPoolsListByResourceGroup(AAZHttpOperation):
258258
CLIENT_TYPE = "MgmtClient"
259259

260260
def __call__(self, *args, **kwargs):
@@ -268,7 +268,7 @@ def __call__(self, *args, **kwargs):
268268
@property
269269
def url(self):
270270
return self.client.format_url(
271-
"/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyContainerGroupPools",
271+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools",
272272
**self.url_parameters
273273
)
274274

@@ -283,6 +283,10 @@ def error_format(self):
283283
@property
284284
def url_parameters(self):
285285
parameters = {
286+
**self.serialize_url_param(
287+
"resourceGroupName", self.ctx.args.resource_group,
288+
required=True,
289+
),
286290
**self.serialize_url_param(
287291
"subscriptionId", self.ctx.subscription_id,
288292
required=True,
@@ -294,7 +298,7 @@ def url_parameters(self):
294298
def query_parameters(self):
295299
parameters = {
296300
**self.serialize_query_param(
297-
"api-version", "2024-03-01",
301+
"api-version", "2025-03-01",
298302
required=True,
299303
),
300304
}
@@ -372,6 +376,7 @@ def _build_schema_on_200(cls):
372376
serialized_name="provisioningState",
373377
flags={"read_only": True},
374378
)
379+
properties.zones = AAZListType()
375380

376381
container_group_properties = cls._schema_on_200.value.Element.properties.container_group_properties
377382
container_group_properties.container_group_profile = AAZObjectType(
@@ -405,6 +410,9 @@ def _build_schema_on_200(cls):
405410
serialized_name="refillPolicy",
406411
)
407412

413+
zones = cls._schema_on_200.value.Element.properties.zones
414+
zones.Element = AAZStrType()
415+
408416
system_data = cls._schema_on_200.value.Element.system_data
409417
system_data.created_at = AAZStrType(
410418
serialized_name="createdAt",

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
class Show(AAZCommand):
1818
"""Get a StandbyContainerGroupPoolResource
1919
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
20+
:example: StandbyContainerGroupPools_Get
21+
az standby-container-group-pool show --resource-group rgstandbypool --name pool --subscription 00000000-0000-0000-0000-000000000009
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2024-03-01",
25+
"version": "2025-03-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2024-03-01"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2025-03-01"],
2828
]
2929
}
3030

@@ -48,8 +48,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
4848
help="The resource group",
4949
required=True,
5050
)
51-
_args_schema.standby_container_group_pool_name = AAZStrArg(
52-
options=["-n", "--name", "--standby-container-group-pool-name"],
51+
_args_schema.name = AAZStrArg(
52+
options=["-n", "--name"],
5353
help="Name of the standby container group pool",
5454
required=True,
5555
id_part="name",
@@ -110,7 +110,7 @@ def url_parameters(self):
110110
required=True,
111111
),
112112
**self.serialize_url_param(
113-
"standbyContainerGroupPoolName", self.ctx.args.standby_container_group_pool_name,
113+
"standbyContainerGroupPoolName", self.ctx.args.name,
114114
required=True,
115115
),
116116
**self.serialize_url_param(
@@ -124,7 +124,7 @@ def url_parameters(self):
124124
def query_parameters(self):
125125
parameters = {
126126
**self.serialize_query_param(
127-
"api-version", "2024-03-01",
127+
"api-version", "2025-03-01",
128128
required=True,
129129
),
130130
}
@@ -191,6 +191,7 @@ def _build_schema_on_200(cls):
191191
serialized_name="provisioningState",
192192
flags={"read_only": True},
193193
)
194+
properties.zones = AAZListType()
194195

195196
container_group_properties = cls._schema_on_200.properties.container_group_properties
196197
container_group_properties.container_group_profile = AAZObjectType(
@@ -224,6 +225,9 @@ def _build_schema_on_200(cls):
224225
serialized_name="refillPolicy",
225226
)
226227

228+
zones = cls._schema_on_200.properties.zones
229+
zones.Element = AAZStrType()
230+
227231
system_data = cls._schema_on_200.system_data
228232
system_data.created_at = AAZStrType(
229233
serialized_name="createdAt",

0 commit comments

Comments
 (0)