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/elastic-san/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Release History
===============
1.2.0b3
++++++
* `az elastic-san volume restore`: Support restoring soft-deleted volume
* `az elastic-san volume-group/volume list`: Support listing soft-deleted volume-group/volume
* `az elastic-san volume delete`: Support permanent delete soft-deleted volume
* `az elastic-san volume-group test-backup/test-restore`: Support testing backup volume or restore from disk snapshot

1.2.0b2
++++++
* Update module documentation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ class Create(AAZCommand):

: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}' --public-network-access Enabled --auto-scale-policy-enforcement Enabled --capacity-unit-scale-up-limit-tib 17 --increase-capacity-unit-by-tib 4 --unused-size-tib 24

:example: Create an ElasticSAN with auto scale params
az elastic-san create -n san_name -g rg_name -l eastus2euap --base-size-tib 23 --extended-capacity-size-tib 14 --sku '{name:Premium_LRS,tier:Premium}' --availability-zones 1 --auto-scale-policy-enforcement Enabled --capacity-unit-scale-up-limit-tib 40 --increase-capacity-unit-by-tib 4 --unused-size-tib 24 --availability-zones 1
"""

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

Expand Down Expand Up @@ -239,7 +242,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Delete(AAZCommand):
"""

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

Expand Down Expand Up @@ -148,7 +148,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand Down
34 changes: 17 additions & 17 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 @@ -22,10 +22,10 @@ class List(AAZCommand):
"""

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

Expand All @@ -51,12 +51,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.ElasticSansListByResourceGroup(ctx=self.ctx)()
if condition_1:
self.ElasticSansListBySubscription(ctx=self.ctx)()
if condition_1:
self.ElasticSansListByResourceGroup(ctx=self.ctx)()
self.post_operations()

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

class ElasticSansListByResourceGroup(AAZHttpOperation):
class ElasticSansListBySubscription(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

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

Expand All @@ -101,10 +101,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 @@ -116,7 +112,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand Down Expand Up @@ -317,7 +313,7 @@ def _build_schema_on_200(cls):

return cls._schema_on_200

class ElasticSansListBySubscription(AAZHttpOperation):
class ElasticSansListByResourceGroup(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

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

Expand All @@ -346,6 +342,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 @@ -357,7 +357,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class ListSku(AAZCommand):
"""

_aaz_info = {
"version": "2024-06-01-preview",
"version": "2024-07-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elasticsan/skus", "2024-06-01-preview"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elasticsan/skus", "2024-07-01-preview"],
]
}

Expand Down Expand Up @@ -110,7 +110,7 @@ def query_parameters(self):
"$filter", self.ctx.args.filter,
),
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class Show(AAZCommand):
"""

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

Expand Down Expand Up @@ -125,7 +125,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class Update(AAZCommand):
"""

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

Expand Down Expand Up @@ -239,7 +239,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand Down Expand Up @@ -338,7 +338,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
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/{}", "2024-06-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}", "2024-07-01-preview"],
]
}

Expand Down Expand Up @@ -121,7 +121,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ._create import *
from ._delete import *
from ._list import *
from ._restore import *
from ._show import *
from ._update import *
from ._wait import *
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class Create(AAZCommand):
"""

_aaz_info = {
"version": "2024-06-01-preview",
"version": "2024-07-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}/volumegroups/{}/volumes/{}", "2024-06-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}/volumegroups/{}/volumes/{}", "2024-07-01-preview"],
]
}

Expand Down Expand Up @@ -198,7 +198,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ class Delete(AAZCommand):

:example: Delete a volume with its snapshot
az elastic-san volume delete -g "rg" -e "san_name" -v "vg_name" -n "volume_name" -y --x-ms-delete-snapshots true --x-ms-force-delete true

:example: Delete a deleted volume permanently
az elastic-san volume delete -g rg_name -e san_name -v volume_group_name -n deleted_volume_name -y --delete-type permanent
"""

_aaz_info = {
"version": "2024-06-01-preview",
"version": "2024-07-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}/volumegroups/{}/volumes/{}", "2024-06-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}/volumegroups/{}/volumes/{}", "2024-07-01-preview"],
]
}

Expand All @@ -50,12 +53,12 @@ def _build_arguments_schema(cls, *args, **kwargs):

_args_schema = cls._args_schema
_args_schema.x_ms_delete_snapshots = AAZStrArg(
options=["--x-ms-delete-snapshots"],
options=["--delete-snapshots", "--x-ms-delete-snapshots"],
help="Optional, used to delete snapshots under volume. Allowed value are only true or false. Default value is false.",
enum={"false": "false", "true": "true"},
)
_args_schema.x_ms_force_delete = AAZStrArg(
options=["--x-ms-force-delete"],
options=["--force-delete", "--x-ms-force-delete"],
help="Optional, used to delete volume if active sessions present. Allowed value are only true or false. Default value is false.",
enum={"false": "false", "true": "true"},
)
Expand Down Expand Up @@ -95,6 +98,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
min_length=3,
),
)
_args_schema.delete_type = AAZStrArg(
options=["--delete-type"],
help="Optional. Specifies that the delete operation should be a permanent delete for the soft deleted volume. The value of deleteType can only be 'permanent'.",
is_preview=True,
enum={"permanent": "permanent"},
)
return cls._args_schema

def _execute_operations(self):
Expand Down Expand Up @@ -191,7 +200,10 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"deleteType", self.ctx.args.delete_type,
),
**self.serialize_query_param(
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ class List(AAZCommand):

:example: List Volumes in a Volume Group.
az elastic-san volume list -g "rg" -e "san_name" -v "vg_name"

:example: List soft-deleted volumes
az elastic-san volume list -g rg_name -e san_name -v volume_group_name --access-soft-deleted-resources true
"""

_aaz_info = {
"version": "2024-06-01-preview",
"version": "2024-07-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}/volumegroups/{}/volumes", "2024-06-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elasticsan/elasticsans/{}/volumegroups/{}/volumes", "2024-07-01-preview"],
]
}

Expand All @@ -45,6 +48,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group ""

_args_schema = cls._args_schema
_args_schema.x_ms_access_soft_deleted_resources = AAZStrArg(
options=["--soft-deleted-only", "--access-soft-deleted-resources", "--x-ms-access-soft-deleted-resources"],
help="Optional, returns only soft deleted volumes if set to true. If set to false or if not specified, returns only active volumes.",
is_preview=True,
enum={"false": "false", "true": "true"},
)
_args_schema.elastic_san_name = AAZStrArg(
options=["-e", "--elastic-san", "--elastic-san-name"],
help="The name of the ElasticSan.",
Expand Down Expand Up @@ -140,7 +149,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-01-preview",
"api-version", "2024-07-01-preview",
required=True,
),
}
Expand All @@ -149,6 +158,9 @@ def query_parameters(self):
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"x-ms-access-soft-deleted-resources", self.ctx.args.x_ms_access_soft_deleted_resources,
),
**self.serialize_header_param(
"Accept", "application/json",
),
Expand Down
Loading
Loading