Skip to content

Commit

Permalink
[Elastic-SAN] 2023-01-01 api-version public preview (#6758)
Browse files Browse the repository at this point in the history
* regen with 2023-01-01 api version, add snapshot crud

* update version info

* add back param option

* change {} to "" in examples to differentiate with short-hand-syntax, move snapshot to under volume from volume-group

* rerun test

* hide managedBy in volume create/update, test snapshot cases

* customer_managed_key_system_assigned_identity_scenarios

* customer_managed_key_user_assigned_identity_scenarios

* fix fmt

* add tests for new param

* add tests for new param

* add clean up at end of tests

* add test cases for switching to a new uai

* create volume from snapshot

* test switch back from cmk to pmk and sai

* add examples for snapshot and CMK/PMK with UAI test cases

* change back to preview

* change it to use has_value instead of just checking the var
  • Loading branch information
calvinhzy authored Oct 16, 2023
1 parent a4766a6 commit ed71cc7
Show file tree
Hide file tree
Showing 38 changed files with 9,211 additions and 451 deletions.
6 changes: 6 additions & 0 deletions src/elastic-san/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Release History
===============

1.0.0b2
++++++
* Support 2023-01-01 api-version as preview
* Add `az elastic-san volume-group snapshot` command group
* Support CMK for volume-group

1.0.0b1
++++++
* Support private endpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ class Create(AAZCommand):
"""Create an Elastic SAN.
:example: Create an Elastic SAN.
az elastic-san create -n {san_name} -g {rg} --tags "{key1810:aaaa}" -l southcentralusstg --base-size-tib 23 --extended-capacity-size-tib 14 --sku "{name:Premium_LRS,tier:Premium}"
az elastic-san create -n "san_name" -g "rg" --tags '{key1810:aaaa}' -l southcentralusstg --base-size-tib 23 --extended-capacity-size-tib 14 --sku '{name:Premium_LRS,tier:Premium}' --public-network-access Enabled
"""

_aaz_info = {
"version": "2022-12-01-preview",
"version": "2023-01-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2022-12-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2023-01-01"],
]
}

Expand Down Expand Up @@ -100,6 +100,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="Extended size of the Elastic San appliance in TiB.",
required=True,
)
_args_schema.public_network_access = AAZStrArg(
options=["--public-network-access"],
arg_group="Properties",
help="Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.",
enum={"Disabled": "Disabled", "Enabled": "Enabled"},
)
_args_schema.sku = AAZObjectArg(
options=["--sku"],
arg_group="Properties",
Expand Down Expand Up @@ -205,7 +211,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01-preview",
"api-version", "2023-01-01",
required=True,
),
}
Expand Down Expand Up @@ -239,6 +245,7 @@ def content(self):
properties.set_prop("availabilityZones", AAZListType, ".availability_zones")
properties.set_prop("baseSizeTiB", AAZIntType, ".base_size_tib", typ_kwargs={"flags": {"required": True}})
properties.set_prop("extendedCapacitySizeTiB", AAZIntType, ".extended_capacity_size_tib", typ_kwargs={"flags": {"required": True}})
properties.set_prop("publicNetworkAccess", AAZStrType, ".public_network_access")
properties.set_prop("sku", AAZObjectType, ".sku", typ_kwargs={"flags": {"required": True}})

availability_zones = _builder.get(".properties.availabilityZones")
Expand Down Expand Up @@ -316,6 +323,9 @@ def _build_schema_on_200_201(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.public_network_access = AAZStrType(
serialized_name="publicNetworkAccess",
)
properties.sku = AAZObjectType(
flags={"required": True},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class Delete(AAZCommand):
"""Delete an Elastic SAN.
:example: Delete an Elastic SAN.
az elastic-san delete -g {rg} -n {san_name}
az elastic-san delete -g "rg" -n "san_name"
"""

_aaz_info = {
"version": "2022-12-01-preview",
"version": "2023-01-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2022-12-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2023-01-01"],
]
}

Expand Down Expand Up @@ -149,7 +149,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01-preview",
"api-version", "2023-01-01",
required=True,
),
}
Expand Down
18 changes: 12 additions & 6 deletions src/elastic-san/azext_elastic_san/aaz/latest/elastic_san/_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class List(AAZCommand):
"""Get a list of Elastic SANs in a subscription.
:example: Get a list of Elastic SANs in a subscription.
az elastic-san list -g {rg}
az elastic-san list -g "rg"
"""

_aaz_info = {
"version": "2022-12-01-preview",
"version": "2023-01-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elasticsan/elasticsans", "2022-12-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans", "2022-12-01-preview"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elasticsan/elasticsans", "2023-01-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans", "2023-01-01"],
]
}

Expand Down Expand Up @@ -117,7 +117,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01-preview",
"api-version", "2023-01-01",
required=True,
),
}
Expand Down Expand Up @@ -202,6 +202,9 @@ def _build_schema_on_200(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.public_network_access = AAZStrType(
serialized_name="publicNetworkAccess",
)
properties.sku = AAZObjectType(
flags={"required": True},
)
Expand Down Expand Up @@ -333,7 +336,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01-preview",
"api-version", "2023-01-01",
required=True,
),
}
Expand Down Expand Up @@ -418,6 +421,9 @@ def _build_schema_on_200(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.public_network_access = AAZStrType(
serialized_name="publicNetworkAccess",
)
properties.sku = AAZObjectType(
flags={"required": True},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class ListSku(AAZCommand):
"""

_aaz_info = {
"version": "2022-12-01-preview",
"version": "2023-01-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elasticsan/skus", "2022-12-01-preview"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elasticsan/skus", "2023-01-01"],
]
}

Expand Down Expand Up @@ -111,7 +111,7 @@ def query_parameters(self):
"$filter", self.ctx.args.filter,
),
**self.serialize_query_param(
"api-version", "2022-12-01-preview",
"api-version", "2023-01-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ class Show(AAZCommand):
"""Get an Elastic SAN.
:example: Get an Elastic SAN.
az elastic-san show -g {rg} -n {san_name}
az elastic-san show -g "rg" -n "san_name"
"""

_aaz_info = {
"version": "2022-12-01-preview",
"version": "2023-01-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2022-12-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2023-01-01"],
]
}

Expand Down Expand Up @@ -126,7 +126,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01-preview",
"api-version", "2023-01-01",
required=True,
),
}
Expand Down Expand Up @@ -201,6 +201,9 @@ def _build_schema_on_200(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.public_network_access = AAZStrType(
serialized_name="publicNetworkAccess",
)
properties.sku = AAZObjectType(
flags={"required": True},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ class Update(AAZCommand):
"""Update an Elastic SAN.
:example: Update an Elastic SAN.
az elastic-san update -n {san_name} -g {rg} --tags "{key1710:bbbb}" --base-size-tib 25 --extended-capacity-size-tib 15
az elastic-san update -n "san_name" -g "rg" --tags '{key1710:bbbb}' --base-size-tib 25 --extended-capacity-size-tib 15
"""

_aaz_info = {
"version": "2022-12-01-preview",
"version": "2023-01-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2022-12-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2023-01-01"],
]
}

Expand Down Expand Up @@ -97,6 +97,13 @@ def _build_arguments_schema(cls, *args, **kwargs):
arg_group="Properties",
help="Extended size of the Elastic San appliance in TiB.",
)
_args_schema.public_network_access = AAZStrArg(
options=["--public-network-access"],
arg_group="Properties",
help="Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.",
nullable=True,
enum={"Disabled": "Disabled", "Enabled": "Enabled"},
)
_args_schema.sku = AAZObjectArg(
options=["--sku"],
arg_group="Properties",
Expand Down Expand Up @@ -200,7 +207,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01-preview",
"api-version", "2023-01-01",
required=True,
),
}
Expand Down Expand Up @@ -299,7 +306,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01-preview",
"api-version", "2023-01-01",
required=True,
),
}
Expand Down Expand Up @@ -365,6 +372,7 @@ def _update_instance(self, instance):
properties.set_prop("availabilityZones", AAZListType, ".availability_zones")
properties.set_prop("baseSizeTiB", AAZIntType, ".base_size_tib", typ_kwargs={"flags": {"required": True}})
properties.set_prop("extendedCapacitySizeTiB", AAZIntType, ".extended_capacity_size_tib", typ_kwargs={"flags": {"required": True}})
properties.set_prop("publicNetworkAccess", AAZStrType, ".public_network_access")
properties.set_prop("sku", AAZObjectType, ".sku", typ_kwargs={"flags": {"required": True}})

availability_zones = _builder.get(".properties.availabilityZones")
Expand Down Expand Up @@ -453,6 +461,9 @@ def _build_schema_elastic_san_read(cls, _schema):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.public_network_access = AAZStrType(
serialized_name="publicNetworkAccess",
)
properties.sku = AAZObjectType(
flags={"required": True},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Wait(AAZWaitCommand):

_aaz_info = {
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2022-12-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2023-01-01"],
]
}

Expand Down Expand Up @@ -121,7 +121,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01-preview",
"api-version", "2023-01-01",
required=True,
),
}
Expand Down Expand Up @@ -196,6 +196,9 @@ def _build_schema_on_200(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.public_network_access = AAZStrType(
serialized_name="publicNetworkAccess",
)
properties.sku = AAZObjectType(
flags={"required": True},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
from ._list import *
from ._show import *
from ._update import *
from ._wait import *
Loading

0 comments on commit ed71cc7

Please sign in to comment.