Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions src/standbypool/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Release History
===============

2.0.0
++++++
* Upgrade api-version to 2025-03-01
* `az standby-vm-pool status`: Add new StandbyPool Prediction and StandbyPool Health Status in the response.
* `az standby-container-group-pool status`:Add new StandbyPool Prediction and StandbyPool Health Status in the response.
* `az standby-container-group-pool create/update`: Add new properties `--zones` to support zonal StandbyPools.

1.0.0
++++++
* Upgrade api-version to 2024-03-01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"standby-container-group-pool",
)
class __CMDGroup(AAZCommandGroup):
"""Standby Container Group Pool Operations
"""Manage Standby Container Group Pool
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
)
class Create(AAZCommand):
"""Create a StandbyContainerGroupPoolResource

:example: Create Standby Container Group Pool
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
"""

_aaz_info = {
"version": "2024-03-01",
"version": "2025-03-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2024-03-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2025-03-01"],
]
}

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

_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
help="The resource group",
required=True,
)
_args_schema.name = AAZStrArg(
options=["-n", "--name"],
_args_schema.standby_container_group_pool_name = AAZStrArg(
options=["-n", "--name", "--standby-container-group-pool-name"],
help="Name of the standby container group pool",
required=True,
fmt=AAZStrArgFormat(
Expand Down Expand Up @@ -110,6 +106,18 @@ def _build_arguments_schema(cls, *args, **kwargs):
enum={"always": "always"},
)

# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.zones = AAZListArg(
options=["--zones"],
arg_group="Properties",
help="Specifies zones of standby container group pools.",
)

zones = cls._args_schema.zones
zones.Element = AAZStrArg()

# define Arg Group "Resource"

_args_schema = cls._args_schema
Expand Down Expand Up @@ -198,7 +206,7 @@ def url_parameters(self):
required=True,
),
**self.serialize_url_param(
"standbyContainerGroupPoolName", self.ctx.args.name,
"standbyContainerGroupPoolName", self.ctx.args.standby_container_group_pool_name,
required=True,
),
**self.serialize_url_param(
Expand All @@ -212,7 +220,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-03-01",
"api-version", "2025-03-01",
required=True,
),
}
Expand Down Expand Up @@ -245,6 +253,7 @@ def content(self):
if properties is not None:
properties.set_prop("containerGroupProperties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
properties.set_prop("elasticityProfile", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
properties.set_prop("zones", AAZListType, ".zones")

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

zones = _builder.get(".properties.zones")
if zones is not None:
zones.set_elements(AAZStrType, ".")

tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
Expand Down Expand Up @@ -327,6 +340,7 @@ def _build_schema_on_200_201(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.zones = AAZListType()

container_group_properties = cls._schema_on_200_201.properties.container_group_properties
container_group_properties.container_group_profile = AAZObjectType(
Expand Down Expand Up @@ -360,6 +374,9 @@ def _build_schema_on_200_201(cls):
serialized_name="refillPolicy",
)

zones = cls._schema_on_200_201.properties.zones
zones.Element = AAZStrType()

system_data = cls._schema_on_200_201.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@
)
class Delete(AAZCommand):
"""Delete a StandbyContainerGroupPoolResource

:example: Delete Standby Container Group Pool
az standby-container-group-pool delete --name mypool --subscription 461fa159-654a-415f-853a-40b801021944 --resource-group myrg
"""

_aaz_info = {
"version": "2024-03-01",
"version": "2025-03-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2024-03-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2025-03-01"],
]
}

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

_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
help="The resource group",
required=True,
)
_args_schema.standby_container_group_pool_name = AAZStrArg(
Expand Down Expand Up @@ -147,7 +143,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-03-01",
"api-version", "2025-03-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@
"standby-container-group-pool list",
)
class List(AAZCommand):
"""List StandbyContainerGroupPoolResource resources by subscription ID or by resource group

:example: List by subscription id by resource group
az standby-container-pool list --subscription 461fa159-654a-415f-853a-40b801021944 --resource-group myrg
"""List StandbyContainerGroupPoolResource resources by subscription ID by resource group
"""

_aaz_info = {
"version": "2024-03-01",
"version": "2025-03-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2024-03-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2024-03-01"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2025-03-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools", "2025-03-01"],
]
}

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

_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
help="The resource group",
)
_args_schema.resource_group = AAZResourceGroupNameArg()
return cls._args_schema

def _execute_operations(self):
self.pre_operations()
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
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)
if condition_0:
self.StandbyContainerGroupPoolsListByResourceGroup(ctx=self.ctx)()
if condition_1:
self.StandbyContainerGroupPoolsListBySubscription(ctx=self.ctx)()
if condition_1:
self.StandbyContainerGroupPoolsListByResourceGroup(ctx=self.ctx)()
self.post_operations()

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

class StandbyContainerGroupPoolsListByResourceGroup(AAZHttpOperation):
class StandbyContainerGroupPoolsListBySubscription(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

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

Expand All @@ -103,10 +98,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 All @@ -118,7 +109,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-03-01",
"api-version", "2025-03-01",
required=True,
),
}
Expand Down Expand Up @@ -196,6 +187,7 @@ def _build_schema_on_200(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.zones = AAZListType()

container_group_properties = cls._schema_on_200.value.Element.properties.container_group_properties
container_group_properties.container_group_profile = AAZObjectType(
Expand Down Expand Up @@ -229,6 +221,9 @@ def _build_schema_on_200(cls):
serialized_name="refillPolicy",
)

zones = cls._schema_on_200.value.Element.properties.zones
zones.Element = AAZStrType()

system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
Expand All @@ -254,7 +249,7 @@ def _build_schema_on_200(cls):

return cls._schema_on_200

class StandbyContainerGroupPoolsListBySubscription(AAZHttpOperation):
class StandbyContainerGroupPoolsListByResourceGroup(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

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

Expand All @@ -283,6 +278,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 All @@ -294,7 +293,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-03-01",
"api-version", "2025-03-01",
required=True,
),
}
Expand Down Expand Up @@ -372,6 +371,7 @@ def _build_schema_on_200(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.zones = AAZListType()

container_group_properties = cls._schema_on_200.value.Element.properties.container_group_properties
container_group_properties.container_group_profile = AAZObjectType(
Expand Down Expand Up @@ -405,6 +405,9 @@ def _build_schema_on_200(cls):
serialized_name="refillPolicy",
)

zones = cls._schema_on_200.value.Element.properties.zones
zones.Element = AAZStrType()

system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
)
class Show(AAZCommand):
"""Get a StandbyContainerGroupPoolResource

:example: Get standby container group pool
az standby-container-group-pool show --subscription 461fa159-654a-415f-853a-40b801021944 --resource-group myrg --name mypool
"""

_aaz_info = {
"version": "2024-03-01",
"version": "2025-03-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2024-03-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.standbypool/standbycontainergrouppools/{}", "2025-03-01"],
]
}

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

_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
help="The resource group",
required=True,
)
_args_schema.standby_container_group_pool_name = AAZStrArg(
Expand Down Expand Up @@ -124,7 +120,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-03-01",
"api-version", "2025-03-01",
required=True,
),
}
Expand Down Expand Up @@ -191,6 +187,7 @@ def _build_schema_on_200(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.zones = AAZListType()

container_group_properties = cls._schema_on_200.properties.container_group_properties
container_group_properties.container_group_profile = AAZObjectType(
Expand Down Expand Up @@ -224,6 +221,9 @@ def _build_schema_on_200(cls):
serialized_name="refillPolicy",
)

zones = cls._schema_on_200.properties.zones
zones.Element = AAZStrType()

system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
Expand Down
Loading
Loading