Skip to content

Commit 1d56e50

Browse files
authored
[Storage-Actions] GA 2023-01-01 (#8893)
* storage-actions GA 2023-01-01 * rerun tests * update version
1 parent 476c0f9 commit 1d56e50

17 files changed

Lines changed: 656 additions & 195 deletions

src/storage-actions/HISTORY.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
33
Release History
44
===============
5+
1.0.0
6+
++++++
7+
* GA Storage Actions with api-version 2023-01-01
58

69
1.0.0b1
710
++++++

src/storage-actions/azext_storage_actions/aaz/latest/storage_actions/__cmd_group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command_group(
1515
"storage-actions",
16-
is_preview=True,
1716
)
1817
class __CMDGroup(AAZCommandGroup):
1918
"""Manage StorageActions

src/storage-actions/azext_storage_actions/aaz/latest/storage_actions/task/__cmd_group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command_group(
1515
"storage-actions task",
16-
is_preview=True,
1716
)
1817
class __CMDGroup(AAZCommandGroup):
1918
"""Manage StorageTask

src/storage-actions/azext_storage_actions/aaz/latest/storage_actions/task/_create.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"storage-actions task create",
16-
is_preview=True,
1716
)
1817
class Create(AAZCommand):
1918
"""Create a new storage task resource with the specified parameters. If a storage task is already created and a subsequent create request is issued with different properties, the storage task properties will be updated. If a storage task is already created and a subsequent create request is issued with the exact same set of properties, the request will succeed.
@@ -84,17 +83,30 @@ def _build_arguments_schema(cls, *args, **kwargs):
8483
)
8584

8685
identity = cls._args_schema.identity
86+
identity.mi_system_assigned = AAZStrArg(
87+
options=["system-assigned", "mi-system-assigned"],
88+
help="Set the system managed identity.",
89+
blank="True",
90+
)
8791
identity.type = AAZStrArg(
8892
options=["type"],
8993
help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).",
9094
required=True,
9195
enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned,UserAssigned": "SystemAssigned,UserAssigned", "UserAssigned": "UserAssigned"},
9296
)
97+
identity.mi_user_assigned = AAZListArg(
98+
options=["user-assigned", "mi-user-assigned"],
99+
help="Set the user managed identities.",
100+
blank=[],
101+
)
93102
identity.user_assigned_identities = AAZDictArg(
94103
options=["user-assigned-identities"],
95104
help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.",
96105
)
97106

107+
mi_user_assigned = cls._args_schema.identity.mi_user_assigned
108+
mi_user_assigned.Element = AAZStrArg()
109+
98110
user_assigned_identities = cls._args_schema.identity.user_assigned_identities
99111
user_assigned_identities.Element = AAZObjectArg(
100112
nullable=True,
@@ -237,7 +249,7 @@ def __call__(self, *args, **kwargs):
237249
session,
238250
self.on_200_201,
239251
self.on_error,
240-
lro_options={"final-state-via": "location"},
252+
lro_options={"final-state-via": "azure-async-operation"},
241253
path_format_arguments=self.url_parameters,
242254
)
243255
if session.http_response.status_code in [200, 201]:
@@ -246,7 +258,7 @@ def __call__(self, *args, **kwargs):
246258
session,
247259
self.on_200_201,
248260
self.on_error,
249-
lro_options={"final-state-via": "location"},
261+
lro_options={"final-state-via": "azure-async-operation"},
250262
path_format_arguments=self.url_parameters,
251263
)
252264

@@ -314,7 +326,7 @@ def content(self):
314326
typ=AAZObjectType,
315327
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
316328
)
317-
_builder.set_prop("identity", AAZObjectType, ".identity", typ_kwargs={"flags": {"required": True}})
329+
_builder.set_prop("identity", AAZIdentityObjectType, ".identity", typ_kwargs={"flags": {"required": True}})
318330
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
319331
_builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}})
320332
_builder.set_prop("tags", AAZDictType, ".tags")
@@ -323,11 +335,17 @@ def content(self):
323335
if identity is not None:
324336
identity.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}})
325337
identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities")
338+
identity.set_prop("userAssigned", AAZListType, ".mi_user_assigned", typ_kwargs={"flags": {"action": "create"}})
339+
identity.set_prop("systemAssigned", AAZStrType, ".mi_system_assigned", typ_kwargs={"flags": {"action": "create"}})
326340

327341
user_assigned_identities = _builder.get(".identity.userAssignedIdentities")
328342
if user_assigned_identities is not None:
329343
user_assigned_identities.set_elements(AAZObjectType, ".", typ_kwargs={"nullable": True})
330344

345+
user_assigned = _builder.get(".identity.userAssigned")
346+
if user_assigned is not None:
347+
user_assigned.set_elements(AAZStrType, ".")
348+
331349
properties = _builder.get(".properties")
332350
if properties is not None:
333351
properties.set_prop("action", AAZObjectType, ".action", typ_kwargs={"flags": {"required": True}})
@@ -383,7 +401,7 @@ def _build_schema_on_200_201(cls):
383401
_schema_on_200_201.id = AAZStrType(
384402
flags={"read_only": True},
385403
)
386-
_schema_on_200_201.identity = AAZObjectType(
404+
_schema_on_200_201.identity = AAZIdentityObjectType(
387405
flags={"required": True},
388406
)
389407
_schema_on_200_201.location = AAZStrType(

src/storage-actions/azext_storage_actions/aaz/latest/storage_actions/task/_delete.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"storage-actions task delete",
16-
is_preview=True,
1716
confirmation="Are you sure you want to perform this operation?",
1817
)
1918
class Delete(AAZCommand):
@@ -88,7 +87,7 @@ def __call__(self, *args, **kwargs):
8887
session,
8988
self.on_200_201,
9089
self.on_error,
91-
lro_options={"final-state-via": "location"},
90+
lro_options={"final-state-via": "azure-async-operation"},
9291
path_format_arguments=self.url_parameters,
9392
)
9493
if session.http_response.status_code in [204]:
@@ -97,7 +96,7 @@ def __call__(self, *args, **kwargs):
9796
session,
9897
self.on_204,
9998
self.on_error,
100-
lro_options={"final-state-via": "location"},
99+
lro_options={"final-state-via": "azure-async-operation"},
101100
path_format_arguments=self.url_parameters,
102101
)
103102
if session.http_response.status_code in [200, 201]:
@@ -106,7 +105,7 @@ def __call__(self, *args, **kwargs):
106105
session,
107106
self.on_200_201,
108107
self.on_error,
109-
lro_options={"final-state-via": "location"},
108+
lro_options={"final-state-via": "azure-async-operation"},
110109
path_format_arguments=self.url_parameters,
111110
)
112111

src/storage-actions/azext_storage_actions/aaz/latest/storage_actions/task/_list.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"storage-actions task list",
16-
is_preview=True,
1716
)
1817
class List(AAZCommand):
1918
"""List all the storage tasks available under the subscription.
@@ -52,12 +51,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
5251

5352
def _execute_operations(self):
5453
self.pre_operations()
55-
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
56-
condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
54+
condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
55+
condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
5756
if condition_0:
58-
self.StorageTasksListByResourceGroup(ctx=self.ctx)()
59-
if condition_1:
6057
self.StorageTasksListBySubscription(ctx=self.ctx)()
58+
if condition_1:
59+
self.StorageTasksListByResourceGroup(ctx=self.ctx)()
6160
self.post_operations()
6261

6362
@register_callback
@@ -73,7 +72,7 @@ def _output(self, *args, **kwargs):
7372
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
7473
return result, next_link
7574

76-
class StorageTasksListByResourceGroup(AAZHttpOperation):
75+
class StorageTasksListBySubscription(AAZHttpOperation):
7776
CLIENT_TYPE = "MgmtClient"
7877

7978
def __call__(self, *args, **kwargs):
@@ -87,7 +86,7 @@ def __call__(self, *args, **kwargs):
8786
@property
8887
def url(self):
8988
return self.client.format_url(
90-
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks",
89+
"/subscriptions/{subscriptionId}/providers/Microsoft.StorageActions/storageTasks",
9190
**self.url_parameters
9291
)
9392

@@ -102,10 +101,6 @@ def error_format(self):
102101
@property
103102
def url_parameters(self):
104103
parameters = {
105-
**self.serialize_url_param(
106-
"resourceGroupName", self.ctx.args.resource_group,
107-
required=True,
108-
),
109104
**self.serialize_url_param(
110105
"subscriptionId", self.ctx.subscription_id,
111106
required=True,
@@ -165,7 +160,7 @@ def _build_schema_on_200(cls):
165160
_element.id = AAZStrType(
166161
flags={"read_only": True},
167162
)
168-
_element.identity = AAZObjectType(
163+
_element.identity = AAZIdentityObjectType(
169164
flags={"required": True},
170165
)
171166
_element.location = AAZStrType(
@@ -292,7 +287,7 @@ def _build_schema_on_200(cls):
292287

293288
return cls._schema_on_200
294289

295-
class StorageTasksListBySubscription(AAZHttpOperation):
290+
class StorageTasksListByResourceGroup(AAZHttpOperation):
296291
CLIENT_TYPE = "MgmtClient"
297292

298293
def __call__(self, *args, **kwargs):
@@ -306,7 +301,7 @@ def __call__(self, *args, **kwargs):
306301
@property
307302
def url(self):
308303
return self.client.format_url(
309-
"/subscriptions/{subscriptionId}/providers/Microsoft.StorageActions/storageTasks",
304+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks",
310305
**self.url_parameters
311306
)
312307

@@ -321,6 +316,10 @@ def error_format(self):
321316
@property
322317
def url_parameters(self):
323318
parameters = {
319+
**self.serialize_url_param(
320+
"resourceGroupName", self.ctx.args.resource_group,
321+
required=True,
322+
),
324323
**self.serialize_url_param(
325324
"subscriptionId", self.ctx.subscription_id,
326325
required=True,
@@ -380,7 +379,7 @@ def _build_schema_on_200(cls):
380379
_element.id = AAZStrType(
381380
flags={"read_only": True},
382381
)
383-
_element.identity = AAZObjectType(
382+
_element.identity = AAZIdentityObjectType(
384383
flags={"required": True},
385384
)
386385
_element.location = AAZStrType(

src/storage-actions/azext_storage_actions/aaz/latest/storage_actions/task/_list_assignment.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"storage-actions task list-assignment",
16-
is_preview=True,
1716
)
1817
class ListAssignment(AAZCommand):
1918
"""List all the storage task assignments available under the given resource group.
@@ -59,7 +58,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
5958
min_length=3,
6059
),
6160
)
62-
_args_schema.maxpagesize = AAZStrArg(
61+
_args_schema.maxpagesize = AAZIntArg(
6362
options=["--maxpagesize"],
6463
help="Optional, specifies the maximum number of storage task assignment Ids to be included in the list response.",
6564
)

src/storage-actions/azext_storage_actions/aaz/latest/storage_actions/task/_list_report.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"storage-actions task list-report",
16-
is_preview=True,
1716
)
1817
class ListReport(AAZCommand):
1918
"""List the storage tasks run report summary for each assignment.
@@ -63,7 +62,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
6362
options=["--filter"],
6463
help="Optional. When specified, it can be used to query using reporting properties.",
6564
)
66-
_args_schema.maxpagesize = AAZStrArg(
65+
_args_schema.maxpagesize = AAZIntArg(
6766
options=["--maxpagesize"],
6867
help="Optional, specifies the maximum number of storage task assignment Ids to be included in the list response.",
6968
)

src/storage-actions/azext_storage_actions/aaz/latest/storage_actions/task/_preview_action.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"storage-actions task preview-action",
16-
is_preview=True,
1716
)
1817
class PreviewAction(AAZCommand):
1918
"""Runs the input conditions against input object metadata properties and designates matched objects in response.

src/storage-actions/azext_storage_actions/aaz/latest/storage_actions/task/_show.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"storage-actions task show",
16-
is_preview=True,
1716
)
1817
class Show(AAZCommand):
1918
"""Get the storage task properties
@@ -162,7 +161,7 @@ def _build_schema_on_200(cls):
162161
_schema_on_200.id = AAZStrType(
163162
flags={"read_only": True},
164163
)
165-
_schema_on_200.identity = AAZObjectType(
164+
_schema_on_200.identity = AAZIdentityObjectType(
166165
flags={"required": True},
167166
)
168167
_schema_on_200.location = AAZStrType(

0 commit comments

Comments
 (0)