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
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 @@ -17,14 +17,14 @@
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
:example: StandbyContainerGroupPools_CreateOrUpdate
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
"""

_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 Down Expand Up @@ -110,6 +110,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 @@ -212,7 +224,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 +257,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 +282,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 +344,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 +378,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 @@ -18,14 +18,14 @@
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
:example: StandbyContainerGroupPools_Delete
az standby-container-group-pool delete --resource-group rgstandbypool --name pool --subscription 00000000-0000-0000-0000-000000000009
"""

_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 @@ -50,8 +50,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The resource group",
required=True,
)
_args_schema.standby_container_group_pool_name = AAZStrArg(
options=["-n", "--name", "--standby-container-group-pool-name"],
_args_schema.name = AAZStrArg(
options=["-n", "--name"],
help="Name of the standby container group pool",
required=True,
id_part="name",
Expand Down Expand Up @@ -133,7 +133,7 @@ def url_parameters(self):
required=True,
),
**self.serialize_url_param(
"standbyContainerGroupPoolName", self.ctx.args.standby_container_group_pool_name,
"standbyContainerGroupPoolName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
Expand All @@ -147,7 +147,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,17 @@
"standby-container-group-pool list",
)
class List(AAZCommand):
"""List StandbyContainerGroupPoolResource resources by subscription ID or by resource group
"""List StandbyContainerGroupPoolResource resources by subscription ID 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
:example: StandbyContainerGroupPools_ListBySubscription
az standby-container-group-pool list --subscription 00000000-0000-0000-0000-000000000009 --resource-group resourceGroup
"""

_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 Down Expand Up @@ -53,12 +53,12 @@ def _build_arguments_schema(cls, *args, **kwargs):

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 +74,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 +88,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 +103,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 +114,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 +192,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 +226,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 +254,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 +268,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 +283,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 +298,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 +376,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 +410,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 @@ -17,14 +17,14 @@
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
:example: StandbyContainerGroupPools_Get
az standby-container-group-pool show --resource-group rgstandbypool --name pool --subscription 00000000-0000-0000-0000-000000000009
"""

_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 @@ -48,8 +48,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The resource group",
required=True,
)
_args_schema.standby_container_group_pool_name = AAZStrArg(
options=["-n", "--name", "--standby-container-group-pool-name"],
_args_schema.name = AAZStrArg(
options=["-n", "--name"],
help="Name of the standby container group pool",
required=True,
id_part="name",
Expand Down Expand Up @@ -110,7 +110,7 @@ def url_parameters(self):
required=True,
),
**self.serialize_url_param(
"standbyContainerGroupPoolName", self.ctx.args.standby_container_group_pool_name,
"standbyContainerGroupPoolName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
Expand All @@ -124,7 +124,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 +191,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 +225,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