Skip to content

Commit 86ec11e

Browse files
committed
[FileShare] Update to API version 2026-09-01
- Add managed identity commands: az fileshare identity assign/remove/show - Add redundancy conversion: az fileshare start-redundancy-conversion, get-redundancy-conversion-status - Update create/update with encryption (CMK), scale mode, and HDD media tier; surface migration state on show - Bump extension version to 1.1.0 Generated from Azure/azure-rest-api-specs#45309.
1 parent 0877d22 commit 86ec11e

34 files changed

Lines changed: 4049 additions & 72 deletions

‎src/fileshare/HISTORY.rst‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Release History
44
===============
55

6+
1.1.0
7+
++++++
8+
* Support for Azure File Shares API version ``2026-09-01``.
9+
* Add managed identity commands: ``az fileshare identity assign/remove/show``.
10+
* Add redundancy conversion commands: ``az fileshare start-redundancy-conversion``, ``az fileshare get-redundancy-conversion-status``.
11+
* Update ``az fileshare create/update`` with encryption (customer-managed key), scale mode, and HDD media tier options.
12+
* Surface file share migration state on ``az fileshare show``.
13+
614
1.0.2
715
++++++
816
* Fix release

‎src/fileshare/azext_fileshare/aaz/latest/fileshare/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
from ._create import *
1414
from ._delete import *
1515
from ._get_provisioning_recommendation import *
16+
from ._get_redundancy_conversion_status import *
1617
from ._limits_show import *
1718
from ._list import *
1819
from ._show import *
20+
from ._start_redundancy_conversion import *
1921
from ._update import *
2022
from ._usage_show import *
2123
from ._wait import *

‎src/fileshare/azext_fileshare/aaz/latest/fileshare/_check_name_availability.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class CheckNameAvailability(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2026-06-01",
25+
"version": "2026-09-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.fileshares/locations/{}/checknameavailability", "2026-06-01"],
27+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.fileshares/locations/{}/checknameavailability", "2026-09-01"],
2828
]
2929
}
3030

@@ -125,7 +125,7 @@ def url_parameters(self):
125125
def query_parameters(self):
126126
parameters = {
127127
**self.serialize_query_param(
128-
"api-version", "2026-06-01",
128+
"api-version", "2026-09-01",
129129
required=True,
130130
),
131131
}

‎src/fileshare/azext_fileshare/aaz/latest/fileshare/_create.py‎

Lines changed: 250 additions & 4 deletions
Large diffs are not rendered by default.

‎src/fileshare/azext_fileshare/aaz/latest/fileshare/_delete.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class Delete(AAZCommand):
2323
"""
2424

2525
_aaz_info = {
26-
"version": "2026-06-01",
26+
"version": "2026-09-01",
2727
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.fileshares/fileshares/{}", "2026-06-01"],
28+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.fileshares/fileshares/{}", "2026-09-01"],
2929
]
3030
}
3131

@@ -146,7 +146,7 @@ def url_parameters(self):
146146
def query_parameters(self):
147147
parameters = {
148148
**self.serialize_query_param(
149-
"api-version", "2026-06-01",
149+
"api-version", "2026-09-01",
150150
required=True,
151151
),
152152
}

‎src/fileshare/azext_fileshare/aaz/latest/fileshare/_get_provisioning_recommendation.py‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class GetProvisioningRecommendation(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2026-06-01",
25+
"version": "2026-09-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.fileshares/locations/{}/getprovisioningrecommendation", "2026-06-01"],
27+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.fileshares/locations/{}/getprovisioningrecommendation", "2026-09-01"],
2828
]
2929
}
3030

@@ -52,12 +52,30 @@ def _build_arguments_schema(cls, *args, **kwargs):
5252
# define Arg Group "Properties"
5353

5454
_args_schema = cls._args_schema
55+
_args_schema.media_tier = AAZStrArg(
56+
options=["--media-tier"],
57+
arg_group="Properties",
58+
help="The storage media tier. Defaults to SSD.",
59+
enum={"HDD": "HDD", "SSD": "SSD"},
60+
)
61+
_args_schema.protocol = AAZStrArg(
62+
options=["--protocol"],
63+
arg_group="Properties",
64+
help="The file sharing protocol. Defaults to NFS.",
65+
enum={"NFS": "NFS"},
66+
)
5567
_args_schema.provisioned_storage_gi_b = AAZIntArg(
5668
options=["--storage-gib", "--provisioned-storage-gib", "--provisioned-storage-gi-b"],
5769
arg_group="Properties",
5870
help="The desired provisioned storage size of the share in GiB. Will be use to calculate the values of remaining provisioning parameters.",
5971
required=True,
6072
)
73+
_args_schema.scale_mode = AAZStrArg(
74+
options=["--scale-mode"],
75+
arg_group="Properties",
76+
help="The scale mode. Defaults to Compatibility.",
77+
enum={"Compatibility": "Compatibility", "Scale": "Scale"},
78+
)
6179
return cls._args_schema
6280

6381
def _execute_operations(self):
@@ -121,7 +139,7 @@ def url_parameters(self):
121139
def query_parameters(self):
122140
parameters = {
123141
**self.serialize_query_param(
124-
"api-version", "2026-06-01",
142+
"api-version", "2026-09-01",
125143
required=True,
126144
),
127145
}
@@ -150,7 +168,10 @@ def content(self):
150168

151169
properties = _builder.get(".properties")
152170
if properties is not None:
171+
properties.set_prop("mediaTier", AAZStrType, ".media_tier")
172+
properties.set_prop("protocol", AAZStrType, ".protocol")
153173
properties.set_prop("provisionedStorageGiB", AAZIntType, ".provisioned_storage_gi_b", typ_kwargs={"flags": {"required": True}})
174+
properties.set_prop("scaleMode", AAZStrType, ".scale_mode")
154175

155176
return self.serialize_content(_content_value)
156177

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
@register_command(
15+
"fileshare get-redundancy-conversion-status",
16+
)
17+
class GetRedundancyConversionStatus(AAZCommand):
18+
"""Gets the status and details of the current or most recent redundancy conversion for the file share.
19+
20+
:example: Get the status of the current or most recent redundancy conversion
21+
az fileshare get-redundancy-conversion-status --resource-name MyFileShare --resource-group MyRG
22+
"""
23+
24+
_aaz_info = {
25+
"version": "2026-09-01",
26+
"resources": [
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.fileshares/fileshares/{}/getredundancyconversionstatus", "2026-09-01"],
28+
]
29+
}
30+
31+
def _handler(self, command_args):
32+
super()._handler(command_args)
33+
self._execute_operations()
34+
return self._output()
35+
36+
_args_schema = None
37+
38+
@classmethod
39+
def _build_arguments_schema(cls, *args, **kwargs):
40+
if cls._args_schema is not None:
41+
return cls._args_schema
42+
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)
43+
44+
# define Arg Group ""
45+
46+
_args_schema = cls._args_schema
47+
_args_schema.resource_group = AAZResourceGroupNameArg(
48+
required=True,
49+
)
50+
_args_schema.resource_name = AAZStrArg(
51+
options=["--resource-name"],
52+
help="The resource name of the file share, as seen by the administrator through Azure Resource Manager.",
53+
required=True,
54+
id_part="name",
55+
fmt=AAZStrArgFormat(
56+
pattern="^([a-z]|[0-9])([a-z]|[0-9]|(-(?!-))){1,61}([a-z]|[0-9])$",
57+
),
58+
)
59+
return cls._args_schema
60+
61+
def _execute_operations(self):
62+
self.pre_operations()
63+
self.FileSharesGetRedundancyConversionStatus(ctx=self.ctx)()
64+
self.post_operations()
65+
66+
@register_callback
67+
def pre_operations(self):
68+
pass
69+
70+
@register_callback
71+
def post_operations(self):
72+
pass
73+
74+
def _output(self, *args, **kwargs):
75+
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
76+
return result
77+
78+
class FileSharesGetRedundancyConversionStatus(AAZHttpOperation):
79+
CLIENT_TYPE = "MgmtClient"
80+
81+
def __call__(self, *args, **kwargs):
82+
request = self.make_request()
83+
session = self.client.send_request(request=request, stream=False, **kwargs)
84+
if session.http_response.status_code in [200]:
85+
return self.on_200(session)
86+
87+
return self.on_error(session.http_response)
88+
89+
@property
90+
def url(self):
91+
return self.client.format_url(
92+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/getRedundancyConversionStatus",
93+
**self.url_parameters
94+
)
95+
96+
@property
97+
def method(self):
98+
return "POST"
99+
100+
@property
101+
def error_format(self):
102+
return "MgmtErrorFormat"
103+
104+
@property
105+
def url_parameters(self):
106+
parameters = {
107+
**self.serialize_url_param(
108+
"resourceGroupName", self.ctx.args.resource_group,
109+
required=True,
110+
),
111+
**self.serialize_url_param(
112+
"resourceName", self.ctx.args.resource_name,
113+
required=True,
114+
),
115+
**self.serialize_url_param(
116+
"subscriptionId", self.ctx.subscription_id,
117+
required=True,
118+
),
119+
}
120+
return parameters
121+
122+
@property
123+
def query_parameters(self):
124+
parameters = {
125+
**self.serialize_query_param(
126+
"api-version", "2026-09-01",
127+
required=True,
128+
),
129+
}
130+
return parameters
131+
132+
@property
133+
def header_parameters(self):
134+
parameters = {
135+
**self.serialize_header_param(
136+
"Accept", "application/json",
137+
),
138+
}
139+
return parameters
140+
141+
def on_200(self, session):
142+
data = self.deserialize_http_content(session)
143+
self.ctx.set_var(
144+
"instance",
145+
data,
146+
schema_builder=self._build_schema_on_200
147+
)
148+
149+
_schema_on_200 = None
150+
151+
@classmethod
152+
def _build_schema_on_200(cls):
153+
if cls._schema_on_200 is not None:
154+
return cls._schema_on_200
155+
156+
cls._schema_on_200 = AAZObjectType()
157+
158+
_schema_on_200 = cls._schema_on_200
159+
_schema_on_200.properties = AAZObjectType(
160+
flags={"required": True},
161+
)
162+
163+
properties = cls._schema_on_200.properties
164+
properties.conversion_failed_detailed_reason = AAZStrType(
165+
serialized_name="conversionFailedDetailedReason",
166+
flags={"read_only": True},
167+
)
168+
properties.conversion_failed_reason = AAZStrType(
169+
serialized_name="conversionFailedReason",
170+
flags={"read_only": True},
171+
)
172+
properties.conversion_status = AAZStrType(
173+
serialized_name="conversionStatus",
174+
flags={"read_only": True},
175+
)
176+
properties.target_redundancy = AAZStrType(
177+
serialized_name="targetRedundancy",
178+
flags={"read_only": True},
179+
)
180+
181+
return cls._schema_on_200
182+
183+
184+
class _GetRedundancyConversionStatusHelper:
185+
"""Helper class for GetRedundancyConversionStatus"""
186+
187+
188+
__all__ = ["GetRedundancyConversionStatus"]

0 commit comments

Comments
 (0)