Skip to content

Commit 61c32ec

Browse files
committed
update code
1 parent 65a33e1 commit 61c32ec

52 files changed

Lines changed: 1704 additions & 877 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
from ._show import *
1717
from ._update import *
1818
from ._upgrade_extension import *
19+
from ._wait import *

src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_assess_patches.py

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

2424
_aaz_info = {
25-
"version": "2024-07-31-preview",
25+
"version": "2025-02-19-preview",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/assesspatches", "2024-07-31-preview"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/assesspatches", "2025-02-19-preview"],
2828
]
2929
}
3030

@@ -137,7 +137,7 @@ def url_parameters(self):
137137
def query_parameters(self):
138138
parameters = {
139139
**self.serialize_query_param(
140-
"api-version", "2024-07-31-preview",
140+
"api-version", "2025-02-19-preview",
141141
required=True,
142142
),
143143
}
@@ -286,17 +286,18 @@ def _build_schema_error_detail_read(cls, _schema):
286286
additional_info.Element = AAZObjectType()
287287

288288
_element = _schema_error_detail_read.additional_info.Element
289-
_element.info = AAZObjectType(
289+
_element.info = AAZDictType(
290290
flags={"read_only": True},
291291
)
292292
_element.type = AAZStrType(
293293
flags={"read_only": True},
294294
)
295295

296+
info = _schema_error_detail_read.additional_info.Element.info
297+
info.Element = AAZAnyType()
298+
296299
details = _schema_error_detail_read.details
297-
details.Element = AAZObjectType(
298-
flags={"read_only": True},
299-
)
300+
details.Element = AAZObjectType()
300301
cls._build_schema_error_detail_read(details.Element)
301302

302303
_schema.additional_info = cls._schema_error_detail_read.additional_info

src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_delete.py

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

2525
_aaz_info = {
26-
"version": "2024-11-10-preview",
26+
"version": "2025-02-19-preview",
2727
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2024-11-10-preview"],
28+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2025-02-19-preview"],
2929
]
3030
}
3131

32+
AZ_SUPPORT_NO_WAIT = True
33+
3234
def _handler(self, command_args):
3335
super()._handler(command_args)
34-
self._execute_operations()
35-
return None
36+
return self.build_lro_poller(self._execute_operations, None)
3637

3738
_args_schema = None
3839

@@ -51,7 +52,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
5152
required=True,
5253
id_part="name",
5354
fmt=AAZStrArgFormat(
54-
pattern="^[a-zA-Z0-9-_\.]{1,54}$",
55+
pattern="^[a-zA-Z0-9-_\\.]{1,54}$",
5556
max_length=54,
5657
min_length=1,
5758
),
@@ -63,7 +64,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
6364

6465
def _execute_operations(self):
6566
self.pre_operations()
66-
self.MachinesDelete(ctx=self.ctx)()
67+
yield self.MachinesDelete(ctx=self.ctx)()
6768
self.post_operations()
6869

6970
@register_callback
@@ -80,10 +81,33 @@ class MachinesDelete(AAZHttpOperation):
8081
def __call__(self, *args, **kwargs):
8182
request = self.make_request()
8283
session = self.client.send_request(request=request, stream=False, **kwargs)
83-
if session.http_response.status_code in [200]:
84-
return self.on_200(session)
84+
if session.http_response.status_code in [202]:
85+
return self.client.build_lro_polling(
86+
self.ctx.args.no_wait,
87+
session,
88+
self.on_200_201,
89+
self.on_error,
90+
lro_options={"final-state-via": "azure-async-operation"},
91+
path_format_arguments=self.url_parameters,
92+
)
8593
if session.http_response.status_code in [204]:
86-
return self.on_204(session)
94+
return self.client.build_lro_polling(
95+
self.ctx.args.no_wait,
96+
session,
97+
self.on_204,
98+
self.on_error,
99+
lro_options={"final-state-via": "azure-async-operation"},
100+
path_format_arguments=self.url_parameters,
101+
)
102+
if session.http_response.status_code in [200, 201]:
103+
return self.client.build_lro_polling(
104+
self.ctx.args.no_wait,
105+
session,
106+
self.on_200_201,
107+
self.on_error,
108+
lro_options={"final-state-via": "azure-async-operation"},
109+
path_format_arguments=self.url_parameters,
110+
)
87111

88112
return self.on_error(session.http_response)
89113

@@ -124,16 +148,16 @@ def url_parameters(self):
124148
def query_parameters(self):
125149
parameters = {
126150
**self.serialize_query_param(
127-
"api-version", "2024-11-10-preview",
151+
"api-version", "2025-02-19-preview",
128152
required=True,
129153
),
130154
}
131155
return parameters
132156

133-
def on_200(self, session):
157+
def on_204(self, session):
134158
pass
135159

136-
def on_204(self, session):
160+
def on_200_201(self, session):
137161
pass
138162

139163

src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_install_patches.py

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

2424
_aaz_info = {
25-
"version": "2024-07-31-preview",
25+
"version": "2025-02-19-preview",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/installpatches", "2024-07-31-preview"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/installpatches", "2025-02-19-preview"],
2828
]
2929
}
3030

@@ -127,6 +127,17 @@ def _build_arguments_schema(cls, *args, **kwargs):
127127
windows_parameters.max_patch_publish_date = AAZDateTimeArg(
128128
options=["max-patch-publish-date"],
129129
help="This is used to install patches that were published on or before this given max published date.",
130+
fmt=AAZDateTimeFormat(
131+
protocol="iso",
132+
),
133+
)
134+
windows_parameters.patch_name_masks_to_exclude = AAZListArg(
135+
options=["patch-name-masks-to-exclude"],
136+
help="This is used to exclude patches that match the given patch name masks. Alphanumeric strings and wildcard expressions consisting of * and ? are only supported as input values in the list. Null, empty and only whitespaces strings as inputs values are not supported.",
137+
)
138+
windows_parameters.patch_name_masks_to_include = AAZListArg(
139+
options=["patch-name-masks-to-include"],
140+
help="This is used to include patches that match the given patch name masks. Alphanumeric strings and wildcard expressions consisting of * and ? are only supported as input values in the list. Null, empty and only whitespaces strings as inputs values are not supported.",
130141
)
131142

132143
classifications_to_include = cls._args_schema.windows_parameters.classifications_to_include
@@ -139,6 +150,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
139150

140151
kb_numbers_to_include = cls._args_schema.windows_parameters.kb_numbers_to_include
141152
kb_numbers_to_include.Element = AAZStrArg()
153+
154+
patch_name_masks_to_exclude = cls._args_schema.windows_parameters.patch_name_masks_to_exclude
155+
patch_name_masks_to_exclude.Element = AAZStrArg()
156+
157+
patch_name_masks_to_include = cls._args_schema.windows_parameters.patch_name_masks_to_include
158+
patch_name_masks_to_include.Element = AAZStrArg()
142159
return cls._args_schema
143160

144161
def _execute_operations(self):
@@ -222,7 +239,7 @@ def url_parameters(self):
222239
def query_parameters(self):
223240
parameters = {
224241
**self.serialize_query_param(
225-
"api-version", "2024-07-31-preview",
242+
"api-version", "2025-02-19-preview",
226243
required=True,
227244
),
228245
}
@@ -277,6 +294,8 @@ def content(self):
277294
windows_parameters.set_prop("kbNumbersToExclude", AAZListType, ".kb_numbers_to_exclude")
278295
windows_parameters.set_prop("kbNumbersToInclude", AAZListType, ".kb_numbers_to_include")
279296
windows_parameters.set_prop("maxPatchPublishDate", AAZStrType, ".max_patch_publish_date")
297+
windows_parameters.set_prop("patchNameMasksToExclude", AAZListType, ".patch_name_masks_to_exclude")
298+
windows_parameters.set_prop("patchNameMasksToInclude", AAZListType, ".patch_name_masks_to_include")
280299

281300
classifications_to_include = _builder.get(".windowsParameters.classificationsToInclude")
282301
if classifications_to_include is not None:
@@ -290,6 +309,14 @@ def content(self):
290309
if kb_numbers_to_include is not None:
291310
kb_numbers_to_include.set_elements(AAZStrType, ".")
292311

312+
patch_name_masks_to_exclude = _builder.get(".windowsParameters.patchNameMasksToExclude")
313+
if patch_name_masks_to_exclude is not None:
314+
patch_name_masks_to_exclude.set_elements(AAZStrType, ".")
315+
316+
patch_name_masks_to_include = _builder.get(".windowsParameters.patchNameMasksToInclude")
317+
if patch_name_masks_to_include is not None:
318+
patch_name_masks_to_include.set_elements(AAZStrType, ".")
319+
293320
return self.serialize_content(_content_value)
294321

295322
def on_200(self, session):
@@ -415,17 +442,18 @@ def _build_schema_error_detail_read(cls, _schema):
415442
additional_info.Element = AAZObjectType()
416443

417444
_element = _schema_error_detail_read.additional_info.Element
418-
_element.info = AAZObjectType(
445+
_element.info = AAZDictType(
419446
flags={"read_only": True},
420447
)
421448
_element.type = AAZStrType(
422449
flags={"read_only": True},
423450
)
424451

452+
info = _schema_error_detail_read.additional_info.Element.info
453+
info.Element = AAZAnyType()
454+
425455
details = _schema_error_detail_read.details
426-
details.Element = AAZObjectType(
427-
flags={"read_only": True},
428-
)
456+
details.Element = AAZObjectType()
429457
cls._build_schema_error_detail_read(details.Element)
430458

431459
_schema.additional_info = cls._schema_error_detail_read.additional_info

0 commit comments

Comments
 (0)