Skip to content
Open
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
4 changes: 4 additions & 0 deletions src/connectedmachine/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
2.1.0
+++++
* 2025-02-19-preview is used for aaz generation. Migrated to aaz.

2.0.0b2
+++++
* Update connectedmachine extension image commands and set subscription id as optional.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
from ._show import *
from ._update import *
from ._upgrade_extension import *
from ._wait import *
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class AssessPatches(AAZCommand):
"""

_aaz_info = {
"version": "2024-07-31-preview",
"version": "2025-02-19-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/assesspatches", "2024-07-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/assesspatches", "2025-02-19-preview"],
]
}

Expand Down Expand Up @@ -137,7 +137,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
"api-version", "2025-02-19-preview",
required=True,
),
}
Expand Down Expand Up @@ -286,17 +286,18 @@ def _build_schema_error_detail_read(cls, _schema):
additional_info.Element = AAZObjectType()

_element = _schema_error_detail_read.additional_info.Element
_element.info = AAZObjectType(
_element.info = AAZDictType(
flags={"read_only": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)

info = _schema_error_detail_read.additional_info.Element.info
info.Element = AAZAnyType()

details = _schema_error_detail_read.details
details.Element = AAZObjectType(
flags={"read_only": True},
)
details.Element = AAZObjectType()
cls._build_schema_error_detail_read(details.Element)

_schema.additional_info = cls._schema_error_detail_read.additional_info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2024-11-10-preview",
"version": "2025-02-19-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2024-11-10-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2025-02-19-preview"],
]
}

AZ_SUPPORT_NO_WAIT = True

def _handler(self, command_args):
super()._handler(command_args)
self._execute_operations()
return None
return self.build_lro_poller(self._execute_operations, None)

_args_schema = None

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

def _execute_operations(self):
self.pre_operations()
self.MachinesDelete(ctx=self.ctx)()
yield self.MachinesDelete(ctx=self.ctx)()
self.post_operations()

@register_callback
Expand All @@ -80,10 +81,33 @@ class MachinesDelete(AAZHttpOperation):
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [204]:
return self.on_204(session)
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)

return self.on_error(session.http_response)

Expand Down Expand Up @@ -124,16 +148,16 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-11-10-preview",
"api-version", "2025-02-19-preview",
required=True,
),
}
return parameters

def on_200(self, session):
def on_204(self, session):
pass

def on_204(self, session):
def on_200_201(self, session):
pass


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class InstallPatches(AAZCommand):
"""

_aaz_info = {
"version": "2024-07-31-preview",
"version": "2025-02-19-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/installpatches", "2024-07-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/installpatches", "2025-02-19-preview"],
]
}

Expand Down Expand Up @@ -127,6 +127,17 @@ def _build_arguments_schema(cls, *args, **kwargs):
windows_parameters.max_patch_publish_date = AAZDateTimeArg(
options=["max-patch-publish-date"],
help="This is used to install patches that were published on or before this given max published date.",
fmt=AAZDateTimeFormat(
protocol="iso",
),
)
windows_parameters.patch_name_masks_to_exclude = AAZListArg(
options=["patch-name-masks-to-exclude"],
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.",
)
windows_parameters.patch_name_masks_to_include = AAZListArg(
options=["patch-name-masks-to-include"],
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.",
)

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

kb_numbers_to_include = cls._args_schema.windows_parameters.kb_numbers_to_include
kb_numbers_to_include.Element = AAZStrArg()

patch_name_masks_to_exclude = cls._args_schema.windows_parameters.patch_name_masks_to_exclude
patch_name_masks_to_exclude.Element = AAZStrArg()

patch_name_masks_to_include = cls._args_schema.windows_parameters.patch_name_masks_to_include
patch_name_masks_to_include.Element = AAZStrArg()
return cls._args_schema

def _execute_operations(self):
Expand Down Expand Up @@ -222,7 +239,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
"api-version", "2025-02-19-preview",
required=True,
),
}
Expand Down Expand Up @@ -277,6 +294,8 @@ def content(self):
windows_parameters.set_prop("kbNumbersToExclude", AAZListType, ".kb_numbers_to_exclude")
windows_parameters.set_prop("kbNumbersToInclude", AAZListType, ".kb_numbers_to_include")
windows_parameters.set_prop("maxPatchPublishDate", AAZStrType, ".max_patch_publish_date")
windows_parameters.set_prop("patchNameMasksToExclude", AAZListType, ".patch_name_masks_to_exclude")
windows_parameters.set_prop("patchNameMasksToInclude", AAZListType, ".patch_name_masks_to_include")

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

patch_name_masks_to_exclude = _builder.get(".windowsParameters.patchNameMasksToExclude")
if patch_name_masks_to_exclude is not None:
patch_name_masks_to_exclude.set_elements(AAZStrType, ".")

patch_name_masks_to_include = _builder.get(".windowsParameters.patchNameMasksToInclude")
if patch_name_masks_to_include is not None:
patch_name_masks_to_include.set_elements(AAZStrType, ".")

return self.serialize_content(_content_value)

def on_200(self, session):
Expand Down Expand Up @@ -415,17 +442,18 @@ def _build_schema_error_detail_read(cls, _schema):
additional_info.Element = AAZObjectType()

_element = _schema_error_detail_read.additional_info.Element
_element.info = AAZObjectType(
_element.info = AAZDictType(
flags={"read_only": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)

info = _schema_error_detail_read.additional_info.Element.info
info.Element = AAZAnyType()

details = _schema_error_detail_read.details
details.Element = AAZObjectType(
flags={"read_only": True},
)
details.Element = AAZObjectType()
cls._build_schema_error_detail_read(details.Element)

_schema.additional_info = cls._schema_error_detail_read.additional_info
Expand Down
Loading
Loading