diff --git a/src/connectedmachine/HISTORY.rst b/src/connectedmachine/HISTORY.rst index c434f264b19..52a48b4e6b1 100644 --- a/src/connectedmachine/HISTORY.rst +++ b/src/connectedmachine/HISTORY.rst @@ -2,6 +2,9 @@ Release History =============== +0.6.0 ++++++ +* Add install-patches/assess-patches/Extensionimage API's. 2022/12/27 is used for aaz generation. Migrated to aaz. 0.5.1 +++++ diff --git a/src/connectedmachine/README.md b/src/connectedmachine/README.md index a73a976f4b3..4dfc06bfbb1 100644 --- a/src/connectedmachine/README.md +++ b/src/connectedmachine/README.md @@ -75,16 +75,6 @@ az connectedmachine private-link-scope list --resource-group "my-resource-group" ``` az connectedmachine private-link-scope show --resource-group "my-resource-group" --scope-name "my-privatelinkscope" ``` -##### Show-validation-detail ##### -``` -az connectedmachine private-link-scope show-validation-detail --location "wus2" \ - --private-link-scope-id "f5dc51d3-92ed-4d7e-947a-775ea79b4919" -``` -##### Show-validation-detail-for-machine ##### -``` -az connectedmachine private-link-scope show-validation-detail-for-machine --machine-name "machineName" \ - --resource-group "my-resource-group" -``` ##### Update-tag ##### ``` az connectedmachine private-link-scope update-tag --tags Tag1="Value1" Tag2="Value2" \ diff --git a/src/connectedmachine/azext_connectedmachine/__init__.py b/src/connectedmachine/azext_connectedmachine/__init__.py index 93c378353da..81f952a9db2 100644 --- a/src/connectedmachine/azext_connectedmachine/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/__init__.py @@ -26,6 +26,17 @@ def __init__(self, cli_ctx=None): def load_command_table(self, args): from azext_connectedmachine.generated.commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table + try: + from . import aaz + except ImportError: + aaz = None + if aaz: + load_aaz_command_table( + loader=self, + aaz_pkg_name=aaz.__name__, + args=args + ) load_command_table(self, args) try: from azext_connectedmachine.manual.commands import load_command_table as load_command_table_manual diff --git a/src/connectedmachine/azext_connectedmachine/aaz/__init__.py b/src/connectedmachine/azext_connectedmachine/aaz/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/__init__.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/__cmd_group.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/__cmd_group.py new file mode 100644 index 00000000000..6f01704472f --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "connectedmachine", +) +class __CMDGroup(AAZCommandGroup): + """Manage an Azure Arc-Enabled Server. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/__init__.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/__init__.py new file mode 100644 index 00000000000..15ac6c23c49 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/__init__.py @@ -0,0 +1,18 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._assess_patches import * +from ._delete import * +from ._install_patches import * +from ._list import * +from ._show import * +from ._update import * +from ._upgrade_extension import * diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_assess_patches.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_assess_patches.py new file mode 100644 index 00000000000..1ae0f16f20e --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_assess_patches.py @@ -0,0 +1,301 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine assess-patches", +) +class AssessPatches(AAZCommand): + """Assess patches on an Azure Arc-Enabled Server. + + :example: Sample command for assess-patches + az connectedmachine assess-patches --resource-group MyResourceGroup --name MyMachine + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/assesspatches", "2022-12-27"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the hybrid machine.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.MachinesAssessPatches(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class MachinesAssessPatches(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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 [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "name", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.assessment_activity_id = AAZStrType( + serialized_name="assessmentActivityId", + flags={"read_only": True}, + ) + _schema_on_200.available_patch_count_by_classification = AAZObjectType( + serialized_name="availablePatchCountByClassification", + ) + _schema_on_200.error_details = AAZObjectType( + serialized_name="errorDetails", + ) + _AssessPatchesHelper._build_schema_error_detail_read(_schema_on_200.error_details) + _schema_on_200.last_modified_date_time = AAZStrType( + serialized_name="lastModifiedDateTime", + flags={"read_only": True}, + ) + _schema_on_200.os_type = AAZStrType( + serialized_name="osType", + flags={"read_only": True}, + ) + _schema_on_200.patch_service_used = AAZStrType( + serialized_name="patchServiceUsed", + flags={"read_only": True}, + ) + _schema_on_200.reboot_pending = AAZBoolType( + serialized_name="rebootPending", + flags={"read_only": True}, + ) + _schema_on_200.start_date_time = AAZStrType( + serialized_name="startDateTime", + flags={"read_only": True}, + ) + _schema_on_200.started_by = AAZStrType( + serialized_name="startedBy", + flags={"read_only": True}, + ) + _schema_on_200.status = AAZStrType( + flags={"read_only": True}, + ) + + available_patch_count_by_classification = cls._schema_on_200.available_patch_count_by_classification + available_patch_count_by_classification.critical = AAZIntType( + flags={"read_only": True}, + ) + available_patch_count_by_classification.definition = AAZIntType( + flags={"read_only": True}, + ) + available_patch_count_by_classification.feature_pack = AAZIntType( + serialized_name="featurePack", + flags={"read_only": True}, + ) + available_patch_count_by_classification.other = AAZIntType( + flags={"read_only": True}, + ) + available_patch_count_by_classification.security = AAZIntType( + flags={"read_only": True}, + ) + available_patch_count_by_classification.service_pack = AAZIntType( + serialized_name="servicePack", + flags={"read_only": True}, + ) + available_patch_count_by_classification.tools = AAZIntType( + flags={"read_only": True}, + ) + available_patch_count_by_classification.update_rollup = AAZIntType( + serialized_name="updateRollup", + flags={"read_only": True}, + ) + available_patch_count_by_classification.updates = AAZIntType( + flags={"read_only": True}, + ) + + return cls._schema_on_200 + + +class _AssessPatchesHelper: + """Helper class for AssessPatches""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["AssessPatches"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_delete.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_delete.py new file mode 100644 index 00000000000..66ed632efe5 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_delete.py @@ -0,0 +1,144 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an Azure Arc-Enabled Server. + + :example: Sample command for delete + az connectedmachine delete --name myMachine --resource-group myResourceGroup + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.machine_name = AAZStrArg( + options=["-n", "--name", "--machine-name"], + help="The name of the hybrid machine.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-_\.]{1,54}$", + max_length=54, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MachinesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class MachinesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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 [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_install_patches.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_install_patches.py new file mode 100644 index 00000000000..223315a2661 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_install_patches.py @@ -0,0 +1,430 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine install-patches", +) +class InstallPatches(AAZCommand): + """Install patches on an Azure Arc-Enabled Server. + + :example: Sample command for install-patches + az connectedmachine install-patches --resource-group MyResourceGroup --name MyMachine --maximum-duration PT4H --reboot-setting IfRequired --windows-parameters "{"classificationsToInclude": ["Critical", "Security"]}" + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/installpatches", "2022-12-27"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the hybrid machine.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "InstallPatchesInput" + + _args_schema = cls._args_schema + _args_schema.linux_parameters = AAZObjectArg( + options=["--linux-parameters"], + arg_group="InstallPatchesInput", + help="Input for InstallPatches on a Linux VM, as directly received by the API", + ) + _args_schema.maximum_duration = AAZStrArg( + options=["--maximum-duration"], + arg_group="InstallPatchesInput", + help="Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours)", + required=True, + ) + _args_schema.reboot_setting = AAZStrArg( + options=["--reboot-setting"], + arg_group="InstallPatchesInput", + help="Defines when it is acceptable to reboot a VM during a software update operation.", + required=True, + enum={"Always": "Always", "IfRequired": "IfRequired", "Never": "Never"}, + ) + _args_schema.windows_parameters = AAZObjectArg( + options=["--windows-parameters"], + arg_group="InstallPatchesInput", + help="Input for InstallPatches on a Windows VM, as directly received by the API", + ) + + linux_parameters = cls._args_schema.linux_parameters + linux_parameters.classifications_to_include = AAZListArg( + options=["classifications-to-include"], + help="The update classifications to select when installing patches for Linux.", + ) + linux_parameters.package_name_masks_to_exclude = AAZListArg( + options=["package-name-masks-to-exclude"], + help="packages to exclude in the patch operation. Format: packageName_packageVersion", + ) + linux_parameters.package_name_masks_to_include = AAZListArg( + options=["package-name-masks-to-include"], + help="packages to include in the patch operation. Format: packageName_packageVersion", + ) + + classifications_to_include = cls._args_schema.linux_parameters.classifications_to_include + classifications_to_include.Element = AAZStrArg( + enum={"Critical": "Critical", "Other": "Other", "Security": "Security"}, + ) + + package_name_masks_to_exclude = cls._args_schema.linux_parameters.package_name_masks_to_exclude + package_name_masks_to_exclude.Element = AAZStrArg() + + package_name_masks_to_include = cls._args_schema.linux_parameters.package_name_masks_to_include + package_name_masks_to_include.Element = AAZStrArg() + + windows_parameters = cls._args_schema.windows_parameters + windows_parameters.classifications_to_include = AAZListArg( + options=["classifications-to-include"], + help="The update classifications to select when installing patches for Windows.", + ) + windows_parameters.exclude_kbs_requiring_reboot = AAZBoolArg( + options=["exclude-kbs-requiring-reboot"], + help="Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true.", + ) + windows_parameters.kb_numbers_to_exclude = AAZListArg( + options=["kb-numbers-to-exclude"], + help="Kbs to exclude in the patch operation", + ) + windows_parameters.kb_numbers_to_include = AAZListArg( + options=["kb-numbers-to-include"], + help="Kbs to include in the patch operation", + ) + 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.", + ) + + classifications_to_include = cls._args_schema.windows_parameters.classifications_to_include + classifications_to_include.Element = AAZStrArg( + enum={"Critical": "Critical", "Definition": "Definition", "FeaturePack": "FeaturePack", "Security": "Security", "ServicePack": "ServicePack", "Tools": "Tools", "UpdateRollUp": "UpdateRollUp", "Updates": "Updates"}, + ) + + kb_numbers_to_exclude = cls._args_schema.windows_parameters.kb_numbers_to_exclude + kb_numbers_to_exclude.Element = AAZStrArg() + + kb_numbers_to_include = cls._args_schema.windows_parameters.kb_numbers_to_include + kb_numbers_to_include.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.MachinesInstallPatches(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class MachinesInstallPatches(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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 [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "name", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("linuxParameters", AAZObjectType, ".linux_parameters") + _builder.set_prop("maximumDuration", AAZStrType, ".maximum_duration", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("rebootSetting", AAZStrType, ".reboot_setting", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("windowsParameters", AAZObjectType, ".windows_parameters") + + linux_parameters = _builder.get(".linuxParameters") + if linux_parameters is not None: + linux_parameters.set_prop("classificationsToInclude", AAZListType, ".classifications_to_include") + linux_parameters.set_prop("packageNameMasksToExclude", AAZListType, ".package_name_masks_to_exclude") + linux_parameters.set_prop("packageNameMasksToInclude", AAZListType, ".package_name_masks_to_include") + + classifications_to_include = _builder.get(".linuxParameters.classificationsToInclude") + if classifications_to_include is not None: + classifications_to_include.set_elements(AAZStrType, ".") + + package_name_masks_to_exclude = _builder.get(".linuxParameters.packageNameMasksToExclude") + if package_name_masks_to_exclude is not None: + package_name_masks_to_exclude.set_elements(AAZStrType, ".") + + package_name_masks_to_include = _builder.get(".linuxParameters.packageNameMasksToInclude") + if package_name_masks_to_include is not None: + package_name_masks_to_include.set_elements(AAZStrType, ".") + + windows_parameters = _builder.get(".windowsParameters") + if windows_parameters is not None: + windows_parameters.set_prop("classificationsToInclude", AAZListType, ".classifications_to_include") + windows_parameters.set_prop("excludeKbsRequiringReboot", AAZBoolType, ".exclude_kbs_requiring_reboot") + 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") + + classifications_to_include = _builder.get(".windowsParameters.classificationsToInclude") + if classifications_to_include is not None: + classifications_to_include.set_elements(AAZStrType, ".") + + kb_numbers_to_exclude = _builder.get(".windowsParameters.kbNumbersToExclude") + if kb_numbers_to_exclude is not None: + kb_numbers_to_exclude.set_elements(AAZStrType, ".") + + kb_numbers_to_include = _builder.get(".windowsParameters.kbNumbersToInclude") + if kb_numbers_to_include is not None: + kb_numbers_to_include.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.error_details = AAZObjectType( + serialized_name="errorDetails", + ) + _InstallPatchesHelper._build_schema_error_detail_read(_schema_on_200.error_details) + _schema_on_200.excluded_patch_count = AAZIntType( + serialized_name="excludedPatchCount", + flags={"read_only": True}, + ) + _schema_on_200.failed_patch_count = AAZIntType( + serialized_name="failedPatchCount", + flags={"read_only": True}, + ) + _schema_on_200.installation_activity_id = AAZStrType( + serialized_name="installationActivityId", + flags={"read_only": True}, + ) + _schema_on_200.installed_patch_count = AAZIntType( + serialized_name="installedPatchCount", + flags={"read_only": True}, + ) + _schema_on_200.last_modified_date_time = AAZStrType( + serialized_name="lastModifiedDateTime", + flags={"read_only": True}, + ) + _schema_on_200.maintenance_window_exceeded = AAZBoolType( + serialized_name="maintenanceWindowExceeded", + flags={"read_only": True}, + ) + _schema_on_200.not_selected_patch_count = AAZIntType( + serialized_name="notSelectedPatchCount", + flags={"read_only": True}, + ) + _schema_on_200.os_type = AAZStrType( + serialized_name="osType", + flags={"read_only": True}, + ) + _schema_on_200.patch_service_used = AAZStrType( + serialized_name="patchServiceUsed", + flags={"read_only": True}, + ) + _schema_on_200.pending_patch_count = AAZIntType( + serialized_name="pendingPatchCount", + flags={"read_only": True}, + ) + _schema_on_200.reboot_status = AAZStrType( + serialized_name="rebootStatus", + flags={"read_only": True}, + ) + _schema_on_200.start_date_time = AAZStrType( + serialized_name="startDateTime", + flags={"read_only": True}, + ) + _schema_on_200.started_by = AAZStrType( + serialized_name="startedBy", + flags={"read_only": True}, + ) + _schema_on_200.status = AAZStrType( + flags={"read_only": True}, + ) + + return cls._schema_on_200 + + +class _InstallPatchesHelper: + """Helper class for InstallPatches""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["InstallPatches"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_list.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_list.py new file mode 100644 index 00000000000..5e33a7eb691 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_list.py @@ -0,0 +1,684 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine list", +) +class List(AAZCommand): + """List all the Azure Arc-Enabled Servers in the specified resource group. + + :example: Sample command for list + az connectedmachine list --resource-group myResourceGroup + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MachinesListByResourceGroup(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class MachinesListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @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, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.resources = AAZListType( + flags={"read_only": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _ListHelper._build_schema_system_data_read(_element.system_data) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.value.Element.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType() + + properties = cls._schema_on_200.value.Element.properties + properties.ad_fqdn = AAZStrType( + serialized_name="adFqdn", + flags={"read_only": True}, + ) + properties.agent_configuration = AAZObjectType( + serialized_name="agentConfiguration", + flags={"read_only": True}, + ) + properties.agent_upgrade = AAZObjectType( + serialized_name="agentUpgrade", + ) + properties.agent_version = AAZStrType( + serialized_name="agentVersion", + flags={"read_only": True}, + ) + properties.client_public_key = AAZStrType( + serialized_name="clientPublicKey", + ) + properties.cloud_metadata = AAZObjectType( + serialized_name="cloudMetadata", + ) + properties.detected_properties = AAZDictType( + serialized_name="detectedProperties", + flags={"read_only": True}, + ) + properties.display_name = AAZStrType( + serialized_name="displayName", + flags={"read_only": True}, + ) + properties.dns_fqdn = AAZStrType( + serialized_name="dnsFqdn", + flags={"read_only": True}, + ) + properties.domain_name = AAZStrType( + serialized_name="domainName", + flags={"read_only": True}, + ) + properties.error_details = AAZListType( + serialized_name="errorDetails", + flags={"read_only": True}, + ) + properties.extensions = AAZListType() + properties.last_status_change = AAZStrType( + serialized_name="lastStatusChange", + flags={"read_only": True}, + ) + properties.location_data = AAZObjectType( + serialized_name="locationData", + ) + properties.machine_fqdn = AAZStrType( + serialized_name="machineFqdn", + flags={"read_only": True}, + ) + properties.mssql_discovered = AAZStrType( + serialized_name="mssqlDiscovered", + ) + properties.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + properties.os_profile = AAZObjectType( + serialized_name="osProfile", + ) + properties.os_sku = AAZStrType( + serialized_name="osSku", + flags={"read_only": True}, + ) + properties.os_type = AAZStrType( + serialized_name="osType", + ) + properties.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + properties.parent_cluster_resource_id = AAZStrType( + serialized_name="parentClusterResourceId", + ) + properties.private_link_scope_resource_id = AAZStrType( + serialized_name="privateLinkScopeResourceId", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.service_statuses = AAZObjectType( + serialized_name="serviceStatuses", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.vm_id = AAZStrType( + serialized_name="vmId", + ) + properties.vm_uuid = AAZStrType( + serialized_name="vmUuid", + flags={"read_only": True}, + ) + + agent_configuration = cls._schema_on_200.value.Element.properties.agent_configuration + agent_configuration.config_mode = AAZStrType( + serialized_name="configMode", + flags={"read_only": True}, + ) + agent_configuration.extensions_allow_list = AAZListType( + serialized_name="extensionsAllowList", + flags={"read_only": True}, + ) + agent_configuration.extensions_block_list = AAZListType( + serialized_name="extensionsBlockList", + flags={"read_only": True}, + ) + agent_configuration.extensions_enabled = AAZStrType( + serialized_name="extensionsEnabled", + flags={"read_only": True}, + ) + agent_configuration.guest_configuration_enabled = AAZStrType( + serialized_name="guestConfigurationEnabled", + flags={"read_only": True}, + ) + agent_configuration.incoming_connections_ports = AAZListType( + serialized_name="incomingConnectionsPorts", + flags={"read_only": True}, + ) + agent_configuration.proxy_bypass = AAZListType( + serialized_name="proxyBypass", + flags={"read_only": True}, + ) + agent_configuration.proxy_url = AAZStrType( + serialized_name="proxyUrl", + flags={"read_only": True}, + ) + + extensions_allow_list = cls._schema_on_200.value.Element.properties.agent_configuration.extensions_allow_list + extensions_allow_list.Element = AAZObjectType() + _ListHelper._build_schema_configuration_extension_read(extensions_allow_list.Element) + + extensions_block_list = cls._schema_on_200.value.Element.properties.agent_configuration.extensions_block_list + extensions_block_list.Element = AAZObjectType() + _ListHelper._build_schema_configuration_extension_read(extensions_block_list.Element) + + incoming_connections_ports = cls._schema_on_200.value.Element.properties.agent_configuration.incoming_connections_ports + incoming_connections_ports.Element = AAZStrType() + + proxy_bypass = cls._schema_on_200.value.Element.properties.agent_configuration.proxy_bypass + proxy_bypass.Element = AAZStrType() + + agent_upgrade = cls._schema_on_200.value.Element.properties.agent_upgrade + agent_upgrade.correlation_id = AAZStrType( + serialized_name="correlationId", + ) + agent_upgrade.desired_version = AAZStrType( + serialized_name="desiredVersion", + ) + agent_upgrade.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + agent_upgrade.last_attempt_message = AAZStrType( + serialized_name="lastAttemptMessage", + flags={"read_only": True}, + ) + agent_upgrade.last_attempt_status = AAZStrType( + serialized_name="lastAttemptStatus", + flags={"read_only": True}, + ) + agent_upgrade.last_attempt_timestamp = AAZStrType( + serialized_name="lastAttemptTimestamp", + flags={"read_only": True}, + ) + + cloud_metadata = cls._schema_on_200.value.Element.properties.cloud_metadata + cloud_metadata.provider = AAZStrType( + flags={"read_only": True}, + ) + + detected_properties = cls._schema_on_200.value.Element.properties.detected_properties + detected_properties.Element = AAZStrType() + + error_details = cls._schema_on_200.value.Element.properties.error_details + error_details.Element = AAZObjectType() + _ListHelper._build_schema_error_detail_read(error_details.Element) + + extensions = cls._schema_on_200.value.Element.properties.extensions + extensions.Element = AAZObjectType() + _ListHelper._build_schema_machine_extension_instance_view_read(extensions.Element) + + location_data = cls._schema_on_200.value.Element.properties.location_data + location_data.city = AAZStrType() + location_data.country_or_region = AAZStrType( + serialized_name="countryOrRegion", + ) + location_data.district = AAZStrType() + location_data.name = AAZStrType( + flags={"required": True}, + ) + + os_profile = cls._schema_on_200.value.Element.properties.os_profile + os_profile.computer_name = AAZStrType( + serialized_name="computerName", + flags={"read_only": True}, + ) + os_profile.linux_configuration = AAZObjectType( + serialized_name="linuxConfiguration", + ) + os_profile.windows_configuration = AAZObjectType( + serialized_name="windowsConfiguration", + ) + + linux_configuration = cls._schema_on_200.value.Element.properties.os_profile.linux_configuration + linux_configuration.patch_settings = AAZObjectType( + serialized_name="patchSettings", + flags={"client_flatten": True}, + ) + _ListHelper._build_schema_patch_settings_read(linux_configuration.patch_settings) + + windows_configuration = cls._schema_on_200.value.Element.properties.os_profile.windows_configuration + windows_configuration.patch_settings = AAZObjectType( + serialized_name="patchSettings", + flags={"client_flatten": True}, + ) + _ListHelper._build_schema_patch_settings_read(windows_configuration.patch_settings) + + service_statuses = cls._schema_on_200.value.Element.properties.service_statuses + service_statuses.extension_service = AAZObjectType( + serialized_name="extensionService", + ) + _ListHelper._build_schema_service_status_read(service_statuses.extension_service) + service_statuses.guest_configuration_service = AAZObjectType( + serialized_name="guestConfigurationService", + ) + _ListHelper._build_schema_service_status_read(service_statuses.guest_configuration_service) + + resources = cls._schema_on_200.value.Element.resources + resources.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.resources.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _ListHelper._build_schema_system_data_read(_element.system_data) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.resources.Element.properties + properties.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + properties.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + properties.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + properties.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + _ListHelper._build_schema_machine_extension_instance_view_read(properties.instance_view) + properties.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.publisher = AAZStrType() + properties.settings = AAZFreeFormDictType() + properties.type = AAZStrType() + properties.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + tags = cls._schema_on_200.value.Element.resources.Element.tags + tags.Element = AAZStrType() + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_configuration_extension_read = None + + @classmethod + def _build_schema_configuration_extension_read(cls, _schema): + if cls._schema_configuration_extension_read is not None: + _schema.publisher = cls._schema_configuration_extension_read.publisher + _schema.type = cls._schema_configuration_extension_read.type + return + + cls._schema_configuration_extension_read = _schema_configuration_extension_read = AAZObjectType() + + configuration_extension_read = _schema_configuration_extension_read + configuration_extension_read.publisher = AAZStrType( + flags={"read_only": True}, + ) + configuration_extension_read.type = AAZStrType( + flags={"read_only": True}, + ) + + _schema.publisher = cls._schema_configuration_extension_read.publisher + _schema.type = cls._schema_configuration_extension_read.type + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + _schema_machine_extension_instance_view_read = None + + @classmethod + def _build_schema_machine_extension_instance_view_read(cls, _schema): + if cls._schema_machine_extension_instance_view_read is not None: + _schema.name = cls._schema_machine_extension_instance_view_read.name + _schema.status = cls._schema_machine_extension_instance_view_read.status + _schema.type = cls._schema_machine_extension_instance_view_read.type + _schema.type_handler_version = cls._schema_machine_extension_instance_view_read.type_handler_version + return + + cls._schema_machine_extension_instance_view_read = _schema_machine_extension_instance_view_read = AAZObjectType() + + machine_extension_instance_view_read = _schema_machine_extension_instance_view_read + machine_extension_instance_view_read.name = AAZStrType() + machine_extension_instance_view_read.status = AAZObjectType() + machine_extension_instance_view_read.type = AAZStrType() + machine_extension_instance_view_read.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = _schema_machine_extension_instance_view_read.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + _schema.name = cls._schema_machine_extension_instance_view_read.name + _schema.status = cls._schema_machine_extension_instance_view_read.status + _schema.type = cls._schema_machine_extension_instance_view_read.type + _schema.type_handler_version = cls._schema_machine_extension_instance_view_read.type_handler_version + + _schema_patch_settings_read = None + + @classmethod + def _build_schema_patch_settings_read(cls, _schema): + if cls._schema_patch_settings_read is not None: + _schema.assessment_mode = cls._schema_patch_settings_read.assessment_mode + _schema.patch_mode = cls._schema_patch_settings_read.patch_mode + return + + cls._schema_patch_settings_read = _schema_patch_settings_read = AAZObjectType() + + patch_settings_read = _schema_patch_settings_read + patch_settings_read.assessment_mode = AAZStrType( + serialized_name="assessmentMode", + ) + patch_settings_read.patch_mode = AAZStrType( + serialized_name="patchMode", + ) + + _schema.assessment_mode = cls._schema_patch_settings_read.assessment_mode + _schema.patch_mode = cls._schema_patch_settings_read.patch_mode + + _schema_service_status_read = None + + @classmethod + def _build_schema_service_status_read(cls, _schema): + if cls._schema_service_status_read is not None: + _schema.startup_type = cls._schema_service_status_read.startup_type + _schema.status = cls._schema_service_status_read.status + return + + cls._schema_service_status_read = _schema_service_status_read = AAZObjectType() + + service_status_read = _schema_service_status_read + service_status_read.startup_type = AAZStrType( + serialized_name="startupType", + ) + service_status_read.status = AAZStrType() + + _schema.startup_type = cls._schema_service_status_read.startup_type + _schema.status = cls._schema_service_status_read.status + + _schema_system_data_read = None + + @classmethod + def _build_schema_system_data_read(cls, _schema): + if cls._schema_system_data_read is not None: + _schema.created_at = cls._schema_system_data_read.created_at + _schema.created_by = cls._schema_system_data_read.created_by + _schema.created_by_type = cls._schema_system_data_read.created_by_type + _schema.last_modified_at = cls._schema_system_data_read.last_modified_at + _schema.last_modified_by = cls._schema_system_data_read.last_modified_by + _schema.last_modified_by_type = cls._schema_system_data_read.last_modified_by_type + return + + cls._schema_system_data_read = _schema_system_data_read = AAZObjectType( + flags={"read_only": True} + ) + + system_data_read = _schema_system_data_read + system_data_read.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data_read.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data_read.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data_read.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data_read.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data_read.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.created_at = cls._schema_system_data_read.created_at + _schema.created_by = cls._schema_system_data_read.created_by + _schema.created_by_type = cls._schema_system_data_read.created_by_type + _schema.last_modified_at = cls._schema_system_data_read.last_modified_at + _schema.last_modified_by = cls._schema_system_data_read.last_modified_by + _schema.last_modified_by_type = cls._schema_system_data_read.last_modified_by_type + + +__all__ = ["List"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_show.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_show.py new file mode 100644 index 00000000000..b97c8fe8484 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_show.py @@ -0,0 +1,696 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine show", +) +class Show(AAZCommand): + """Get information about the model view or the instance view of an Azure Arc-Enabled Server. + + :example: Sample command for show + az connectedmachine show --name myMachine --resource-group myResourceGroup + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.machine_name = AAZStrArg( + options=["-n", "--name", "--machine-name"], + help="The name of the hybrid machine.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-_\.]{1,54}$", + max_length=54, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.expand = AAZStrArg( + options=["--expand"], + help="The expand expression to apply on the operation.", + enum={"instanceView": "instanceView"}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MachinesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class MachinesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "$expand", self.ctx.args.expand, + ), + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.resources = AAZListType( + flags={"read_only": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _ShowHelper._build_schema_system_data_read(_schema_on_200.system_data) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType() + + properties = cls._schema_on_200.properties + properties.ad_fqdn = AAZStrType( + serialized_name="adFqdn", + flags={"read_only": True}, + ) + properties.agent_configuration = AAZObjectType( + serialized_name="agentConfiguration", + flags={"read_only": True}, + ) + properties.agent_upgrade = AAZObjectType( + serialized_name="agentUpgrade", + ) + properties.agent_version = AAZStrType( + serialized_name="agentVersion", + flags={"read_only": True}, + ) + properties.client_public_key = AAZStrType( + serialized_name="clientPublicKey", + ) + properties.cloud_metadata = AAZObjectType( + serialized_name="cloudMetadata", + ) + properties.detected_properties = AAZDictType( + serialized_name="detectedProperties", + flags={"read_only": True}, + ) + properties.display_name = AAZStrType( + serialized_name="displayName", + flags={"read_only": True}, + ) + properties.dns_fqdn = AAZStrType( + serialized_name="dnsFqdn", + flags={"read_only": True}, + ) + properties.domain_name = AAZStrType( + serialized_name="domainName", + flags={"read_only": True}, + ) + properties.error_details = AAZListType( + serialized_name="errorDetails", + flags={"read_only": True}, + ) + properties.extensions = AAZListType() + properties.last_status_change = AAZStrType( + serialized_name="lastStatusChange", + flags={"read_only": True}, + ) + properties.location_data = AAZObjectType( + serialized_name="locationData", + ) + properties.machine_fqdn = AAZStrType( + serialized_name="machineFqdn", + flags={"read_only": True}, + ) + properties.mssql_discovered = AAZStrType( + serialized_name="mssqlDiscovered", + ) + properties.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + properties.os_profile = AAZObjectType( + serialized_name="osProfile", + ) + properties.os_sku = AAZStrType( + serialized_name="osSku", + flags={"read_only": True}, + ) + properties.os_type = AAZStrType( + serialized_name="osType", + ) + properties.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + properties.parent_cluster_resource_id = AAZStrType( + serialized_name="parentClusterResourceId", + ) + properties.private_link_scope_resource_id = AAZStrType( + serialized_name="privateLinkScopeResourceId", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.service_statuses = AAZObjectType( + serialized_name="serviceStatuses", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.vm_id = AAZStrType( + serialized_name="vmId", + ) + properties.vm_uuid = AAZStrType( + serialized_name="vmUuid", + flags={"read_only": True}, + ) + + agent_configuration = cls._schema_on_200.properties.agent_configuration + agent_configuration.config_mode = AAZStrType( + serialized_name="configMode", + flags={"read_only": True}, + ) + agent_configuration.extensions_allow_list = AAZListType( + serialized_name="extensionsAllowList", + flags={"read_only": True}, + ) + agent_configuration.extensions_block_list = AAZListType( + serialized_name="extensionsBlockList", + flags={"read_only": True}, + ) + agent_configuration.extensions_enabled = AAZStrType( + serialized_name="extensionsEnabled", + flags={"read_only": True}, + ) + agent_configuration.guest_configuration_enabled = AAZStrType( + serialized_name="guestConfigurationEnabled", + flags={"read_only": True}, + ) + agent_configuration.incoming_connections_ports = AAZListType( + serialized_name="incomingConnectionsPorts", + flags={"read_only": True}, + ) + agent_configuration.proxy_bypass = AAZListType( + serialized_name="proxyBypass", + flags={"read_only": True}, + ) + agent_configuration.proxy_url = AAZStrType( + serialized_name="proxyUrl", + flags={"read_only": True}, + ) + + extensions_allow_list = cls._schema_on_200.properties.agent_configuration.extensions_allow_list + extensions_allow_list.Element = AAZObjectType() + _ShowHelper._build_schema_configuration_extension_read(extensions_allow_list.Element) + + extensions_block_list = cls._schema_on_200.properties.agent_configuration.extensions_block_list + extensions_block_list.Element = AAZObjectType() + _ShowHelper._build_schema_configuration_extension_read(extensions_block_list.Element) + + incoming_connections_ports = cls._schema_on_200.properties.agent_configuration.incoming_connections_ports + incoming_connections_ports.Element = AAZStrType() + + proxy_bypass = cls._schema_on_200.properties.agent_configuration.proxy_bypass + proxy_bypass.Element = AAZStrType() + + agent_upgrade = cls._schema_on_200.properties.agent_upgrade + agent_upgrade.correlation_id = AAZStrType( + serialized_name="correlationId", + ) + agent_upgrade.desired_version = AAZStrType( + serialized_name="desiredVersion", + ) + agent_upgrade.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + agent_upgrade.last_attempt_message = AAZStrType( + serialized_name="lastAttemptMessage", + flags={"read_only": True}, + ) + agent_upgrade.last_attempt_status = AAZStrType( + serialized_name="lastAttemptStatus", + flags={"read_only": True}, + ) + agent_upgrade.last_attempt_timestamp = AAZStrType( + serialized_name="lastAttemptTimestamp", + flags={"read_only": True}, + ) + + cloud_metadata = cls._schema_on_200.properties.cloud_metadata + cloud_metadata.provider = AAZStrType( + flags={"read_only": True}, + ) + + detected_properties = cls._schema_on_200.properties.detected_properties + detected_properties.Element = AAZStrType() + + error_details = cls._schema_on_200.properties.error_details + error_details.Element = AAZObjectType() + _ShowHelper._build_schema_error_detail_read(error_details.Element) + + extensions = cls._schema_on_200.properties.extensions + extensions.Element = AAZObjectType() + _ShowHelper._build_schema_machine_extension_instance_view_read(extensions.Element) + + location_data = cls._schema_on_200.properties.location_data + location_data.city = AAZStrType() + location_data.country_or_region = AAZStrType( + serialized_name="countryOrRegion", + ) + location_data.district = AAZStrType() + location_data.name = AAZStrType( + flags={"required": True}, + ) + + os_profile = cls._schema_on_200.properties.os_profile + os_profile.computer_name = AAZStrType( + serialized_name="computerName", + flags={"read_only": True}, + ) + os_profile.linux_configuration = AAZObjectType( + serialized_name="linuxConfiguration", + ) + os_profile.windows_configuration = AAZObjectType( + serialized_name="windowsConfiguration", + ) + + linux_configuration = cls._schema_on_200.properties.os_profile.linux_configuration + linux_configuration.patch_settings = AAZObjectType( + serialized_name="patchSettings", + flags={"client_flatten": True}, + ) + _ShowHelper._build_schema_patch_settings_read(linux_configuration.patch_settings) + + windows_configuration = cls._schema_on_200.properties.os_profile.windows_configuration + windows_configuration.patch_settings = AAZObjectType( + serialized_name="patchSettings", + flags={"client_flatten": True}, + ) + _ShowHelper._build_schema_patch_settings_read(windows_configuration.patch_settings) + + service_statuses = cls._schema_on_200.properties.service_statuses + service_statuses.extension_service = AAZObjectType( + serialized_name="extensionService", + ) + _ShowHelper._build_schema_service_status_read(service_statuses.extension_service) + service_statuses.guest_configuration_service = AAZObjectType( + serialized_name="guestConfigurationService", + ) + _ShowHelper._build_schema_service_status_read(service_statuses.guest_configuration_service) + + resources = cls._schema_on_200.resources + resources.Element = AAZObjectType() + + _element = cls._schema_on_200.resources.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _ShowHelper._build_schema_system_data_read(_element.system_data) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.resources.Element.properties + properties.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + properties.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + properties.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + properties.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + _ShowHelper._build_schema_machine_extension_instance_view_read(properties.instance_view) + properties.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.publisher = AAZStrType() + properties.settings = AAZFreeFormDictType() + properties.type = AAZStrType() + properties.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + tags = cls._schema_on_200.resources.Element.tags + tags.Element = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_configuration_extension_read = None + + @classmethod + def _build_schema_configuration_extension_read(cls, _schema): + if cls._schema_configuration_extension_read is not None: + _schema.publisher = cls._schema_configuration_extension_read.publisher + _schema.type = cls._schema_configuration_extension_read.type + return + + cls._schema_configuration_extension_read = _schema_configuration_extension_read = AAZObjectType() + + configuration_extension_read = _schema_configuration_extension_read + configuration_extension_read.publisher = AAZStrType( + flags={"read_only": True}, + ) + configuration_extension_read.type = AAZStrType( + flags={"read_only": True}, + ) + + _schema.publisher = cls._schema_configuration_extension_read.publisher + _schema.type = cls._schema_configuration_extension_read.type + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + _schema_machine_extension_instance_view_read = None + + @classmethod + def _build_schema_machine_extension_instance_view_read(cls, _schema): + if cls._schema_machine_extension_instance_view_read is not None: + _schema.name = cls._schema_machine_extension_instance_view_read.name + _schema.status = cls._schema_machine_extension_instance_view_read.status + _schema.type = cls._schema_machine_extension_instance_view_read.type + _schema.type_handler_version = cls._schema_machine_extension_instance_view_read.type_handler_version + return + + cls._schema_machine_extension_instance_view_read = _schema_machine_extension_instance_view_read = AAZObjectType() + + machine_extension_instance_view_read = _schema_machine_extension_instance_view_read + machine_extension_instance_view_read.name = AAZStrType() + machine_extension_instance_view_read.status = AAZObjectType() + machine_extension_instance_view_read.type = AAZStrType() + machine_extension_instance_view_read.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = _schema_machine_extension_instance_view_read.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + _schema.name = cls._schema_machine_extension_instance_view_read.name + _schema.status = cls._schema_machine_extension_instance_view_read.status + _schema.type = cls._schema_machine_extension_instance_view_read.type + _schema.type_handler_version = cls._schema_machine_extension_instance_view_read.type_handler_version + + _schema_patch_settings_read = None + + @classmethod + def _build_schema_patch_settings_read(cls, _schema): + if cls._schema_patch_settings_read is not None: + _schema.assessment_mode = cls._schema_patch_settings_read.assessment_mode + _schema.patch_mode = cls._schema_patch_settings_read.patch_mode + return + + cls._schema_patch_settings_read = _schema_patch_settings_read = AAZObjectType() + + patch_settings_read = _schema_patch_settings_read + patch_settings_read.assessment_mode = AAZStrType( + serialized_name="assessmentMode", + ) + patch_settings_read.patch_mode = AAZStrType( + serialized_name="patchMode", + ) + + _schema.assessment_mode = cls._schema_patch_settings_read.assessment_mode + _schema.patch_mode = cls._schema_patch_settings_read.patch_mode + + _schema_service_status_read = None + + @classmethod + def _build_schema_service_status_read(cls, _schema): + if cls._schema_service_status_read is not None: + _schema.startup_type = cls._schema_service_status_read.startup_type + _schema.status = cls._schema_service_status_read.status + return + + cls._schema_service_status_read = _schema_service_status_read = AAZObjectType() + + service_status_read = _schema_service_status_read + service_status_read.startup_type = AAZStrType( + serialized_name="startupType", + ) + service_status_read.status = AAZStrType() + + _schema.startup_type = cls._schema_service_status_read.startup_type + _schema.status = cls._schema_service_status_read.status + + _schema_system_data_read = None + + @classmethod + def _build_schema_system_data_read(cls, _schema): + if cls._schema_system_data_read is not None: + _schema.created_at = cls._schema_system_data_read.created_at + _schema.created_by = cls._schema_system_data_read.created_by + _schema.created_by_type = cls._schema_system_data_read.created_by_type + _schema.last_modified_at = cls._schema_system_data_read.last_modified_at + _schema.last_modified_by = cls._schema_system_data_read.last_modified_by + _schema.last_modified_by_type = cls._schema_system_data_read.last_modified_by_type + return + + cls._schema_system_data_read = _schema_system_data_read = AAZObjectType( + flags={"read_only": True} + ) + + system_data_read = _schema_system_data_read + system_data_read.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data_read.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data_read.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data_read.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data_read.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data_read.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.created_at = cls._schema_system_data_read.created_at + _schema.created_by = cls._schema_system_data_read.created_by + _schema.created_by_type = cls._schema_system_data_read.created_by_type + _schema.last_modified_at = cls._schema_system_data_read.last_modified_at + _schema.last_modified_by = cls._schema_system_data_read.last_modified_by + _schema.last_modified_by_type = cls._schema_system_data_read.last_modified_by_type + + +__all__ = ["Show"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_update.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_update.py new file mode 100644 index 00000000000..dc61a313bfb --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_update.py @@ -0,0 +1,1233 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine update", +) +class Update(AAZCommand): + """Update an Azure Arc-Enabled Server. Please note some properties can be set only during machine creation. + + :example: Sample command for update + az connectedmachine update --name myMachine --resource-group myResourceGroup --location eastus2euap + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2022-12-27"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.machine_name = AAZStrArg( + options=["-n", "--name", "--machine-name"], + help="The name of the hybrid machine.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-_\.]{1,54}$", + max_length=54, + min_length=1, + ), + ) + + _args_schema.location = AAZStrArg( + options=["--location"], + help="The location of the hybrid machine.", + required=True, + ) + + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.identity = AAZObjectArg( + options=["--identity"], + arg_group="Parameters", + help="Identity for the resource.", + nullable=True, + ) + + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + identity = cls._args_schema.identity + identity.type = AAZStrArg( + options=["type"], + help="The identity type.", + nullable=True, + enum={"SystemAssigned": "SystemAssigned"}, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.agent_upgrade = AAZObjectArg( + options=["--agent-upgrade"], + arg_group="Properties", + help="The info of the machine w.r.t Agent Upgrade", + nullable=True, + ) + _args_schema.client_public_key = AAZStrArg( + options=["--client-public-key"], + arg_group="Properties", + help="Public Key that the client provides to be used during initial resource onboarding", + nullable=True, + ) + _args_schema.extensions = AAZListArg( + options=["--extensions"], + arg_group="Properties", + help="Machine Extensions information (deprecated field)", + nullable=True, + ) + _args_schema.location_data = AAZObjectArg( + options=["--location-data"], + arg_group="Properties", + help="Metadata pertaining to the geographic location of the resource.", + nullable=True, + ) + _args_schema.mssql_discovered = AAZStrArg( + options=["--mssql-discovered"], + arg_group="Properties", + help="Specifies whether any MS SQL instance is discovered on the machine.", + nullable=True, + ) + _args_schema.os_profile = AAZObjectArg( + options=["--os-profile"], + arg_group="Properties", + help="Specifies the operating system settings for the hybrid machine.", + nullable=True, + ) + _args_schema.os_type = AAZStrArg( + options=["--os-type"], + arg_group="Properties", + help="The type of Operating System (windows/linux).", + nullable=True, + ) + _args_schema.parent_cluster_resource_id = AAZStrArg( + options=["--parent-cluster-id"], + arg_group="Properties", + help="The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any.", + nullable=True, + ) + _args_schema.private_link_scope_resource_id = AAZStrArg( + options=["--private-scope-id"], + arg_group="Properties", + help="The resource id of the private link scope this machine is assigned to, if any.", + nullable=True, + ) + _args_schema.service_statuses = AAZObjectArg( + options=["--service-statuses"], + arg_group="Properties", + help="Statuses of dependent services that are reported back to ARM.", + nullable=True, + ) + + agent_upgrade = cls._args_schema.agent_upgrade + agent_upgrade.correlation_id = AAZStrArg( + options=["correlation-id"], + help="The correlation ID passed in from RSM per upgrade.", + nullable=True, + ) + agent_upgrade.desired_version = AAZStrArg( + options=["desired-version"], + help="Specifies the version info w.r.t AgentUpgrade for the machine.", + nullable=True, + ) + agent_upgrade.enable_automatic_upgrade = AAZBoolArg( + options=["enable-automatic-upgrade"], + help="Specifies if RSM should try to upgrade this machine", + nullable=True, + ) + + extensions = cls._args_schema.extensions + extensions.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.extensions.Element + _element.name = AAZStrArg( + options=["name"], + help="The machine extension name.", + nullable=True, + ) + _element.status = AAZObjectArg( + options=["status"], + help="Instance view status.", + nullable=True, + ) + _element.type = AAZStrArg( + options=["type"], + help="Specifies the type of the extension; an example is \"CustomScriptExtension\".", + nullable=True, + ) + _element.type_handler_version = AAZStrArg( + options=["type-handler-version"], + help="Specifies the version of the script handler.", + nullable=True, + ) + + status = cls._args_schema.extensions.Element.status + status.code = AAZStrArg( + options=["code"], + help="The status code.", + nullable=True, + ) + status.display_status = AAZStrArg( + options=["display-status"], + help="The short localizable label for the status.", + nullable=True, + ) + status.level = AAZStrArg( + options=["level"], + help="The level code.", + nullable=True, + enum={"Error": "Error", "Info": "Info", "Warning": "Warning"}, + ) + status.message = AAZStrArg( + options=["message"], + help="The detailed status message, including for alerts and error messages.", + nullable=True, + ) + status.time = AAZDateTimeArg( + options=["time"], + help="The time of the status.", + nullable=True, + ) + + location_data = cls._args_schema.location_data + location_data.city = AAZStrArg( + options=["city"], + help="The city or locality where the resource is located.", + nullable=True, + ) + location_data.country_or_region = AAZStrArg( + options=["country-or-region"], + help="The country or region where the resource is located", + nullable=True, + ) + location_data.district = AAZStrArg( + options=["district"], + help="The district, state, or province where the resource is located.", + nullable=True, + ) + location_data.name = AAZStrArg( + options=["name"], + help="A canonical name for the geographic or physical location.", + fmt=AAZStrArgFormat( + max_length=256, + ), + ) + + os_profile = cls._args_schema.os_profile + os_profile.linux_configuration = AAZObjectArg( + options=["linux-configuration"], + help="Specifies the linux configuration for update management.", + nullable=True, + ) + os_profile.windows_configuration = AAZObjectArg( + options=["windows-configuration"], + help="Specifies the windows configuration for update management.", + nullable=True, + ) + + linux_configuration = cls._args_schema.os_profile.linux_configuration + linux_configuration.patch_settings = AAZObjectArg( + options=["patch-settings"], + nullable=True, + ) + cls._build_args_patch_settings_update(linux_configuration.patch_settings) + + windows_configuration = cls._args_schema.os_profile.windows_configuration + windows_configuration.patch_settings = AAZObjectArg( + options=["patch-settings"], + help="Specifies the patch settings.", + nullable=True, + ) + cls._build_args_patch_settings_update(windows_configuration.patch_settings) + + service_statuses = cls._args_schema.service_statuses + service_statuses.extension_service = AAZObjectArg( + options=["extension-service"], + help="The state of the extension service on the Arc-enabled machine.", + nullable=True, + ) + cls._build_args_service_status_update(service_statuses.extension_service) + service_statuses.guest_configuration_service = AAZObjectArg( + options=["guest-configuration-service"], + help="The state of the guest configuration service on the Arc-enabled machine.", + nullable=True, + ) + cls._build_args_service_status_update(service_statuses.guest_configuration_service) + return cls._args_schema + + _args_patch_settings_update = None + + @classmethod + def _build_args_patch_settings_update(cls, _schema): + if cls._args_patch_settings_update is not None: + _schema.assessment_mode = cls._args_patch_settings_update.assessment_mode + _schema.patch_mode = cls._args_patch_settings_update.patch_mode + return + + cls._args_patch_settings_update = AAZObjectArg( + nullable=True, + ) + + patch_settings_update = cls._args_patch_settings_update + patch_settings_update.assessment_mode = AAZStrArg( + options=["assessment-mode"], + help="Specifies the assessment mode.", + nullable=True, + enum={"AutomaticByPlatform": "AutomaticByPlatform", "ImageDefault": "ImageDefault"}, + ) + patch_settings_update.patch_mode = AAZStrArg( + options=["patch-mode"], + help="Specifies the patch mode.", + nullable=True, + enum={"AutomaticByOS": "AutomaticByOS", "AutomaticByPlatform": "AutomaticByPlatform", "ImageDefault": "ImageDefault", "Manual": "Manual"}, + ) + + _schema.assessment_mode = cls._args_patch_settings_update.assessment_mode + _schema.patch_mode = cls._args_patch_settings_update.patch_mode + + _args_service_status_update = None + + @classmethod + def _build_args_service_status_update(cls, _schema): + if cls._args_service_status_update is not None: + _schema.startup_type = cls._args_service_status_update.startup_type + _schema.status = cls._args_service_status_update.status + return + + cls._args_service_status_update = AAZObjectArg( + nullable=True, + ) + + service_status_update = cls._args_service_status_update + service_status_update.startup_type = AAZStrArg( + options=["startup-type"], + help="The behavior of the service when the Arc-enabled machine starts up.", + nullable=True, + ) + service_status_update.status = AAZStrArg( + options=["status"], + help="The current status of the service.", + nullable=True, + ) + + _schema.startup_type = cls._args_service_status_update.startup_type + _schema.status = cls._args_service_status_update.status + + def _execute_operations(self): + self.pre_operations() + self.MachinesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.MachinesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class MachinesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_machine_read(cls._schema_on_200) + + return cls._schema_on_200 + + class MachinesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_machine_read(cls._schema_on_200) + + return cls._schema_on_200 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("identity", AAZObjectType, ".identity") + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + identity = _builder.get(".identity") + if identity is not None: + identity.set_prop("type", AAZStrType, ".type") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("agentUpgrade", AAZObjectType, ".agent_upgrade") + properties.set_prop("clientPublicKey", AAZStrType, ".client_public_key") + properties.set_prop("extensions", AAZListType, ".extensions") + properties.set_prop("locationData", AAZObjectType, ".location_data") + properties.set_prop("mssqlDiscovered", AAZStrType, ".mssql_discovered") + properties.set_prop("osProfile", AAZObjectType, ".os_profile") + properties.set_prop("osType", AAZStrType, ".os_type") + properties.set_prop("parentClusterResourceId", AAZStrType, ".parent_cluster_resource_id") + properties.set_prop("privateLinkScopeResourceId", AAZStrType, ".private_link_scope_resource_id") + properties.set_prop("serviceStatuses", AAZObjectType, ".service_statuses") + + agent_upgrade = _builder.get(".properties.agentUpgrade") + if agent_upgrade is not None: + agent_upgrade.set_prop("correlationId", AAZStrType, ".correlation_id") + agent_upgrade.set_prop("desiredVersion", AAZStrType, ".desired_version") + agent_upgrade.set_prop("enableAutomaticUpgrade", AAZBoolType, ".enable_automatic_upgrade") + + extensions = _builder.get(".properties.extensions") + if extensions is not None: + extensions.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.extensions[]") + if _elements is not None: + _elements.set_prop("name", AAZStrType, ".name") + _elements.set_prop("status", AAZObjectType, ".status") + _elements.set_prop("type", AAZStrType, ".type") + _elements.set_prop("typeHandlerVersion", AAZStrType, ".type_handler_version") + + status = _builder.get(".properties.extensions[].status") + if status is not None: + status.set_prop("code", AAZStrType, ".code") + status.set_prop("displayStatus", AAZStrType, ".display_status") + status.set_prop("level", AAZStrType, ".level") + status.set_prop("message", AAZStrType, ".message") + status.set_prop("time", AAZStrType, ".time") + + location_data = _builder.get(".properties.locationData") + if location_data is not None: + location_data.set_prop("city", AAZStrType, ".city") + location_data.set_prop("countryOrRegion", AAZStrType, ".country_or_region") + location_data.set_prop("district", AAZStrType, ".district") + location_data.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) + + os_profile = _builder.get(".properties.osProfile") + if os_profile is not None: + os_profile.set_prop("linuxConfiguration", AAZObjectType, ".linux_configuration") + os_profile.set_prop("windowsConfiguration", AAZObjectType, ".windows_configuration") + + linux_configuration = _builder.get(".properties.osProfile.linuxConfiguration") + if linux_configuration is not None: + _UpdateHelper._build_schema_patch_settings_update(linux_configuration.set_prop("patchSettings", AAZObjectType, ".patch_settings", typ_kwargs={"flags": {"client_flatten": True}})) + + windows_configuration = _builder.get(".properties.osProfile.windowsConfiguration") + if windows_configuration is not None: + _UpdateHelper._build_schema_patch_settings_update(windows_configuration.set_prop("patchSettings", AAZObjectType, ".patch_settings", typ_kwargs={"flags": {"client_flatten": True}})) + + service_statuses = _builder.get(".properties.serviceStatuses") + if service_statuses is not None: + _UpdateHelper._build_schema_service_status_update(service_statuses.set_prop("extensionService", AAZObjectType, ".extension_service")) + _UpdateHelper._build_schema_service_status_update(service_statuses.set_prop("guestConfigurationService", AAZObjectType, ".guest_configuration_service")) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + @classmethod + def _build_schema_patch_settings_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("assessmentMode", AAZStrType, ".assessment_mode") + _builder.set_prop("patchMode", AAZStrType, ".patch_mode") + + @classmethod + def _build_schema_service_status_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("startupType", AAZStrType, ".startup_type") + _builder.set_prop("status", AAZStrType, ".status") + + _schema_configuration_extension_read = None + + @classmethod + def _build_schema_configuration_extension_read(cls, _schema): + if cls._schema_configuration_extension_read is not None: + _schema.publisher = cls._schema_configuration_extension_read.publisher + _schema.type = cls._schema_configuration_extension_read.type + return + + cls._schema_configuration_extension_read = _schema_configuration_extension_read = AAZObjectType() + + configuration_extension_read = _schema_configuration_extension_read + configuration_extension_read.publisher = AAZStrType( + flags={"read_only": True}, + ) + configuration_extension_read.type = AAZStrType( + flags={"read_only": True}, + ) + + _schema.publisher = cls._schema_configuration_extension_read.publisher + _schema.type = cls._schema_configuration_extension_read.type + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + _schema_machine_extension_instance_view_read = None + + @classmethod + def _build_schema_machine_extension_instance_view_read(cls, _schema): + if cls._schema_machine_extension_instance_view_read is not None: + _schema.name = cls._schema_machine_extension_instance_view_read.name + _schema.status = cls._schema_machine_extension_instance_view_read.status + _schema.type = cls._schema_machine_extension_instance_view_read.type + _schema.type_handler_version = cls._schema_machine_extension_instance_view_read.type_handler_version + return + + cls._schema_machine_extension_instance_view_read = _schema_machine_extension_instance_view_read = AAZObjectType() + + machine_extension_instance_view_read = _schema_machine_extension_instance_view_read + machine_extension_instance_view_read.name = AAZStrType() + machine_extension_instance_view_read.status = AAZObjectType() + machine_extension_instance_view_read.type = AAZStrType() + machine_extension_instance_view_read.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = _schema_machine_extension_instance_view_read.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + _schema.name = cls._schema_machine_extension_instance_view_read.name + _schema.status = cls._schema_machine_extension_instance_view_read.status + _schema.type = cls._schema_machine_extension_instance_view_read.type + _schema.type_handler_version = cls._schema_machine_extension_instance_view_read.type_handler_version + + _schema_machine_read = None + + @classmethod + def _build_schema_machine_read(cls, _schema): + if cls._schema_machine_read is not None: + _schema.id = cls._schema_machine_read.id + _schema.identity = cls._schema_machine_read.identity + _schema.location = cls._schema_machine_read.location + _schema.name = cls._schema_machine_read.name + _schema.properties = cls._schema_machine_read.properties + _schema.resources = cls._schema_machine_read.resources + _schema.system_data = cls._schema_machine_read.system_data + _schema.tags = cls._schema_machine_read.tags + _schema.type = cls._schema_machine_read.type + return + + cls._schema_machine_read = _schema_machine_read = AAZObjectType() + + machine_read = _schema_machine_read + machine_read.id = AAZStrType( + flags={"read_only": True}, + ) + machine_read.identity = AAZObjectType() + machine_read.location = AAZStrType( + flags={"required": True}, + ) + machine_read.name = AAZStrType( + flags={"read_only": True}, + ) + machine_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + machine_read.resources = AAZListType( + flags={"read_only": True}, + ) + machine_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + cls._build_schema_system_data_read(machine_read.system_data) + machine_read.tags = AAZDictType() + machine_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_machine_read.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType() + + properties = _schema_machine_read.properties + properties.ad_fqdn = AAZStrType( + serialized_name="adFqdn", + flags={"read_only": True}, + ) + properties.agent_configuration = AAZObjectType( + serialized_name="agentConfiguration", + flags={"read_only": True}, + ) + properties.agent_upgrade = AAZObjectType( + serialized_name="agentUpgrade", + ) + properties.agent_version = AAZStrType( + serialized_name="agentVersion", + flags={"read_only": True}, + ) + properties.client_public_key = AAZStrType( + serialized_name="clientPublicKey", + ) + properties.cloud_metadata = AAZObjectType( + serialized_name="cloudMetadata", + ) + properties.detected_properties = AAZDictType( + serialized_name="detectedProperties", + flags={"read_only": True}, + ) + properties.display_name = AAZStrType( + serialized_name="displayName", + flags={"read_only": True}, + ) + properties.dns_fqdn = AAZStrType( + serialized_name="dnsFqdn", + flags={"read_only": True}, + ) + properties.domain_name = AAZStrType( + serialized_name="domainName", + flags={"read_only": True}, + ) + properties.error_details = AAZListType( + serialized_name="errorDetails", + flags={"read_only": True}, + ) + properties.extensions = AAZListType() + properties.last_status_change = AAZStrType( + serialized_name="lastStatusChange", + flags={"read_only": True}, + ) + properties.location_data = AAZObjectType( + serialized_name="locationData", + ) + properties.machine_fqdn = AAZStrType( + serialized_name="machineFqdn", + flags={"read_only": True}, + ) + properties.mssql_discovered = AAZStrType( + serialized_name="mssqlDiscovered", + ) + properties.os_name = AAZStrType( + serialized_name="osName", + flags={"read_only": True}, + ) + properties.os_profile = AAZObjectType( + serialized_name="osProfile", + ) + properties.os_sku = AAZStrType( + serialized_name="osSku", + flags={"read_only": True}, + ) + properties.os_type = AAZStrType( + serialized_name="osType", + ) + properties.os_version = AAZStrType( + serialized_name="osVersion", + flags={"read_only": True}, + ) + properties.parent_cluster_resource_id = AAZStrType( + serialized_name="parentClusterResourceId", + ) + properties.private_link_scope_resource_id = AAZStrType( + serialized_name="privateLinkScopeResourceId", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.service_statuses = AAZObjectType( + serialized_name="serviceStatuses", + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + properties.vm_id = AAZStrType( + serialized_name="vmId", + ) + properties.vm_uuid = AAZStrType( + serialized_name="vmUuid", + flags={"read_only": True}, + ) + + agent_configuration = _schema_machine_read.properties.agent_configuration + agent_configuration.config_mode = AAZStrType( + serialized_name="configMode", + flags={"read_only": True}, + ) + agent_configuration.extensions_allow_list = AAZListType( + serialized_name="extensionsAllowList", + flags={"read_only": True}, + ) + agent_configuration.extensions_block_list = AAZListType( + serialized_name="extensionsBlockList", + flags={"read_only": True}, + ) + agent_configuration.extensions_enabled = AAZStrType( + serialized_name="extensionsEnabled", + flags={"read_only": True}, + ) + agent_configuration.guest_configuration_enabled = AAZStrType( + serialized_name="guestConfigurationEnabled", + flags={"read_only": True}, + ) + agent_configuration.incoming_connections_ports = AAZListType( + serialized_name="incomingConnectionsPorts", + flags={"read_only": True}, + ) + agent_configuration.proxy_bypass = AAZListType( + serialized_name="proxyBypass", + flags={"read_only": True}, + ) + agent_configuration.proxy_url = AAZStrType( + serialized_name="proxyUrl", + flags={"read_only": True}, + ) + + extensions_allow_list = _schema_machine_read.properties.agent_configuration.extensions_allow_list + extensions_allow_list.Element = AAZObjectType() + cls._build_schema_configuration_extension_read(extensions_allow_list.Element) + + extensions_block_list = _schema_machine_read.properties.agent_configuration.extensions_block_list + extensions_block_list.Element = AAZObjectType() + cls._build_schema_configuration_extension_read(extensions_block_list.Element) + + incoming_connections_ports = _schema_machine_read.properties.agent_configuration.incoming_connections_ports + incoming_connections_ports.Element = AAZStrType() + + proxy_bypass = _schema_machine_read.properties.agent_configuration.proxy_bypass + proxy_bypass.Element = AAZStrType() + + agent_upgrade = _schema_machine_read.properties.agent_upgrade + agent_upgrade.correlation_id = AAZStrType( + serialized_name="correlationId", + ) + agent_upgrade.desired_version = AAZStrType( + serialized_name="desiredVersion", + ) + agent_upgrade.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + agent_upgrade.last_attempt_message = AAZStrType( + serialized_name="lastAttemptMessage", + flags={"read_only": True}, + ) + agent_upgrade.last_attempt_status = AAZStrType( + serialized_name="lastAttemptStatus", + flags={"read_only": True}, + ) + agent_upgrade.last_attempt_timestamp = AAZStrType( + serialized_name="lastAttemptTimestamp", + flags={"read_only": True}, + ) + + cloud_metadata = _schema_machine_read.properties.cloud_metadata + cloud_metadata.provider = AAZStrType( + flags={"read_only": True}, + ) + + detected_properties = _schema_machine_read.properties.detected_properties + detected_properties.Element = AAZStrType() + + error_details = _schema_machine_read.properties.error_details + error_details.Element = AAZObjectType() + cls._build_schema_error_detail_read(error_details.Element) + + extensions = _schema_machine_read.properties.extensions + extensions.Element = AAZObjectType() + cls._build_schema_machine_extension_instance_view_read(extensions.Element) + + location_data = _schema_machine_read.properties.location_data + location_data.city = AAZStrType() + location_data.country_or_region = AAZStrType( + serialized_name="countryOrRegion", + ) + location_data.district = AAZStrType() + location_data.name = AAZStrType( + flags={"required": True}, + ) + + os_profile = _schema_machine_read.properties.os_profile + os_profile.computer_name = AAZStrType( + serialized_name="computerName", + flags={"read_only": True}, + ) + os_profile.linux_configuration = AAZObjectType( + serialized_name="linuxConfiguration", + ) + os_profile.windows_configuration = AAZObjectType( + serialized_name="windowsConfiguration", + ) + + linux_configuration = _schema_machine_read.properties.os_profile.linux_configuration + linux_configuration.patch_settings = AAZObjectType( + serialized_name="patchSettings", + flags={"client_flatten": True}, + ) + cls._build_schema_patch_settings_read(linux_configuration.patch_settings) + + windows_configuration = _schema_machine_read.properties.os_profile.windows_configuration + windows_configuration.patch_settings = AAZObjectType( + serialized_name="patchSettings", + flags={"client_flatten": True}, + ) + cls._build_schema_patch_settings_read(windows_configuration.patch_settings) + + service_statuses = _schema_machine_read.properties.service_statuses + service_statuses.extension_service = AAZObjectType( + serialized_name="extensionService", + ) + cls._build_schema_service_status_read(service_statuses.extension_service) + service_statuses.guest_configuration_service = AAZObjectType( + serialized_name="guestConfigurationService", + ) + cls._build_schema_service_status_read(service_statuses.guest_configuration_service) + + resources = _schema_machine_read.resources + resources.Element = AAZObjectType() + + _element = _schema_machine_read.resources.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + cls._build_schema_system_data_read(_element.system_data) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_machine_read.resources.Element.properties + properties.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + properties.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + properties.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + properties.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + cls._build_schema_machine_extension_instance_view_read(properties.instance_view) + properties.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.publisher = AAZStrType() + properties.settings = AAZFreeFormDictType() + properties.type = AAZStrType() + properties.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + tags = _schema_machine_read.resources.Element.tags + tags.Element = AAZStrType() + + tags = _schema_machine_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_machine_read.id + _schema.identity = cls._schema_machine_read.identity + _schema.location = cls._schema_machine_read.location + _schema.name = cls._schema_machine_read.name + _schema.properties = cls._schema_machine_read.properties + _schema.resources = cls._schema_machine_read.resources + _schema.system_data = cls._schema_machine_read.system_data + _schema.tags = cls._schema_machine_read.tags + _schema.type = cls._schema_machine_read.type + + _schema_patch_settings_read = None + + @classmethod + def _build_schema_patch_settings_read(cls, _schema): + if cls._schema_patch_settings_read is not None: + _schema.assessment_mode = cls._schema_patch_settings_read.assessment_mode + _schema.patch_mode = cls._schema_patch_settings_read.patch_mode + return + + cls._schema_patch_settings_read = _schema_patch_settings_read = AAZObjectType() + + patch_settings_read = _schema_patch_settings_read + patch_settings_read.assessment_mode = AAZStrType( + serialized_name="assessmentMode", + ) + patch_settings_read.patch_mode = AAZStrType( + serialized_name="patchMode", + ) + + _schema.assessment_mode = cls._schema_patch_settings_read.assessment_mode + _schema.patch_mode = cls._schema_patch_settings_read.patch_mode + + _schema_service_status_read = None + + @classmethod + def _build_schema_service_status_read(cls, _schema): + if cls._schema_service_status_read is not None: + _schema.startup_type = cls._schema_service_status_read.startup_type + _schema.status = cls._schema_service_status_read.status + return + + cls._schema_service_status_read = _schema_service_status_read = AAZObjectType() + + service_status_read = _schema_service_status_read + service_status_read.startup_type = AAZStrType( + serialized_name="startupType", + ) + service_status_read.status = AAZStrType() + + _schema.startup_type = cls._schema_service_status_read.startup_type + _schema.status = cls._schema_service_status_read.status + + _schema_system_data_read = None + + @classmethod + def _build_schema_system_data_read(cls, _schema): + if cls._schema_system_data_read is not None: + _schema.created_at = cls._schema_system_data_read.created_at + _schema.created_by = cls._schema_system_data_read.created_by + _schema.created_by_type = cls._schema_system_data_read.created_by_type + _schema.last_modified_at = cls._schema_system_data_read.last_modified_at + _schema.last_modified_by = cls._schema_system_data_read.last_modified_by + _schema.last_modified_by_type = cls._schema_system_data_read.last_modified_by_type + return + + cls._schema_system_data_read = _schema_system_data_read = AAZObjectType( + flags={"read_only": True} + ) + + system_data_read = _schema_system_data_read + system_data_read.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data_read.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data_read.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data_read.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data_read.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data_read.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.created_at = cls._schema_system_data_read.created_at + _schema.created_by = cls._schema_system_data_read.created_by + _schema.created_by_type = cls._schema_system_data_read.created_by_type + _schema.last_modified_at = cls._schema_system_data_read.last_modified_at + _schema.last_modified_by = cls._schema_system_data_read.last_modified_by + _schema.last_modified_by_type = cls._schema_system_data_read.last_modified_by_type + + +__all__ = ["Update"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_upgrade_extension.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_upgrade_extension.py new file mode 100644 index 00000000000..b218db23473 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/_upgrade_extension.py @@ -0,0 +1,201 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine upgrade-extension", +) +class UpgradeExtension(AAZCommand): + """Upgrade Extensions of an Azure Arc-Enabled Server. + + :example: Sample command for upgrade-extension + az connectedmachine upgrade-extension --extension-targets "{"Microsoft.Azure.Monitoring": {"targetVersion":"2.0"}, "Microsoft.Compute.CustomScriptExtension":{"targetVersion":"1.10"}}" --machine-name myMachine --resource-group myResourceGroup + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/upgradeextensions", "2022-12-27"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the hybrid machine.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-_\.]{1,54}$", + max_length=54, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "ExtensionUpgradeParameters" + + _args_schema = cls._args_schema + _args_schema.extension_targets = AAZDictArg( + options=["--extension-targets"], + arg_group="ExtensionUpgradeParameters", + help="Describes the Extension Target Properties.", + ) + + extension_targets = cls._args_schema.extension_targets + extension_targets.Element = AAZObjectArg() + + _element = cls._args_schema.extension_targets.Element + _element.target_version = AAZStrArg( + options=["target-version"], + help="Properties for the specified Extension to Upgrade.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.UpgradeExtensions(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class UpgradeExtensions(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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 [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + 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]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("extensionTargets", AAZDictType, ".extension_targets") + + extension_targets = _builder.get(".extensionTargets") + if extension_targets is not None: + extension_targets.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".extensionTargets{}") + if _elements is not None: + _elements.set_prop("targetVersion", AAZStrType, ".target_version") + + return self.serialize_content(_content_value) + + def on_200(self, session): + pass + + +class _UpgradeExtensionHelper: + """Helper class for UpgradeExtension""" + + +__all__ = ["UpgradeExtension"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/__cmd_group.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/__cmd_group.py new file mode 100644 index 00000000000..5fac1ede07a --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "connectedmachine extension", +) +class __CMDGroup(AAZCommandGroup): + """Manage a VM extension on an Azure Arc-Enabled Server. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/__init__.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_create.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_create.py new file mode 100644 index 00000000000..e237e3b20cc --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_create.py @@ -0,0 +1,442 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine extension create", +) +class Create(AAZCommand): + """Create the extension. + + :example: Sample command for extension create + az connectedmachine extension create --name CustomScriptExtension --location eastus2euap --type CustomScriptExtension --publisher Microsoft.Compute --type-handler-version 1.10 --machine-name myMachine --resource-group myResourceGroup + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/extensions/{}", "2022-12-27"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.extension_name = AAZStrArg( + options=["-n", "--name", "--extension-name"], + help="The name of the machine extension.", + required=True, + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the machine where the extension should be created or updated.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-_\.]{1,54}$", + max_length=54, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.location = AAZResourceLocationArg( + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.type = AAZStrArg( + options=["--type"], + help="Specifies the type of the extension; an example is \"CustomScriptExtension\".", + ) + + # define Arg Group "ExtensionParameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="ExtensionParameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.auto_upgrade_minor_version = AAZBoolArg( + options=["--upgrade-minor-ver"], + arg_group="Properties", + help="Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.", + ) + _args_schema.enable_automatic_upgrade = AAZBoolArg( + options=["--enable-auto-upgrade"], + arg_group="Properties", + help="Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available.", + ) + _args_schema.force_update_tag = AAZStrArg( + options=["--force-update-tag"], + arg_group="Properties", + help="How the extension handler should be forced to update even if the extension configuration has not changed.", + ) + _args_schema.instance_view = AAZObjectArg( + options=["--instance-view"], + arg_group="Properties", + help="The machine extension instance view.", + ) + _args_schema.protected_settings = AAZFreeFormDictArg( + options=["--protected-settings"], + arg_group="Properties", + help="The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.", + ) + _args_schema.publisher = AAZStrArg( + options=["--publisher"], + arg_group="Properties", + help="The name of the extension handler publisher.", + ) + _args_schema.settings = AAZFreeFormDictArg( + options=["--settings"], + arg_group="Properties", + help="Json formatted public settings for the extension.", + ) + _args_schema.type_handler_version = AAZStrArg( + options=["--type-handler-version"], + arg_group="Properties", + help="Specifies the version of the script handler.", + ) + + instance_view = cls._args_schema.instance_view + instance_view.name = AAZStrArg( + options=["name"], + help="The machine extension name.", + ) + instance_view.status = AAZObjectArg( + options=["status"], + help="Instance view status.", + ) + instance_view.type = AAZStrArg( + options=["type"], + help="Specifies the type of the extension; an example is \"CustomScriptExtension\".", + ) + instance_view.type_handler_version = AAZStrArg( + options=["type-handler-version"], + help="Specifies the version of the script handler.", + ) + + status = cls._args_schema.instance_view.status + status.code = AAZStrArg( + options=["code"], + help="The status code.", + ) + status.display_status = AAZStrArg( + options=["display-status"], + help="The short localizable label for the status.", + ) + status.level = AAZStrArg( + options=["level"], + help="The level code.", + enum={"Error": "Error", "Info": "Info", "Warning": "Warning"}, + ) + status.message = AAZStrArg( + options=["message"], + help="The detailed status message, including for alerts and error messages.", + ) + status.time = AAZDateTimeArg( + options=["time"], + help="The time of the status.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.MachineExtensionsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class MachineExtensionsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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 [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + 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]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "extensionName", self.ctx.args.extension_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("autoUpgradeMinorVersion", AAZBoolType, ".auto_upgrade_minor_version") + properties.set_prop("enableAutomaticUpgrade", AAZBoolType, ".enable_automatic_upgrade") + properties.set_prop("forceUpdateTag", AAZStrType, ".force_update_tag") + properties.set_prop("instanceView", AAZObjectType, ".instance_view") + properties.set_prop("protectedSettings", AAZFreeFormDictType, ".protected_settings") + properties.set_prop("publisher", AAZStrType, ".publisher") + properties.set_prop("settings", AAZFreeFormDictType, ".settings") + properties.set_prop("type", AAZStrType, ".type") + properties.set_prop("typeHandlerVersion", AAZStrType, ".type_handler_version") + + instance_view = _builder.get(".properties.instanceView") + if instance_view is not None: + instance_view.set_prop("name", AAZStrType, ".name") + instance_view.set_prop("status", AAZObjectType, ".status") + instance_view.set_prop("type", AAZStrType, ".type") + instance_view.set_prop("typeHandlerVersion", AAZStrType, ".type_handler_version") + + status = _builder.get(".properties.instanceView.status") + if status is not None: + status.set_prop("code", AAZStrType, ".code") + status.set_prop("displayStatus", AAZStrType, ".display_status") + status.set_prop("level", AAZStrType, ".level") + status.set_prop("message", AAZStrType, ".message") + status.set_prop("time", AAZStrType, ".time") + + protected_settings = _builder.get(".properties.protectedSettings") + if protected_settings is not None: + protected_settings.set_anytype_elements(".") + + settings = _builder.get(".properties.settings") + if settings is not None: + settings.set_anytype_elements(".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + properties.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + properties.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + properties.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + properties.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.publisher = AAZStrType() + properties.settings = AAZFreeFormDictType() + properties.type = AAZStrType() + properties.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + instance_view = cls._schema_on_200.properties.instance_view + instance_view.name = AAZStrType() + instance_view.status = AAZObjectType() + instance_view.type = AAZStrType() + instance_view.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = cls._schema_on_200.properties.instance_view.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_delete.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_delete.py new file mode 100644 index 00000000000..e306580c553 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_delete.py @@ -0,0 +1,178 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine extension delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the extension. + + :example: Sample command for extension delete + az connectedmachine extension delete --name myName --machine-name myMachine --resource-group myResourceGroup + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/extensions/{}", "2022-12-27"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.extension_name = AAZStrArg( + options=["-n", "--name", "--extension-name"], + help="The name of the machine extension.", + required=True, + id_part="child_name_1", + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the machine where the extension should be deleted.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-_\.]{1,54}$", + max_length=54, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.MachineExtensionsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class MachineExtensionsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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 [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + 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]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + 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.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, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "extensionName", self.ctx.args.extension_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_list.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_list.py new file mode 100644 index 00000000000..e94c54c28f6 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_list.py @@ -0,0 +1,269 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine extension list", +) +class List(AAZCommand): + """Get all extensions of a Non-Azure machine. + + :example: Sample command for extension list + az connectedmachine extension list --machine-name myMachine --resource-group myResourceGroup + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/extensions", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the machine containing the extension.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-_\.]{1,54}$", + max_length=54, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.expand = AAZStrArg( + options=["--expand"], + help="The expand expression to apply on the operation.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MachineExtensionsList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class MachineExtensionsList(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "$expand", self.ctx.args.expand, + ), + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + properties.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + properties.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + properties.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + properties.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.publisher = AAZStrType() + properties.settings = AAZFreeFormDictType() + properties.type = AAZStrType() + properties.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + instance_view = cls._schema_on_200.value.Element.properties.instance_view + instance_view.name = AAZStrType() + instance_view.status = AAZObjectType() + instance_view.type = AAZStrType() + instance_view.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = cls._schema_on_200.value.Element.properties.instance_view.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_show.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_show.py new file mode 100644 index 00000000000..066ff1b5847 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_show.py @@ -0,0 +1,264 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine extension show", +) +class Show(AAZCommand): + """Create or update the extension. + + :example: Sample command for extension show + az connectedmachine extension show --name CustomScriptExtension --machine-name myMachine --resource-group myResourceGroup + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/extensions/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.extension_name = AAZStrArg( + options=["-n", "--name", "--extension-name"], + help="The name of the machine extension.", + required=True, + id_part="child_name_1", + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the machine containing the extension.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-_\.]{1,54}$", + max_length=54, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MachineExtensionsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class MachineExtensionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "extensionName", self.ctx.args.extension_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + properties.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + properties.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + properties.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + properties.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.publisher = AAZStrType() + properties.settings = AAZFreeFormDictType() + properties.type = AAZStrType() + properties.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + instance_view = cls._schema_on_200.properties.instance_view + instance_view.name = AAZStrType() + instance_view.status = AAZObjectType() + instance_view.type = AAZStrType() + instance_view.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = cls._schema_on_200.properties.instance_view.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_update.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_update.py new file mode 100644 index 00000000000..a17981b9236 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_update.py @@ -0,0 +1,606 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine extension update", +) +class Update(AAZCommand): + """Update operation to update the extension. + + :example: Sample command for extension update + az connectedmachine extension update --name CustomScriptExtension --type CustomScriptExtension --publisher Microsoft.Compute --type-handler-version 1.10 --machine-name myMachine --resource-group myResourceGroup + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/extensions/{}", "2022-12-27"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.extension_name = AAZStrArg( + options=["-n", "--name", "--extension-name"], + help="The name of the machine extension.", + required=True, + id_part="child_name_1", + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the machine containing the extension.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-_\.]{1,54}$", + max_length=54, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "ExtensionParameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="ExtensionParameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.auto_upgrade_minor_version = AAZBoolArg( + options=["--upgrade-minor-ver"], + arg_group="Properties", + help="Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.", + nullable=True, + ) + _args_schema.enable_automatic_upgrade = AAZBoolArg( + options=["--enable-auto-upgrade"], + arg_group="Properties", + help="Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available.", + nullable=True, + ) + _args_schema.force_update_tag = AAZStrArg( + options=["--force-update-tag"], + arg_group="Properties", + help="How the extension handler should be forced to update even if the extension configuration has not changed.", + nullable=True, + ) + _args_schema.instance_view = AAZObjectArg( + options=["--instance-view"], + arg_group="Properties", + help="The machine extension instance view.", + nullable=True, + ) + _args_schema.protected_settings = AAZFreeFormDictArg( + options=["--protected-settings"], + arg_group="Properties", + help="The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.", + nullable=True, + ) + _args_schema.publisher = AAZStrArg( + options=["--publisher"], + arg_group="Properties", + help="The name of the extension handler publisher.", + nullable=True, + ) + _args_schema.settings = AAZFreeFormDictArg( + options=["--settings"], + arg_group="Properties", + help="Json formatted public settings for the extension.", + nullable=True, + ) + _args_schema.type = AAZStrArg( + options=["--type"], + arg_group="Properties", + help="Specifies the type of the extension; an example is \"CustomScriptExtension\".", + nullable=True, + ) + _args_schema.type_handler_version = AAZStrArg( + options=["--type-handler-version"], + arg_group="Properties", + help="Specifies the version of the script handler.", + nullable=True, + ) + + instance_view = cls._args_schema.instance_view + instance_view.name = AAZStrArg( + options=["name"], + help="The machine extension name.", + nullable=True, + ) + instance_view.status = AAZObjectArg( + options=["status"], + help="Instance view status.", + nullable=True, + ) + instance_view.type = AAZStrArg( + options=["type"], + help="Specifies the type of the extension; an example is \"CustomScriptExtension\".", + nullable=True, + ) + instance_view.type_handler_version = AAZStrArg( + options=["type-handler-version"], + help="Specifies the version of the script handler.", + nullable=True, + ) + + status = cls._args_schema.instance_view.status + status.code = AAZStrArg( + options=["code"], + help="The status code.", + nullable=True, + ) + status.display_status = AAZStrArg( + options=["display-status"], + help="The short localizable label for the status.", + nullable=True, + ) + status.level = AAZStrArg( + options=["level"], + help="The level code.", + nullable=True, + enum={"Error": "Error", "Info": "Info", "Warning": "Warning"}, + ) + status.message = AAZStrArg( + options=["message"], + help="The detailed status message, including for alerts and error messages.", + nullable=True, + ) + status.time = AAZDateTimeArg( + options=["time"], + help="The time of the status.", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MachineExtensionsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.MachineExtensionsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class MachineExtensionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "extensionName", self.ctx.args.extension_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_machine_extension_read(cls._schema_on_200) + + return cls._schema_on_200 + + class MachineExtensionsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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 [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + 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]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "extensionName", self.ctx.args.extension_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_machine_extension_read(cls._schema_on_200) + + return cls._schema_on_200 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("autoUpgradeMinorVersion", AAZBoolType, ".auto_upgrade_minor_version") + properties.set_prop("enableAutomaticUpgrade", AAZBoolType, ".enable_automatic_upgrade") + properties.set_prop("forceUpdateTag", AAZStrType, ".force_update_tag") + properties.set_prop("instanceView", AAZObjectType, ".instance_view") + properties.set_prop("protectedSettings", AAZFreeFormDictType, ".protected_settings") + properties.set_prop("publisher", AAZStrType, ".publisher") + properties.set_prop("settings", AAZFreeFormDictType, ".settings") + properties.set_prop("type", AAZStrType, ".type") + properties.set_prop("typeHandlerVersion", AAZStrType, ".type_handler_version") + + instance_view = _builder.get(".properties.instanceView") + if instance_view is not None: + instance_view.set_prop("name", AAZStrType, ".name") + instance_view.set_prop("status", AAZObjectType, ".status") + instance_view.set_prop("type", AAZStrType, ".type") + instance_view.set_prop("typeHandlerVersion", AAZStrType, ".type_handler_version") + + status = _builder.get(".properties.instanceView.status") + if status is not None: + status.set_prop("code", AAZStrType, ".code") + status.set_prop("displayStatus", AAZStrType, ".display_status") + status.set_prop("level", AAZStrType, ".level") + status.set_prop("message", AAZStrType, ".message") + status.set_prop("time", AAZStrType, ".time") + + protected_settings = _builder.get(".properties.protectedSettings") + if protected_settings is not None: + protected_settings.set_anytype_elements(".") + + settings = _builder.get(".properties.settings") + if settings is not None: + settings.set_anytype_elements(".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_machine_extension_read = None + + @classmethod + def _build_schema_machine_extension_read(cls, _schema): + if cls._schema_machine_extension_read is not None: + _schema.id = cls._schema_machine_extension_read.id + _schema.location = cls._schema_machine_extension_read.location + _schema.name = cls._schema_machine_extension_read.name + _schema.properties = cls._schema_machine_extension_read.properties + _schema.system_data = cls._schema_machine_extension_read.system_data + _schema.tags = cls._schema_machine_extension_read.tags + _schema.type = cls._schema_machine_extension_read.type + return + + cls._schema_machine_extension_read = _schema_machine_extension_read = AAZObjectType() + + machine_extension_read = _schema_machine_extension_read + machine_extension_read.id = AAZStrType( + flags={"read_only": True}, + ) + machine_extension_read.location = AAZStrType( + flags={"required": True}, + ) + machine_extension_read.name = AAZStrType( + flags={"read_only": True}, + ) + machine_extension_read.properties = AAZObjectType() + machine_extension_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + machine_extension_read.tags = AAZDictType() + machine_extension_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_machine_extension_read.properties + properties.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + properties.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + properties.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + properties.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + properties.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.publisher = AAZStrType() + properties.settings = AAZFreeFormDictType() + properties.type = AAZStrType() + properties.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + instance_view = _schema_machine_extension_read.properties.instance_view + instance_view.name = AAZStrType() + instance_view.status = AAZObjectType() + instance_view.type = AAZStrType() + instance_view.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = _schema_machine_extension_read.properties.instance_view.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + system_data = _schema_machine_extension_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_machine_extension_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_machine_extension_read.id + _schema.location = cls._schema_machine_extension_read.location + _schema.name = cls._schema_machine_extension_read.name + _schema.properties = cls._schema_machine_extension_read.properties + _schema.system_data = cls._schema_machine_extension_read.system_data + _schema.tags = cls._schema_machine_extension_read.tags + _schema.type = cls._schema_machine_extension_read.type + + +__all__ = ["Update"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_wait.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_wait.py new file mode 100644 index 00000000000..bf1201fbab2 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_wait.py @@ -0,0 +1,260 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine extension wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/extensions/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.extension_name = AAZStrArg( + options=["-n", "--name", "--extension-name"], + help="The name of the machine extension.", + required=True, + id_part="child_name_1", + ) + _args_schema.machine_name = AAZStrArg( + options=["--machine-name"], + help="The name of the machine containing the extension.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-_\.]{1,54}$", + max_length=54, + min_length=1, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MachineExtensionsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class MachineExtensionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "extensionName", self.ctx.args.extension_name, + required=True, + ), + **self.serialize_url_param( + "machineName", self.ctx.args.machine_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.auto_upgrade_minor_version = AAZBoolType( + serialized_name="autoUpgradeMinorVersion", + ) + properties.enable_automatic_upgrade = AAZBoolType( + serialized_name="enableAutomaticUpgrade", + ) + properties.force_update_tag = AAZStrType( + serialized_name="forceUpdateTag", + ) + properties.instance_view = AAZObjectType( + serialized_name="instanceView", + ) + properties.protected_settings = AAZFreeFormDictType( + serialized_name="protectedSettings", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.publisher = AAZStrType() + properties.settings = AAZFreeFormDictType() + properties.type = AAZStrType() + properties.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + instance_view = cls._schema_on_200.properties.instance_view + instance_view.name = AAZStrType() + instance_view.status = AAZObjectType() + instance_view.type = AAZStrType() + instance_view.type_handler_version = AAZStrType( + serialized_name="typeHandlerVersion", + ) + + status = cls._schema_on_200.properties.instance_view.status + status.code = AAZStrType() + status.display_status = AAZStrType( + serialized_name="displayStatus", + ) + status.level = AAZStrType() + status.message = AAZStrType() + status.time = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/__cmd_group.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/__cmd_group.py new file mode 100644 index 00000000000..6c5639cc659 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "connectedmachine extension image", +) +class __CMDGroup(AAZCommandGroup): + """Manage VM extension metadata available for Azure Arc-Enabled Servers. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/__init__.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/__init__.py new file mode 100644 index 00000000000..2df85698253 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/__init__.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * +from ._show import * diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/_list.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/_list.py new file mode 100644 index 00000000000..77c8950f3dd --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/_list.py @@ -0,0 +1,228 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine extension image list", +) +class List(AAZCommand): + """List all Extension versions based on location, publisher, extensionType. + + :example: Sample command for extension image list + az connectedmachine extension image list --publisher microsoft.azure.monitor --extension-type azuremonitorlinuxagent --location eastus + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.hybridcompute/locations/{}/publishers/{}/extensiontypes/{}/versions", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.extension_type = AAZStrArg( + options=["--type", "--extension-type"], + help="The extensionType of the Extension being received.", + required=True, + ) + _args_schema.location = AAZResourceLocationArg( + required=True, + ) + _args_schema.publisher = AAZStrArg( + options=["-p", "--publisher"], + help="The publisher of the Extension being received.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ExtensionMetadataList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + return result + + class ExtensionMetadataList(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "extensionType", self.ctx.args.extension_type, + required=True, + ), + **self.serialize_url_param( + "location", self.ctx.args.location, + required=True, + ), + **self.serialize_url_param( + "publisher", self.ctx.args.publisher, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.value = AAZListType( + flags={"read_only": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.extension_type = AAZStrType( + serialized_name="extensionType", + flags={"read_only": True}, + ) + properties.publisher = AAZStrType( + flags={"read_only": True}, + ) + properties.version = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/_show.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/_show.py new file mode 100644 index 00000000000..7f3f84107e1 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/_show.py @@ -0,0 +1,233 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine extension image show", +) +class Show(AAZCommand): + """Get an Extension Metadata based on location, publisher, extensionType and version. + + :example: Sample command for extension image show + az connectedmachine extension image show --publisher microsoft.azure.monitor --extension-type azuremonitorlinuxagent --location eastus --version 1.9.1 + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.hybridcompute/locations/{}/publishers/{}/extensiontypes/{}/versions/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.extension_type = AAZStrArg( + options=["--type", "--extension-type"], + help="The extensionType of the Extension being received.", + required=True, + id_part="child_name_2", + ) + _args_schema.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + _args_schema.publisher = AAZStrArg( + options=["-p", "--publisher"], + help="The publisher of the Extension being received.", + required=True, + id_part="child_name_1", + ) + _args_schema.version = AAZStrArg( + options=["-n", "--name", "--version"], + help="The version of the Extension being received.", + required=True, + id_part="child_name_3", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ExtensionMetadataGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ExtensionMetadataGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "extensionType", self.ctx.args.extension_type, + required=True, + ), + **self.serialize_url_param( + "location", self.ctx.args.location, + required=True, + ), + **self.serialize_url_param( + "publisher", self.ctx.args.publisher, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "version", self.ctx.args.version, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.extension_type = AAZStrType( + serialized_name="extensionType", + flags={"read_only": True}, + ) + properties.publisher = AAZStrType( + flags={"read_only": True}, + ) + properties.version = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/__cmd_group.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/__cmd_group.py new file mode 100644 index 00000000000..a856b139bc9 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "connectedmachine private-endpoint-connection", +) +class __CMDGroup(AAZCommandGroup): + """Manage private endpoint connection with an Azure Arc-Enabled Server. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/__init__.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/__init__.py new file mode 100644 index 00000000000..f32b66e3eeb --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_delete.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_delete.py new file mode 100644 index 00000000000..ba7dbf46d08 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_delete.py @@ -0,0 +1,173 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-endpoint-connection delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a private endpoint connection with a given name. + + :example: Sample command for private-endpoint-connection delete + az connectedmachine private-endpoint-connection delete --name private-endpoint-connection-name --resource-group myResourceGroup --scope-name myPrivateLinkScope + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}/privateendpointconnections/{}", "2022-12-27"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.private_endpoint_connection_name = AAZStrArg( + options=["-n", "--name", "--private-endpoint-connection-name"], + help="The name of the private endpoint connection.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.PrivateEndpointConnectionsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class PrivateEndpointConnectionsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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 [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + 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]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + 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.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, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "privateEndpointConnectionName", self.ctx.args.private_endpoint_connection_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_list.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_list.py new file mode 100644 index 00000000000..84bd4d13939 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_list.py @@ -0,0 +1,243 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-endpoint-connection list", +) +class List(AAZCommand): + """List all private endpoint connections on a private link scope. + + :example: Sample command for private-endpoint-connection list + az connectedmachine private-endpoint-connection list --resource-group myResourceGroup --scope-name myPrivateLinkScope + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}/privateendpointconnections", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PrivateEndpointConnectionsListByPrivateLinkScope(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class PrivateEndpointConnectionsListByPrivateLinkScope(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType( + flags={"read_only": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.group_ids = AAZListType( + serialized_name="groupIds", + flags={"read_only": True}, + ) + properties.private_endpoint = AAZObjectType( + serialized_name="privateEndpoint", + ) + properties.private_link_service_connection_state = AAZObjectType( + serialized_name="privateLinkServiceConnectionState", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + group_ids = cls._schema_on_200.value.Element.properties.group_ids + group_ids.Element = AAZStrType() + + private_endpoint = cls._schema_on_200.value.Element.properties.private_endpoint + private_endpoint.id = AAZStrType() + + private_link_service_connection_state = cls._schema_on_200.value.Element.properties.private_link_service_connection_state + private_link_service_connection_state.actions_required = AAZStrType( + serialized_name="actionsRequired", + flags={"read_only": True}, + ) + private_link_service_connection_state.description = AAZStrType( + flags={"required": True}, + ) + private_link_service_connection_state.status = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_show.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_show.py new file mode 100644 index 00000000000..f3cc8f0cda3 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_show.py @@ -0,0 +1,242 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-endpoint-connection show", +) +class Show(AAZCommand): + """Get a private endpoint connection. + + :example: Sample command for private-endpoint-connection show + az connectedmachine private-endpoint-connection show --name private-endpoint-connection-name --resource-group myResourceGroup --scope-name myPrivateLinkScope + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}/privateendpointconnections/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.private_endpoint_connection_name = AAZStrArg( + options=["-n", "--name", "--private-endpoint-connection-name"], + help="The name of the private endpoint connection.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PrivateEndpointConnectionsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PrivateEndpointConnectionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "privateEndpointConnectionName", self.ctx.args.private_endpoint_connection_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.group_ids = AAZListType( + serialized_name="groupIds", + flags={"read_only": True}, + ) + properties.private_endpoint = AAZObjectType( + serialized_name="privateEndpoint", + ) + properties.private_link_service_connection_state = AAZObjectType( + serialized_name="privateLinkServiceConnectionState", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + group_ids = cls._schema_on_200.properties.group_ids + group_ids.Element = AAZStrType() + + private_endpoint = cls._schema_on_200.properties.private_endpoint + private_endpoint.id = AAZStrType() + + private_link_service_connection_state = cls._schema_on_200.properties.private_link_service_connection_state + private_link_service_connection_state.actions_required = AAZStrType( + serialized_name="actionsRequired", + flags={"read_only": True}, + ) + private_link_service_connection_state.description = AAZStrType( + flags={"required": True}, + ) + private_link_service_connection_state.status = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_update.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_update.py new file mode 100644 index 00000000000..9b936253ec4 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_update.py @@ -0,0 +1,464 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-endpoint-connection update", +) +class Update(AAZCommand): + """Update a private endpoint connection with a given name. + + :example: Sample command for private-endpoint-connection update + az connectedmachine private-endpoint-connection update --connection-state "{{"description":"Rejected by AZ CLI", "status":"Rejected"}}" --name private-endpoint-connection-name --resource-group myResourceGroup --scope-name myPrivateLinkScope + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}/privateendpointconnections/{}", "2022-12-27"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.private_endpoint_connection_name = AAZStrArg( + options=["-n", "--name", "--private-endpoint-connection-name"], + help="The name of the private endpoint connection.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + id_part="name", + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.private_endpoint = AAZObjectArg( + options=["--private-endpoint"], + arg_group="Properties", + help="Private endpoint which the connection belongs to.", + nullable=True, + ) + _args_schema.private_link_service_connection_state = AAZObjectArg( + options=["--connection-state", "--private-link-service-connection-state"], + arg_group="Properties", + help="Connection state of the private endpoint connection.", + nullable=True, + ) + + private_endpoint = cls._args_schema.private_endpoint + private_endpoint.id = AAZStrArg( + options=["id"], + help="Resource id of the private endpoint.", + nullable=True, + ) + + private_link_service_connection_state = cls._args_schema.private_link_service_connection_state + private_link_service_connection_state.description = AAZStrArg( + options=["description"], + help="The private link service connection description.", + ) + private_link_service_connection_state.status = AAZStrArg( + options=["status"], + help="The private link service connection status.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PrivateEndpointConnectionsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.PrivateEndpointConnectionsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PrivateEndpointConnectionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "privateEndpointConnectionName", self.ctx.args.private_endpoint_connection_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_private_endpoint_connection_read(cls._schema_on_200) + + return cls._schema_on_200 + + class PrivateEndpointConnectionsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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 [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + 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]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "privateEndpointConnectionName", self.ctx.args.private_endpoint_connection_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_private_endpoint_connection_read(cls._schema_on_200) + + return cls._schema_on_200 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("privateEndpoint", AAZObjectType, ".private_endpoint") + properties.set_prop("privateLinkServiceConnectionState", AAZObjectType, ".private_link_service_connection_state") + + private_endpoint = _builder.get(".properties.privateEndpoint") + if private_endpoint is not None: + private_endpoint.set_prop("id", AAZStrType, ".id") + + private_link_service_connection_state = _builder.get(".properties.privateLinkServiceConnectionState") + if private_link_service_connection_state is not None: + private_link_service_connection_state.set_prop("description", AAZStrType, ".description", typ_kwargs={"flags": {"required": True}}) + private_link_service_connection_state.set_prop("status", AAZStrType, ".status", typ_kwargs={"flags": {"required": True}}) + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_private_endpoint_connection_read = None + + @classmethod + def _build_schema_private_endpoint_connection_read(cls, _schema): + if cls._schema_private_endpoint_connection_read is not None: + _schema.id = cls._schema_private_endpoint_connection_read.id + _schema.name = cls._schema_private_endpoint_connection_read.name + _schema.properties = cls._schema_private_endpoint_connection_read.properties + _schema.system_data = cls._schema_private_endpoint_connection_read.system_data + _schema.type = cls._schema_private_endpoint_connection_read.type + return + + cls._schema_private_endpoint_connection_read = _schema_private_endpoint_connection_read = AAZObjectType() + + private_endpoint_connection_read = _schema_private_endpoint_connection_read + private_endpoint_connection_read.id = AAZStrType( + flags={"read_only": True}, + ) + private_endpoint_connection_read.name = AAZStrType( + flags={"read_only": True}, + ) + private_endpoint_connection_read.properties = AAZObjectType() + private_endpoint_connection_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + private_endpoint_connection_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_private_endpoint_connection_read.properties + properties.group_ids = AAZListType( + serialized_name="groupIds", + flags={"read_only": True}, + ) + properties.private_endpoint = AAZObjectType( + serialized_name="privateEndpoint", + ) + properties.private_link_service_connection_state = AAZObjectType( + serialized_name="privateLinkServiceConnectionState", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + group_ids = _schema_private_endpoint_connection_read.properties.group_ids + group_ids.Element = AAZStrType() + + private_endpoint = _schema_private_endpoint_connection_read.properties.private_endpoint + private_endpoint.id = AAZStrType() + + private_link_service_connection_state = _schema_private_endpoint_connection_read.properties.private_link_service_connection_state + private_link_service_connection_state.actions_required = AAZStrType( + serialized_name="actionsRequired", + flags={"read_only": True}, + ) + private_link_service_connection_state.description = AAZStrType( + flags={"required": True}, + ) + private_link_service_connection_state.status = AAZStrType( + flags={"required": True}, + ) + + system_data = _schema_private_endpoint_connection_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.id = cls._schema_private_endpoint_connection_read.id + _schema.name = cls._schema_private_endpoint_connection_read.name + _schema.properties = cls._schema_private_endpoint_connection_read.properties + _schema.system_data = cls._schema_private_endpoint_connection_read.system_data + _schema.type = cls._schema_private_endpoint_connection_read.type + + +__all__ = ["Update"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_wait.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_wait.py new file mode 100644 index 00000000000..270b476281b --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_wait.py @@ -0,0 +1,238 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-endpoint-connection wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}/privateendpointconnections/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.private_endpoint_connection_name = AAZStrArg( + options=["-n", "--name", "--private-endpoint-connection-name"], + help="The name of the private endpoint connection.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PrivateEndpointConnectionsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class PrivateEndpointConnectionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "privateEndpointConnectionName", self.ctx.args.private_endpoint_connection_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.group_ids = AAZListType( + serialized_name="groupIds", + flags={"read_only": True}, + ) + properties.private_endpoint = AAZObjectType( + serialized_name="privateEndpoint", + ) + properties.private_link_service_connection_state = AAZObjectType( + serialized_name="privateLinkServiceConnectionState", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + group_ids = cls._schema_on_200.properties.group_ids + group_ids.Element = AAZStrType() + + private_endpoint = cls._schema_on_200.properties.private_endpoint + private_endpoint.id = AAZStrType() + + private_link_service_connection_state = cls._schema_on_200.properties.private_link_service_connection_state + private_link_service_connection_state.actions_required = AAZStrType( + serialized_name="actionsRequired", + flags={"read_only": True}, + ) + private_link_service_connection_state.description = AAZStrType( + flags={"required": True}, + ) + private_link_service_connection_state.status = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/__cmd_group.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/__cmd_group.py new file mode 100644 index 00000000000..1ac6f8a940c --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "connectedmachine private-link-resource", +) +class __CMDGroup(AAZCommandGroup): + """Manage private link resource of an Azure Arc-Enabled Server. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/__init__.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/__init__.py new file mode 100644 index 00000000000..2df85698253 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/__init__.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * +from ._show import * diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/_list.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/_list.py new file mode 100644 index 00000000000..a17bfe9aee1 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/_list.py @@ -0,0 +1,229 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-link-resource list", +) +class List(AAZCommand): + """List the private link resources that need to be created for an Azure Monitor PrivateLinkScope. + + :example: Sample command for private-link-resource list + az connectedmachine private-link-resource list --resource-group myResourceGroup --scope-name myPrivateLinkScope + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}/privatelinkresources", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["-n", "--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PrivateLinkResourcesListByPrivateLinkScope(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class PrivateLinkResourcesListByPrivateLinkScope(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType( + flags={"read_only": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.group_id = AAZStrType( + serialized_name="groupId", + flags={"read_only": True}, + ) + properties.required_members = AAZListType( + serialized_name="requiredMembers", + flags={"read_only": True}, + ) + properties.required_zone_names = AAZListType( + serialized_name="requiredZoneNames", + flags={"read_only": True}, + ) + + required_members = cls._schema_on_200.value.Element.properties.required_members + required_members.Element = AAZStrType() + + required_zone_names = cls._schema_on_200.value.Element.properties.required_zone_names + required_zone_names.Element = AAZStrType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/_show.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/_show.py new file mode 100644 index 00000000000..05dac137134 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/_show.py @@ -0,0 +1,228 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-link-resource show", +) +class Show(AAZCommand): + """Get the private link resources that need to be created for an Azure Monitor PrivateLinkScope. + + :example: Sample command for private-link-resource show + az connectedmachine private-link-resource show --group-name hybridcompute --resource-group myResourceGroup --scope-name myPrivateLinkScope + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}/privatelinkresources/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.group_name = AAZStrArg( + options=["-n", "--name", "--group-name"], + help="The name of the private link resource.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PrivateLinkResourcesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PrivateLinkResourcesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "groupName", self.ctx.args.group_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.group_id = AAZStrType( + serialized_name="groupId", + flags={"read_only": True}, + ) + properties.required_members = AAZListType( + serialized_name="requiredMembers", + flags={"read_only": True}, + ) + properties.required_zone_names = AAZListType( + serialized_name="requiredZoneNames", + flags={"read_only": True}, + ) + + required_members = cls._schema_on_200.properties.required_members + required_members.Element = AAZStrType() + + required_zone_names = cls._schema_on_200.properties.required_zone_names + required_zone_names.Element = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/__cmd_group.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/__cmd_group.py new file mode 100644 index 00000000000..905688a7d98 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "connectedmachine private-link-scope", +) +class __CMDGroup(AAZCommandGroup): + """Manage private link scope of an Azure Arc-Enabled Server. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/__init__.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_create.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_create.py new file mode 100644 index 00000000000..10c32cfed9f --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_create.py @@ -0,0 +1,325 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-link-scope create", +) +class Create(AAZCommand): + """Create (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + + :example: Sample command for private-link-scope create + az connectedmachine private-link-scope create --location westus --resource-group my-resource-group --scope-name my-privatelinkscope + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["-n", "--name", "--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="Resource location", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.public_network_access = AAZStrArg( + options=["--public-network-access"], + arg_group="Properties", + help="Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints.", + default="Disabled", + enum={"Disabled": "Disabled", "Enabled": "Enabled"}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PrivateLinkScopesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PrivateLinkScopesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("publicNetworkAccess", AAZStrType, ".public_network_access") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.private_endpoint_connections = AAZListType( + serialized_name="privateEndpointConnections", + flags={"read_only": True}, + ) + properties.private_link_scope_id = AAZStrType( + serialized_name="privateLinkScopeId", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_network_access = AAZStrType( + serialized_name="publicNetworkAccess", + ) + + private_endpoint_connections = cls._schema_on_200_201.properties.private_endpoint_connections + private_endpoint_connections.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.private_endpoint_connections.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties.private_endpoint_connections.Element.properties + properties.group_ids = AAZListType( + serialized_name="groupIds", + flags={"read_only": True}, + ) + properties.private_endpoint = AAZObjectType( + serialized_name="privateEndpoint", + ) + properties.private_link_service_connection_state = AAZObjectType( + serialized_name="privateLinkServiceConnectionState", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + group_ids = cls._schema_on_200_201.properties.private_endpoint_connections.Element.properties.group_ids + group_ids.Element = AAZStrType() + + private_endpoint = cls._schema_on_200_201.properties.private_endpoint_connections.Element.properties.private_endpoint + private_endpoint.id = AAZStrType() + + private_link_service_connection_state = cls._schema_on_200_201.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state + private_link_service_connection_state.actions_required = AAZStrType( + serialized_name="actionsRequired", + flags={"read_only": True}, + ) + private_link_service_connection_state.description = AAZStrType( + flags={"required": True}, + ) + private_link_service_connection_state.status = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_delete.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_delete.py new file mode 100644 index 00000000000..3d9d51b2c4d --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_delete.py @@ -0,0 +1,163 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-link-scope delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an Azure Arc PrivateLinkScope. + + :example: Sample command for private-link-scope delete + az connectedmachine private-link-scope delete --resource-group my-resource-group --scope-name my-privatelinkscope + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}", "2022-12-27"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["-n", "--name", "--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.PrivateLinkScopesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class PrivateLinkScopesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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 [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + 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]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + 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.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, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_list.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_list.py new file mode 100644 index 00000000000..4adb4a55a08 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_list.py @@ -0,0 +1,471 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-link-scope list", +) +class List(AAZCommand): + """Get a list of Azure Arc PrivateLinkScopes within a resource group. And Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + + :example: Sample command for private-link-scope list + az connectedmachine private-link-scope list --resource-group my-resource-group + az connectedmachine private-link-scope list + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.hybridcompute/privatelinkscopes", "2022-12-27"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + 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 + if condition_0: + self.PrivateLinkScopesListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.PrivateLinkScopesList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class PrivateLinkScopesListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @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, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.private_endpoint_connections = AAZListType( + serialized_name="privateEndpointConnections", + flags={"read_only": True}, + ) + properties.private_link_scope_id = AAZStrType( + serialized_name="privateLinkScopeId", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_network_access = AAZStrType( + serialized_name="publicNetworkAccess", + ) + + private_endpoint_connections = cls._schema_on_200.value.Element.properties.private_endpoint_connections + private_endpoint_connections.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties + properties.group_ids = AAZListType( + serialized_name="groupIds", + flags={"read_only": True}, + ) + properties.private_endpoint = AAZObjectType( + serialized_name="privateEndpoint", + ) + properties.private_link_service_connection_state = AAZObjectType( + serialized_name="privateLinkServiceConnectionState", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + group_ids = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.group_ids + group_ids.Element = AAZStrType() + + private_endpoint = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.private_endpoint + private_endpoint.id = AAZStrType() + + private_link_service_connection_state = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state + private_link_service_connection_state.actions_required = AAZStrType( + serialized_name="actionsRequired", + flags={"read_only": True}, + ) + private_link_service_connection_state.description = AAZStrType( + flags={"required": True}, + ) + private_link_service_connection_state.status = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class PrivateLinkScopesList(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.private_endpoint_connections = AAZListType( + serialized_name="privateEndpointConnections", + flags={"read_only": True}, + ) + properties.private_link_scope_id = AAZStrType( + serialized_name="privateLinkScopeId", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_network_access = AAZStrType( + serialized_name="publicNetworkAccess", + ) + + private_endpoint_connections = cls._schema_on_200.value.Element.properties.private_endpoint_connections + private_endpoint_connections.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties + properties.group_ids = AAZListType( + serialized_name="groupIds", + flags={"read_only": True}, + ) + properties.private_endpoint = AAZObjectType( + serialized_name="privateEndpoint", + ) + properties.private_link_service_connection_state = AAZObjectType( + serialized_name="privateLinkServiceConnectionState", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + group_ids = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.group_ids + group_ids.Element = AAZStrType() + + private_endpoint = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.private_endpoint + private_endpoint.id = AAZStrType() + + private_link_service_connection_state = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state + private_link_service_connection_state.actions_required = AAZStrType( + serialized_name="actionsRequired", + flags={"read_only": True}, + ) + private_link_service_connection_state.description = AAZStrType( + flags={"required": True}, + ) + private_link_service_connection_state.status = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_show.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_show.py new file mode 100644 index 00000000000..871ffe438db --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_show.py @@ -0,0 +1,271 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-link-scope show", +) +class Show(AAZCommand): + """Return an Azure Arc PrivateLinkScope. + + :example: Sample command for private-link-scope show + az connectedmachine private-link-scope show --resource-group my-resource-group --scope-name my-privatelinkscope + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["-n", "--name", "--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PrivateLinkScopesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PrivateLinkScopesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.private_endpoint_connections = AAZListType( + serialized_name="privateEndpointConnections", + flags={"read_only": True}, + ) + properties.private_link_scope_id = AAZStrType( + serialized_name="privateLinkScopeId", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_network_access = AAZStrType( + serialized_name="publicNetworkAccess", + ) + + private_endpoint_connections = cls._schema_on_200.properties.private_endpoint_connections + private_endpoint_connections.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.private_endpoint_connections.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties.private_endpoint_connections.Element.properties + properties.group_ids = AAZListType( + serialized_name="groupIds", + flags={"read_only": True}, + ) + properties.private_endpoint = AAZObjectType( + serialized_name="privateEndpoint", + ) + properties.private_link_service_connection_state = AAZObjectType( + serialized_name="privateLinkServiceConnectionState", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + group_ids = cls._schema_on_200.properties.private_endpoint_connections.Element.properties.group_ids + group_ids.Element = AAZStrType() + + private_endpoint = cls._schema_on_200.properties.private_endpoint_connections.Element.properties.private_endpoint + private_endpoint.id = AAZStrType() + + private_link_service_connection_state = cls._schema_on_200.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state + private_link_service_connection_state.actions_required = AAZStrType( + serialized_name="actionsRequired", + flags={"read_only": True}, + ) + private_link_service_connection_state.description = AAZStrType( + flags={"required": True}, + ) + private_link_service_connection_state.status = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_update.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_update.py new file mode 100644 index 00000000000..e5beec46311 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_update.py @@ -0,0 +1,470 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-link-scope update", +) +class Update(AAZCommand): + """Update an Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + + :example: Sample command for private-link-scope update + az connectedmachine private-link-scope update --tags Tag1=Value1 --resource-group my-resource-group --scope-name my-privatelinkscope --location eastus2euap + """ + + _aaz_info = { + "version": "2022-12-27", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}", "2022-12-27"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["-n", "--name", "--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + id_part="name", + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.location = AAZStrArg( + options=["--location"], + help="The location of the Azure Arc PrivateLinkScope resource.", + id_part="location", + ) + + _args_schema.public_network_access = AAZStrArg( + options=["--public-network-access"], + arg_group="Properties", + help="Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints.", + nullable=True, + enum={"Disabled": "Disabled", "Enabled": "Enabled"}, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PrivateLinkScopesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.PrivateLinkScopesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PrivateLinkScopesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_hybrid_compute_private_link_scope_read(cls._schema_on_200) + + return cls._schema_on_200 + + class PrivateLinkScopesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_hybrid_compute_private_link_scope_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("publicNetworkAccess", AAZStrType, ".public_network_access") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_hybrid_compute_private_link_scope_read = None + + @classmethod + def _build_schema_hybrid_compute_private_link_scope_read(cls, _schema): + if cls._schema_hybrid_compute_private_link_scope_read is not None: + _schema.id = cls._schema_hybrid_compute_private_link_scope_read.id + _schema.location = cls._schema_hybrid_compute_private_link_scope_read.location + _schema.name = cls._schema_hybrid_compute_private_link_scope_read.name + _schema.properties = cls._schema_hybrid_compute_private_link_scope_read.properties + _schema.system_data = cls._schema_hybrid_compute_private_link_scope_read.system_data + _schema.tags = cls._schema_hybrid_compute_private_link_scope_read.tags + _schema.type = cls._schema_hybrid_compute_private_link_scope_read.type + return + + cls._schema_hybrid_compute_private_link_scope_read = _schema_hybrid_compute_private_link_scope_read = AAZObjectType() + + hybrid_compute_private_link_scope_read = _schema_hybrid_compute_private_link_scope_read + hybrid_compute_private_link_scope_read.id = AAZStrType( + flags={"read_only": True}, + ) + hybrid_compute_private_link_scope_read.location = AAZStrType( + flags={"required": True}, + ) + hybrid_compute_private_link_scope_read.name = AAZStrType( + flags={"read_only": True}, + ) + hybrid_compute_private_link_scope_read.properties = AAZObjectType() + hybrid_compute_private_link_scope_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + hybrid_compute_private_link_scope_read.tags = AAZDictType() + hybrid_compute_private_link_scope_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_hybrid_compute_private_link_scope_read.properties + properties.private_endpoint_connections = AAZListType( + serialized_name="privateEndpointConnections", + flags={"read_only": True}, + ) + properties.private_link_scope_id = AAZStrType( + serialized_name="privateLinkScopeId", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_network_access = AAZStrType( + serialized_name="publicNetworkAccess", + ) + + private_endpoint_connections = _schema_hybrid_compute_private_link_scope_read.properties.private_endpoint_connections + private_endpoint_connections.Element = AAZObjectType() + + _element = _schema_hybrid_compute_private_link_scope_read.properties.private_endpoint_connections.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_hybrid_compute_private_link_scope_read.properties.private_endpoint_connections.Element.properties + properties.group_ids = AAZListType( + serialized_name="groupIds", + flags={"read_only": True}, + ) + properties.private_endpoint = AAZObjectType( + serialized_name="privateEndpoint", + ) + properties.private_link_service_connection_state = AAZObjectType( + serialized_name="privateLinkServiceConnectionState", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + group_ids = _schema_hybrid_compute_private_link_scope_read.properties.private_endpoint_connections.Element.properties.group_ids + group_ids.Element = AAZStrType() + + private_endpoint = _schema_hybrid_compute_private_link_scope_read.properties.private_endpoint_connections.Element.properties.private_endpoint + private_endpoint.id = AAZStrType() + + private_link_service_connection_state = _schema_hybrid_compute_private_link_scope_read.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state + private_link_service_connection_state.actions_required = AAZStrType( + serialized_name="actionsRequired", + flags={"read_only": True}, + ) + private_link_service_connection_state.description = AAZStrType( + flags={"required": True}, + ) + private_link_service_connection_state.status = AAZStrType( + flags={"required": True}, + ) + + system_data = _schema_hybrid_compute_private_link_scope_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_hybrid_compute_private_link_scope_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_hybrid_compute_private_link_scope_read.id + _schema.location = cls._schema_hybrid_compute_private_link_scope_read.location + _schema.name = cls._schema_hybrid_compute_private_link_scope_read.name + _schema.properties = cls._schema_hybrid_compute_private_link_scope_read.properties + _schema.system_data = cls._schema_hybrid_compute_private_link_scope_read.system_data + _schema.tags = cls._schema_hybrid_compute_private_link_scope_read.tags + _schema.type = cls._schema_hybrid_compute_private_link_scope_read.type + + +__all__ = ["Update"] diff --git a/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_wait.py b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_wait.py new file mode 100644 index 00000000000..5e1862356b5 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_wait.py @@ -0,0 +1,267 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "connectedmachine private-link-scope wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/privatelinkscopes/{}", "2022-12-27"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.scope_name = AAZStrArg( + options=["-n", "--name", "--scope-name"], + help="The name of the Azure Arc PrivateLinkScope resource.", + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PrivateLinkScopesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class PrivateLinkScopesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + 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) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "scopeName", self.ctx.args.scope_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-12-27", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.private_endpoint_connections = AAZListType( + serialized_name="privateEndpointConnections", + flags={"read_only": True}, + ) + properties.private_link_scope_id = AAZStrType( + serialized_name="privateLinkScopeId", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_network_access = AAZStrType( + serialized_name="publicNetworkAccess", + ) + + private_endpoint_connections = cls._schema_on_200.properties.private_endpoint_connections + private_endpoint_connections.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.private_endpoint_connections.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties.private_endpoint_connections.Element.properties + properties.group_ids = AAZListType( + serialized_name="groupIds", + flags={"read_only": True}, + ) + properties.private_endpoint = AAZObjectType( + serialized_name="privateEndpoint", + ) + properties.private_link_service_connection_state = AAZObjectType( + serialized_name="privateLinkServiceConnectionState", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + group_ids = cls._schema_on_200.properties.private_endpoint_connections.Element.properties.group_ids + group_ids.Element = AAZStrType() + + private_endpoint = cls._schema_on_200.properties.private_endpoint_connections.Element.properties.private_endpoint + private_endpoint.id = AAZStrType() + + private_link_service_connection_state = cls._schema_on_200.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state + private_link_service_connection_state.actions_required = AAZStrType( + serialized_name="actionsRequired", + flags={"read_only": True}, + ) + private_link_service_connection_state.description = AAZStrType( + flags={"required": True}, + ) + private_link_service_connection_state.status = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/connectedmachine/azext_connectedmachine/azext_metadata.json b/src/connectedmachine/azext_connectedmachine/azext_metadata.json index 3695b0d7077..7923ce3c67b 100644 --- a/src/connectedmachine/azext_connectedmachine/azext_metadata.json +++ b/src/connectedmachine/azext_connectedmachine/azext_metadata.json @@ -1,3 +1,4 @@ { - "azext.minCliCoreVersion": "2.15.0" + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.49.0" } \ No newline at end of file diff --git a/src/connectedmachine/azext_connectedmachine/generated/_help.py b/src/connectedmachine/azext_connectedmachine/generated/_help.py index 2dbad11bbd2..acdf7c4b939 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/_help.py +++ b/src/connectedmachine/azext_connectedmachine/generated/_help.py @@ -12,218 +12,6 @@ from knack.help_files import helps -helps['connectedmachine'] = ''' - type: group - short-summary: Manage Connected Machine -''' - -helps['connectedmachine list'] = """ - type: command - short-summary: "List all the hybrid machines in the specified resource group. Use the nextLink property in the \ -response to get the next page of hybrid machines. And Lists all the hybrid machines in the specified subscription. Use \ -the nextLink property in the response to get the next page of hybrid machines." - examples: - - name: List Machines by resource group - text: |- - az connectedmachine list --resource-group "myResourceGroup" - - name: List Machines by resource group - text: |- - az connectedmachine list -""" - -helps['connectedmachine show'] = """ - type: command - short-summary: "Retrieve information about the model view or the instance view of a hybrid machine." - examples: - - name: Get Machine - text: |- - az connectedmachine show --name "myMachine" --resource-group "myResourceGroup" -""" - -helps['connectedmachine delete'] = """ - type: command - short-summary: "The operation to remove a hybrid machine identity in Azure." - examples: - - name: Delete a Machine - text: |- - az connectedmachine delete --name "myMachine" --resource-group "myResourceGroup" -""" - -helps['connectedmachine extension'] = """ - type: group - short-summary: Manage machine extension with connectedmachine -""" - -helps['connectedmachine extension list'] = """ - type: command - short-summary: "The operation to get all extensions of a non-Azure machine." - examples: - - name: Get all Machine Extensions - text: |- - az connectedmachine extension list --machine-name "myMachine" --resource-group "myResourceGroup" -""" - -helps['connectedmachine extension show'] = """ - type: command - short-summary: "The operation to get the extension." - examples: - - name: Get Machine Extension - text: |- - az connectedmachine extension show --name "CustomScriptExtension" --machine-name "myMachine" \ ---resource-group "myResourceGroup" -""" - -helps['connectedmachine extension create'] = """ - type: command - short-summary: "The operation to Create the extension." - parameters: - - name: --status - short-summary: "Instance view status." - long-summary: | - Usage: --status code=XX level=XX display-status=XX message=XX time=XX - code: The status code. - level: The level code. - display-status: The short localizable label for the status. - message: The detailed status message, including for alerts and error messages. - time: The time of the status. - examples: - - name: Create or Update a Machine Extension - text: |- - az connectedmachine extension create --name "CustomScriptExtension" --location "eastus2euap" --type \ -"CustomScriptExtension" --publisher "Microsoft.Compute" --settings '{\"commandToExecute\":\"hostname\"}' --type-handler-version "1.10" --machine-name \ -"myMachine" --resource-group "myResourceGroup" -""" - -helps['connectedmachine extension update'] = """ - type: command - short-summary: "The operation to create or update the extension." - examples: - - name: Create or Update a Machine Extension - text: |- - az connectedmachine extension update --name "CustomScriptExtension" --type "CustomScriptExtension" \ ---publisher "Microsoft.Compute" --settings '{\"commandToExecute\":\"hostname\"}' --type-handler-version "1.10" --machine-name "myMachine" --resource-group \ -"myResourceGroup" -""" - -helps['connectedmachine extension delete'] = """ - type: command - short-summary: "The operation to delete the extension." - examples: - - name: Delete a Machine Extension - text: |- - az connectedmachine extension delete --name "MMA" --machine-name "myMachine" --resource-group \ -"myResourceGroup" -""" - -helps['connectedmachine extension wait'] = """ - type: command - short-summary: Place the CLI in a waiting state until a condition of the connectedmachine extension is met. - examples: - - name: Pause executing next line of CLI script until the connectedmachine extension is successfully created. - text: |- - az connectedmachine extension wait --name "CustomScriptExtension" --machine-name "myMachine" \ ---resource-group "myResourceGroup" --created - - name: Pause executing next line of CLI script until the connectedmachine extension is successfully updated. - text: |- - az connectedmachine extension wait --name "CustomScriptExtension" --machine-name "myMachine" \ ---resource-group "myResourceGroup" --updated - - name: Pause executing next line of CLI script until the connectedmachine extension is successfully deleted. - text: |- - az connectedmachine extension wait --name "CustomScriptExtension" --machine-name "myMachine" \ ---resource-group "myResourceGroup" --deleted -""" - -helps['connectedmachine upgrade-extension'] = """ - type: command - short-summary: "The operation to upgrade Machine Extensions." - examples: - - name: Upgrade Machine Extensions - text: |- - az connectedmachine upgrade-extension --extension-targets '{\"Microsoft.Azure.Monitoring\":{\"targetV\ -ersion\":\"2.0\"},\"Microsoft.Compute.CustomScriptExtension\":{\"targetVersion\":\"1.10\"}}' --machine-name \ -"myMachine" --resource-group "myResourceGroup" -""" - -helps['connectedmachine private-link-scope'] = """ - type: group - short-summary: Manage private link scope with connectedmachine -""" - -helps['connectedmachine private-link-scope list'] = """ - type: command - short-summary: "Get a list of Azure Arc PrivateLinkScopes within a resource group. And Gets a list of all Azure \ -Arc PrivateLinkScopes within a subscription." - examples: - - name: PrivateLinkScopeListByResourceGroup - text: |- - az connectedmachine private-link-scope list --resource-group "my-resource-group" - - name: PrivateLinkScopesList.json - text: |- - az connectedmachine private-link-scope list -""" - -helps['connectedmachine private-link-scope show'] = """ - type: command - short-summary: "Return a Azure Arc PrivateLinkScope." - examples: - - name: PrivateLinkScopeGet - text: |- - az connectedmachine private-link-scope show --resource-group "my-resource-group" --scope-name \ -"my-privatelinkscope" -""" - -helps['connectedmachine private-link-scope create'] = """ - type: command - short-summary: "Create (or update) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for \ -InstrumentationKey nor AppId in the Put operation." - examples: - - name: PrivateLinkScopeCreate - text: |- - az connectedmachine private-link-scope create --location "westus" --resource-group "my-resource-group" \ ---scope-name "my-privatelinkscope" -""" - -helps['connectedmachine private-link-scope update'] = """ - type: command - short-summary: "Update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for \ -InstrumentationKey nor AppId in the Put operation." - examples: - - name: PrivateLinkScopeUpdate - text: |- - az connectedmachine private-link-scope update --location "westus" --tags Tag1="Value1" --resource-group \ -"my-resource-group" --scope-name "my-privatelinkscope" -""" - -helps['connectedmachine private-link-scope delete'] = """ - type: command - short-summary: "Delete a Azure Arc PrivateLinkScope." - examples: - - name: PrivateLinkScopesDelete - text: |- - az connectedmachine private-link-scope delete --resource-group "my-resource-group" --scope-name \ -"my-privatelinkscope" -""" - -helps['connectedmachine private-link-scope show-validation-detail'] = """ - type: command - short-summary: "Return a Azure Arc PrivateLinkScope's validation details." - examples: - - name: PrivateLinkScopeGet - text: |- - az connectedmachine private-link-scope show-validation-detail --location "wus2" --private-link-scope-id \ -"f5dc51d3-92ed-4d7e-947a-775ea79b4919" -""" - -helps['connectedmachine private-link-scope show-validation-detail-for-machine'] = """ - type: command - short-summary: "Return a Azure Arc PrivateLinkScope's validation details for a given machine." - examples: - - name: PrivateLinkScopeGet - text: |- - az connectedmachine private-link-scope show-validation-detail-for-machine --machine-name "machineName" \ ---resource-group "my-resource-group" -""" - helps['connectedmachine private-link-scope update-tag'] = """ type: command short-summary: "Update an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate \ @@ -234,111 +22,3 @@ az connectedmachine private-link-scope update-tag --tags Tag1="Value1" Tag2="Value2" --resource-group \ "my-resource-group" --scope-name "my-privatelinkscope" """ - -helps['connectedmachine private-link-scope wait'] = """ - type: command - short-summary: Place the CLI in a waiting state until a condition of the connectedmachine private-link-scope is \ -met. - examples: - - name: Pause executing next line of CLI script until the connectedmachine private-link-scope is successfully \ -deleted. - text: |- - az connectedmachine private-link-scope wait --resource-group "my-resource-group" --scope-name \ -"my-privatelinkscope" --deleted -""" - -helps['connectedmachine private-link-resource'] = """ - type: group - short-summary: Manage private link resource with connectedmachine -""" - -helps['connectedmachine private-link-resource list'] = """ - type: command - short-summary: "Get the private link resources that need to be created for a Azure Monitor PrivateLinkScope." - examples: - - name: Get private endpoint connection. - text: |- - az connectedmachine private-link-resource list --resource-group "myResourceGroup" --scope-name \ -"myPrivateLinkScope" -""" - -helps['connectedmachine private-link-resource show'] = """ - type: command - short-summary: "Get the private link resources that need to be created for a Azure Monitor PrivateLinkScope." - examples: - - name: Get private endpoint connection. - text: |- - az connectedmachine private-link-resource show --group-name "hybridcompute" --resource-group \ -"myResourceGroup" --scope-name "myPrivateLinkScope" -""" - -helps['connectedmachine private-endpoint-connection'] = """ - type: group - short-summary: Manage private endpoint connection with connectedmachine -""" - -helps['connectedmachine private-endpoint-connection list'] = """ - type: command - short-summary: "Get all private endpoint connections on a private link scope." - examples: - - name: Get list of private endpoint connections on a private link scope. - text: |- - az connectedmachine private-endpoint-connection list --resource-group "myResourceGroup" --scope-name \ -"myPrivateLinkScope" -""" - -helps['connectedmachine private-endpoint-connection show'] = """ - type: command - short-summary: "Get a private endpoint connection." - examples: - - name: Get private endpoint connection. - text: |- - az connectedmachine private-endpoint-connection show --name "private-endpoint-connection-name" \ ---resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" -""" - -helps['connectedmachine private-endpoint-connection update'] = """ - type: command - short-summary: "Approve or reject a private endpoint connection with a given name." - parameters: - - name: --connection-state - short-summary: "Connection state of the private endpoint connection." - long-summary: | - Usage: --connection-state status=XX description=XX - - status: Required. The private link service connection status. - description: Required. The private link service connection description. - examples: - - name: Approve or reject a private endpoint connection with a given name. - text: |- - az connectedmachine private-endpoint-connection update --connection-state description="Approved by \ -johndoe@contoso.com" status="Approved" --name "private-endpoint-connection-name" --resource-group "myResourceGroup" \ ---scope-name "myPrivateLinkScope" -""" - -helps['connectedmachine private-endpoint-connection delete'] = """ - type: command - short-summary: "Delete a private endpoint connection with a given name." - examples: - - name: Delete a private endpoint connection with a given name. - text: |- - az connectedmachine private-endpoint-connection delete --name "private-endpoint-connection-name" \ ---resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" -""" - -helps['connectedmachine private-endpoint-connection wait'] = """ - type: command - short-summary: Place the CLI in a waiting state until a condition of the connectedmachine \ -private-endpoint-connection is met. - examples: - - name: Pause executing next line of CLI script until the connectedmachine private-endpoint-connection is \ -successfully updated. - text: |- - az connectedmachine private-endpoint-connection wait --name "private-endpoint-connection-name" \ ---resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" --updated - - name: Pause executing next line of CLI script until the connectedmachine private-endpoint-connection is \ -successfully deleted. - text: |- - az connectedmachine private-endpoint-connection wait --name "private-endpoint-connection-name" \ ---resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" --deleted -""" diff --git a/src/connectedmachine/azext_connectedmachine/generated/_params.py b/src/connectedmachine/azext_connectedmachine/generated/_params.py index f689d6708ec..95d3febe8dc 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/_params.py +++ b/src/connectedmachine/azext_connectedmachine/generated/_params.py @@ -29,199 +29,8 @@ def load_arguments(self, _): - with self.argument_context('connectedmachine list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('connectedmachine show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], help='The name of the ' - 'hybrid machine.', id_part='name') - - with self.argument_context('connectedmachine delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], help='The name of the ' - 'hybrid machine.', id_part='name') - - with self.argument_context('connectedmachine extension list') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', help='The name of the machine containing the extension.') - c.argument('expand', help='The expand expression to apply on the operation.') - - with self.argument_context('connectedmachine extension show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', help='The name of the machine containing the extension.', id_part='name') - c.argument('name', help='The name of the machine extension.', id_part='child_name_1') - - with self.argument_context('connectedmachine extension create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', help='The name of the machine where the extension should be created or ' - 'updated.') - c.argument('name', help='The name of the machine extension.') - c.argument('tags', tags_type) - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('force_update_tag', help='How the extension handler should be forced to update even if ' - 'the extension configuration has not changed.') - c.argument('publisher', type=str, help='The name of the extension handler publisher.') - c.argument('type_', options_list=['--type'], help='Specify the type of the extension; an example ' - 'is "CustomScriptExtension".') - c.argument('type_handler_version', type=str, help='Specify the version of the script handler.') - c.argument('enable_auto_upgrade', arg_type=get_three_state_flag(), help='Indicate whether the extension ' - 'should be automatically upgraded by the platform if there is a newer version available.') - c.argument('auto_upgrade_minor', arg_type=get_three_state_flag(), help='Indicate whether the extension should ' - 'use a newer minor version if one is available at deployment time. Once deployed, however, the ' - 'extension will not upgrade minor versions unless redeployed, even with this property set to true.') - c.argument('settings', type=validate_file_or_dict, help='Json formatted public settings for the extension. ' - 'Expected value: json-string/json-file/@json-file.') - c.argument('protected_settings', type=validate_file_or_dict, help='The extension can contain either ' - 'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected ' - 'value: json-string/json-file/@json-file.') - c.argument('instance_view_type', help='Specify the type of the extension; an example is ' - '"CustomScriptExtension".', arg_group='Instance View') - c.argument('inst_handler_version', help='Specify the version of the script handler.', - arg_group='Instance View') - c.argument('status', action=AddStatus, nargs='+', help='Instance view status.', arg_group='Instance View') - - with self.argument_context('connectedmachine extension update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', help='The name of the machine where the extension should be created or ' - 'updated.', id_part='name') - c.argument('name', help='The name of the machine extension.', id_part='child_name_1') - c.argument('tags', tags_type) - c.argument('force_update_tag', help='How the extension handler should be forced to update even if ' - 'the extension configuration has not changed.') - c.argument('publisher', help='The name of the extension handler publisher.') - c.argument('type_', options_list=['--type'], help='Specify the type of the extension; an example ' - 'is "CustomScriptExtension".') - c.argument('type_handler_version', help='Specify the version of the script handler.') - c.argument('enable_auto_upgrade', arg_type=get_three_state_flag(), help='Indicate whether the extension ' - 'should be automatically upgraded by the platform if there is a newer version available.') - c.argument('auto_upgrade_minor', arg_type=get_three_state_flag(), help='Indicate whether the extension should ' - 'use a newer minor version if one is available at deployment time. Once deployed, however, the ' - 'extension will not upgrade minor versions unless redeployed, even with this property set to true.') - c.argument('settings', type=validate_file_or_dict, help='Json formatted public settings for the extension. ' - 'Expected value: json-string/json-file/@json-file.') - c.argument('protected_settings', type=validate_file_or_dict, help='The extension can contain either ' - 'protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected ' - 'value: json-string/json-file/@json-file.') - - with self.argument_context('connectedmachine extension delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', help='The name of the machine where the extension should be deleted.', - id_part='name') - c.argument('name', help='The name of the machine extension.', id_part='child_name_1') - - with self.argument_context('connectedmachine extension wait') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', help='The name of the machine containing the extension.', id_part='name') - c.argument('name', help='The name of the machine extension.', id_part='child_name_1') - - with self.argument_context('connectedmachine upgrade-extension') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', help='The name of the hybrid machine.', id_part='name') - c.argument('extension_targets', type=validate_file_or_dict, help='Describe the Extension Target Properties. ' - 'Expected value: json-string/json-file/@json-file.') - - with self.argument_context('connectedmachine private-link-scope list') as c: - c.argument('resource_group_name', resource_group_name_type) - - with self.argument_context('connectedmachine private-link-scope show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', - id_part='name') - - with self.argument_context('connectedmachine private-link-scope create') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('public_network_access', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Indicate whether ' - 'machines associated with the private link scope can also use public Azure Arc service endpoints.') - - with self.argument_context('connectedmachine private-link-scope update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', - id_part='name') - c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, - validator=get_default_location_from_resource_group) - c.argument('tags', tags_type) - c.argument('public_network_access', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Indicate whether ' - 'machines associated with the private link scope can also use public Azure Arc service endpoints.') - c.ignore('parameters') - - with self.argument_context('connectedmachine private-link-scope delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', - id_part='name') - - with self.argument_context('connectedmachine private-link-scope show-validation-detail') as c: - c.argument('location', arg_type=get_location_type(self.cli_ctx), id_part='name') - c.argument('private_link_scope_id', help='The id (Guid) of the Azure Arc PrivateLinkScope resource.', - id_part='child_name_1') - - with self.argument_context('connectedmachine private-link-scope show-validation-detail-for-machine') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('machine_name', help='The name of the target machine to get the private link scope ' - 'validation details for.', id_part='name') - with self.argument_context('connectedmachine private-link-scope update-tag') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', id_part='name') c.argument('tags', tags_type) - - with self.argument_context('connectedmachine private-link-scope wait') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', - id_part='name') - - with self.argument_context('connectedmachine private-link-resource list') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.') - - with self.argument_context('connectedmachine private-link-resource show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', - id_part='name') - c.argument('group_name', help='The name of the private link resource.', id_part='child_name_1') - - with self.argument_context('connectedmachine private-endpoint-connection list') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.') - - with self.argument_context('connectedmachine private-endpoint-connection show') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', - id_part='name') - c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' - 'e'], help='The name of the private ' - 'endpoint connection.', id_part='child_name_1') - - with self.argument_context('connectedmachine private-endpoint-connection update') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', - id_part='name') - c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' - 'e'], help='The name of the private ' - 'endpoint connection.', id_part='child_name_1') - c.argument('connection_state', action=AddConnectionState, nargs='+', help='Connection state of the private ' - 'endpoint connection.') - c.argument('id_', options_list=['--id'], help='Resource id of the private endpoint.', - arg_group='Private Endpoint') - - with self.argument_context('connectedmachine private-endpoint-connection delete') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', - id_part='name') - c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' - 'e'], help='The name of the private ' - 'endpoint connection.', id_part='child_name_1') - - with self.argument_context('connectedmachine private-endpoint-connection wait') as c: - c.argument('resource_group_name', resource_group_name_type) - c.argument('scope_name', help='The name of the Azure Arc PrivateLinkScope resource.', - id_part='name') - c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' - 'e'], help='The name of the private ' - 'endpoint connection.', id_part='child_name_1') diff --git a/src/connectedmachine/azext_connectedmachine/generated/commands.py b/src/connectedmachine/azext_connectedmachine/generated/commands.py index 8efa8eb102f..e4720496618 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/commands.py +++ b/src/connectedmachine/azext_connectedmachine/generated/commands.py @@ -23,38 +23,6 @@ ) -connectedmachine_machine = CliCommandType( - operations_tmpl=( - 'azext_connectedmachine.vendored_sdks.connectedmachine.operations._machines_operations#MachinesOperations.{}' - ), - client_factory=cf_machine, -) - - -connectedmachine_ = CliCommandType( - operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._connected_machine_operations#ConnectedMachineOperationsMixin.{}', - client_factory=cf_connectedmachine_cl, -) - - -connectedmachine_machine_extension = CliCommandType( - operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._machine_extensions_operations#MachineExtensionsOperations.{}', - client_factory=cf_machine_extension, -) - - -connectedmachine_private_endpoint_connection = CliCommandType( - operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._private_endpoint_connections_operations#PrivateEndpointConnectionsOperations.{}', - client_factory=cf_private_endpoint_connection, -) - - -connectedmachine_private_link_resource = CliCommandType( - operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._private_link_resources_operations#PrivateLinkResourcesOperations.{}', - client_factory=cf_private_link_resource, -) - - connectedmachine_private_link_scope = CliCommandType( operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._private_link_scopes_operations#PrivateLinkScopesOperations.{}', client_factory=cf_private_link_scope, @@ -62,60 +30,7 @@ def load_command_table(self, _): - - with self.command_group('connectedmachine', connectedmachine_machine, client_factory=cf_machine) as g: - g.custom_command('list', 'connectedmachine_list') - g.custom_show_command('show', 'connectedmachine_show') - g.custom_command('delete', 'connectedmachine_delete', confirmation=True) - - with self.command_group('connectedmachine', connectedmachine_, client_factory=cf_connectedmachine_cl) as g: - g.custom_command('upgrade-extension', 'connectedmachine_upgrade_extension') - - with self.command_group( - 'connectedmachine extension', connectedmachine_machine_extension, client_factory=cf_machine_extension - ) as g: - g.custom_command('list', 'connectedmachine_extension_list') - g.custom_show_command('show', 'connectedmachine_extension_show') - g.custom_command('create', 'connectedmachine_extension_create', supports_no_wait=True) - g.custom_command('update', 'connectedmachine_extension_update', supports_no_wait=True) - g.custom_command('delete', 'connectedmachine_extension_delete', supports_no_wait=True, confirmation=True) - g.custom_wait_command('wait', 'connectedmachine_extension_show') - - with self.command_group( - 'connectedmachine private-endpoint-connection', - connectedmachine_private_endpoint_connection, - client_factory=cf_private_endpoint_connection, - ) as g: - g.custom_command('list', 'connectedmachine_private_endpoint_connection_list') - g.custom_show_command('show', 'connectedmachine_private_endpoint_connection_show') - g.custom_command('update', 'connectedmachine_private_endpoint_connection_update', supports_no_wait=True) - g.custom_command( - 'delete', 'connectedmachine_private_endpoint_connection_delete', supports_no_wait=True, confirmation=True - ) - g.custom_wait_command('wait', 'connectedmachine_private_endpoint_connection_show') - - with self.command_group( - 'connectedmachine private-link-resource', - connectedmachine_private_link_resource, - client_factory=cf_private_link_resource, - ) as g: - g.custom_command('list', 'connectedmachine_private_link_resource_list') - g.custom_show_command('show', 'connectedmachine_private_link_resource_show') - with self.command_group( 'connectedmachine private-link-scope', connectedmachine_private_link_scope, client_factory=cf_private_link_scope ) as g: - g.custom_command('list', 'connectedmachine_private_link_scope_list') - g.custom_show_command('show', 'connectedmachine_private_link_scope_show') - g.custom_command('create', 'connectedmachine_private_link_scope_create') - g.generic_update_command('update', custom_func_name='connectedmachine_private_link_scope_update') - g.custom_command( - 'delete', 'connectedmachine_private_link_scope_delete', supports_no_wait=True, confirmation=True - ) - g.custom_command('show-validation-detail', 'connectedmachine_private_link_scope_show_validation_detail') - g.custom_command( - 'show-validation-detail-for-machine', - 'connectedmachine_private_link_scope_show_validation_detail_for_machine', - ) g.custom_command('update-tag', 'connectedmachine_private_link_scope_update_tag') - g.custom_wait_command('wait', 'connectedmachine_private_link_scope_show') diff --git a/src/connectedmachine/azext_connectedmachine/generated/custom.py b/src/connectedmachine/azext_connectedmachine/generated/custom.py index a5cb1502d3f..f428da912c8 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/custom.py +++ b/src/connectedmachine/azext_connectedmachine/generated/custom.py @@ -13,245 +13,6 @@ from azure.cli.core.util import sdk_no_wait -def connectedmachine_list(client, - resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list_by_subscription() - - -def connectedmachine_show(client, - resource_group_name, - machine_name): - return client.get(resource_group_name=resource_group_name, - machine_name=machine_name, - expand="instanceView") - - -def connectedmachine_delete(client, - resource_group_name, - machine_name): - return client.delete(resource_group_name=resource_group_name, - machine_name=machine_name) - - -def connectedmachine_extension_list(client, - resource_group_name, - machine_name, - expand=None): - return client.list(resource_group_name=resource_group_name, - machine_name=machine_name, - expand=expand) - - -def connectedmachine_extension_show(client, - resource_group_name, - machine_name, - name): - return client.get(resource_group_name=resource_group_name, - machine_name=machine_name, - extension_name=name) - - -def connectedmachine_extension_create(client, - resource_group_name, - machine_name, - name, - location, - tags=None, - force_update_tag=None, - publisher=None, - type_=None, - type_handler_version=None, - enable_auto_upgrade=None, - auto_upgrade_minor=None, - settings=None, - protected_settings=None, - instance_view_type=None, - inst_handler_version=None, - status=None, - no_wait=False): - extension_parameters = {} - if tags is not None: - extension_parameters['tags'] = tags - extension_parameters['location'] = location - extension_parameters['properties'] = {} - if force_update_tag is not None: - extension_parameters['properties']['force_update_tag'] = force_update_tag - if publisher is not None: - extension_parameters['properties']['publisher'] = publisher - if type_ is not None: - extension_parameters['properties']['type'] = type_ - if type_handler_version is not None: - extension_parameters['properties']['type_handler_version'] = type_handler_version - if enable_auto_upgrade is not None: - extension_parameters['properties']['enable_automatic_upgrade'] = enable_auto_upgrade - if auto_upgrade_minor is not None: - extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor - if settings is not None: - extension_parameters['properties']['settings'] = settings - if protected_settings is not None: - extension_parameters['properties']['protected_settings'] = protected_settings - extension_parameters['properties']['instance_view'] = {} - extension_parameters['properties']['instance_view']['name'] = name - if instance_view_type is not None: - extension_parameters['properties']['instance_view']['type'] = instance_view_type - if inst_handler_version is not None: - extension_parameters['properties']['instance_view']['type_handler_version'] = inst_handler_version - if status is not None: - extension_parameters['properties']['instance_view']['status'] = status - if len(extension_parameters['properties']['instance_view']) == 0: - del extension_parameters['properties']['instance_view'] - return sdk_no_wait(no_wait, - client.begin_create_or_update, - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_name=name, - extension_parameters=extension_parameters) - - -def connectedmachine_extension_update(client, - resource_group_name, - machine_name, - name, - tags=None, - force_update_tag=None, - publisher=None, - type_=None, - type_handler_version=None, - enable_auto_upgrade=None, - auto_upgrade_minor=None, - settings=None, - protected_settings=None, - no_wait=False): - extension_parameters = {} - if tags is not None: - extension_parameters['tags'] = tags - extension_parameters['properties'] = {} - if force_update_tag is not None: - extension_parameters['properties']['force_update_tag'] = force_update_tag - if publisher is not None: - extension_parameters['properties']['publisher'] = publisher - if type_ is not None: - extension_parameters['properties']['type'] = type_ - if type_handler_version is not None: - extension_parameters['properties']['type_handler_version'] = type_handler_version - if enable_auto_upgrade is not None: - extension_parameters['properties']['enable_automatic_upgrade'] = enable_auto_upgrade - if auto_upgrade_minor is not None: - extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor - if settings is not None: - extension_parameters['properties']['settings'] = settings - if protected_settings is not None: - extension_parameters['properties']['protected_settings'] = protected_settings - if len(extension_parameters['properties']) == 0: - del extension_parameters['properties'] - return sdk_no_wait(no_wait, - client.begin_update, - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_name=name, - extension_parameters=extension_parameters) - - -def connectedmachine_extension_delete(client, - resource_group_name, - machine_name, - name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_delete, - resource_group_name=resource_group_name, - machine_name=machine_name, - extension_name=name) - - -def connectedmachine_upgrade_extension(client, - resource_group_name, - machine_name, - extension_targets=None): - extension_upgrade_parameters = {} - if extension_targets is not None: - extension_upgrade_parameters['extension_targets'] = extension_targets - return client.begin_upgrade_extensions(resource_group_name=resource_group_name, - machine_name=machine_name, - extension_upgrade_parameters=extension_upgrade_parameters) - - -def connectedmachine_private_link_scope_list(client, - resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name=resource_group_name) - return client.list() - - -def connectedmachine_private_link_scope_show(client, - resource_group_name, - scope_name): - return client.get(resource_group_name=resource_group_name, - scope_name=scope_name) - - -def connectedmachine_private_link_scope_create(client, - resource_group_name, - scope_name, - location, - tags=None, - public_network_access=None): - parameters = {} - parameters['location'] = location - if tags is not None: - parameters['tags'] = tags - parameters['properties'] = {} - if public_network_access is not None: - parameters['properties']['public_network_access'] = public_network_access - else: - parameters['properties']['public_network_access'] = "Disabled" - if len(parameters['properties']) == 0: - del parameters['properties'] - return client.create_or_update(resource_group_name=resource_group_name, - scope_name=scope_name, - parameters=parameters) - - -def connectedmachine_private_link_scope_update(instance, - resource_group_name, - scope_name, - location, - tags=None, - public_network_access=None): - instance.location = location - if tags is not None: - instance.tags = tags - if public_network_access is not None: - instance.properties.public_network_access = public_network_access - return instance - - -def connectedmachine_private_link_scope_delete(client, - resource_group_name, - scope_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_delete, - resource_group_name=resource_group_name, - scope_name=scope_name) - - -def connectedmachine_private_link_scope_show_validation_detail(client, - location, - private_link_scope_id): - return client.get_validation_details(location=location, - private_link_scope_id=private_link_scope_id) - - -def connectedmachine_private_link_scope_show_validation_detail_for_machine(client, - resource_group_name, - machine_name): - return client.get_validation_details_for_machine(resource_group_name=resource_group_name, - machine_name=machine_name) - - def connectedmachine_private_link_scope_update_tag(client, resource_group_name, scope_name, @@ -262,71 +23,3 @@ def connectedmachine_private_link_scope_update_tag(client, return client.update_tags(resource_group_name=resource_group_name, scope_name=scope_name, private_link_scope_tags=private_link_scope_tags) - - -def connectedmachine_private_link_resource_list(client, - resource_group_name, - scope_name): - return client.list_by_private_link_scope(resource_group_name=resource_group_name, - scope_name=scope_name) - - -def connectedmachine_private_link_resource_show(client, - resource_group_name, - scope_name, - group_name): - return client.get(resource_group_name=resource_group_name, - scope_name=scope_name, - group_name=group_name) - - -def connectedmachine_private_endpoint_connection_list(client, - resource_group_name, - scope_name): - return client.list_by_private_link_scope(resource_group_name=resource_group_name, - scope_name=scope_name) - - -def connectedmachine_private_endpoint_connection_show(client, - resource_group_name, - scope_name, - private_endpoint_connection_name): - return client.get(resource_group_name=resource_group_name, - scope_name=scope_name, - private_endpoint_connection_name=private_endpoint_connection_name) - - -def connectedmachine_private_endpoint_connection_update(client, - resource_group_name, - scope_name, - private_endpoint_connection_name, - connection_state=None, - id_=None, - no_wait=False): - parameters = {} - parameters['properties'] = {} - if connection_state is not None: - parameters['properties']['private_link_service_connection_state'] = connection_state - parameters['properties']['private_endpoint'] = {} - if id_ is not None: - parameters['properties']['private_endpoint']['id'] = id_ - if len(parameters['properties']['private_endpoint']) == 0: - del parameters['properties']['private_endpoint'] - return sdk_no_wait(no_wait, - client.begin_update, - resource_group_name=resource_group_name, - scope_name=scope_name, - private_endpoint_connection_name=private_endpoint_connection_name, - parameters=parameters) - - -def connectedmachine_private_endpoint_connection_delete(client, - resource_group_name, - scope_name, - private_endpoint_connection_name, - no_wait=False): - return sdk_no_wait(no_wait, - client.begin_delete, - resource_group_name=resource_group_name, - scope_name=scope_name, - private_endpoint_connection_name=private_endpoint_connection_name) diff --git a/src/connectedmachine/azext_connectedmachine/manual/commands.py b/src/connectedmachine/azext_connectedmachine/manual/commands.py index 8ba207ac56f..efdeb3eec37 100644 --- a/src/connectedmachine/azext_connectedmachine/manual/commands.py +++ b/src/connectedmachine/azext_connectedmachine/manual/commands.py @@ -63,9 +63,7 @@ def load_command_table(self, _): - - with self.command_group('connectedmachine', connectedmachine_machine, client_factory=cf_machine) as g: - g.custom_command('list', 'connectedmachine_list', table_transformer=transform_machine_list) + pass def transform_machine_list(result): diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_ConnectedMachineAndExtension_Scenario.yaml b/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_ConnectedMachineAndExtension_Scenario.yaml deleted file mode 100644 index 5617d55cacc..00000000000 --- a/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_ConnectedMachineAndExtension_Scenario.yaml +++ /dev/null @@ -1,790 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine show - Connection: - - keep-alive - ParameterSetName: - - -n -g - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine?api-version=2022-03-10&$expand=instanceView - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine","name":"testMachine","location":"eastus2euap","tags":{},"identity":{"type":"SystemAssigned","principalId":"fc9a4766-a5d2-41d3-8fdd-3a32ddb4343a","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"type":"Microsoft.HybridCompute/machines","properties":{"provisioningState":"Succeeded","agentVersion":"1.18.01965.249","status":"Connected","lastStatusChange":"2022-05-23T22:55:52.7801454Z","errorDetails":[],"displayName":"DorothysSurface","machineFqdn":"DorothysSurface","osName":"windows","osVersion":"10.0.19044.1645","osType":"windows","osProfile":{"computerName":"DorothysSurface"},"vmId":"194cde1e-8ee6-425e-b231-a9ec7ecec8d8","vmUuid":"2883CCA3-7EE6-60E9-A204-97718B655D1D","clientPublicKey":"MIIBCgKCAQEAzLWw7rpNN42u19EbdGGfI0+aqdQKwbQA+Dh6iBsIgJM4R2uyuMiZxB+ek6pq3XhM9aQ7Kuooo7vNzIEGLI/RHMS+rMNrFQcQpqmKTKV8NDb2KB/1siovUL2vNXl2X8D8a0/y2MDk/ID1KCXF0bQlmaP5Rji8E9bb+owJNKvfgp2S+0N9Vu9VfBlewzztpwJJKqnBkzAR76ehfTYpmHpoYlvYxtWFGrpri2sEOSsRLf6QgzFy6vPxnYgDfMw/hC3X7x1BmFVBcY8QrGhJ/Nu6ZHsfwrH6PiK8XB58R0OyIRWcKK1FtEt3j2lTdkd7bsl8NBeQDm8L7deSRSIiPAc4pwIDAQAB","osSku":"Windows - 10 Enterprise","domainName":"WORKGROUP","adFqdn":"DorothysSurface","dnsFqdn":"DorothysSurface","mssqlDiscovered":"false","cloudMetadata":{"provider":"N/A"},"detectedProperties":{"cloudprovider":"N/A","manufacturer":"Microsoft - Corporation","model":"Surface Book 2","mssqldiscovered":"false"},"agentConfiguration":{"proxyUrl":"","incomingConnectionsPorts":[],"extensionsAllowList":[],"extensionsBlockList":[],"proxyBypass":[],"extensionsEnabled":"true","guestConfigurationEnabled":"true"},"serviceStatuses":{"extensionService":{"status":"running","startupType":"automatic"},"guestConfigurationService":{"status":"running","startupType":"automatic"}}},"resources":[]}' - headers: - cache-control: - - no-cache - content-length: - - '1882' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 May 2022 23:00:44 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine list - Connection: - - keep-alive - ParameterSetName: - - -g - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines?api-version=2022-03-10 - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine","name":"testMachine","location":"eastus2euap","tags":{},"identity":{"type":"SystemAssigned","principalId":"fc9a4766-a5d2-41d3-8fdd-3a32ddb4343a","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"type":"Microsoft.HybridCompute/machines","properties":{"provisioningState":"Succeeded","agentVersion":"1.18.01965.249","status":"Connected","lastStatusChange":"2022-05-23T22:55:52.7801454Z","errorDetails":[],"displayName":"DorothysSurface","machineFqdn":"DorothysSurface","osName":"windows","osVersion":"10.0.19044.1645","osType":"windows","osProfile":{"computerName":"DorothysSurface"},"vmId":"194cde1e-8ee6-425e-b231-a9ec7ecec8d8","vmUuid":"2883CCA3-7EE6-60E9-A204-97718B655D1D","clientPublicKey":"MIIBCgKCAQEAzLWw7rpNN42u19EbdGGfI0+aqdQKwbQA+Dh6iBsIgJM4R2uyuMiZxB+ek6pq3XhM9aQ7Kuooo7vNzIEGLI/RHMS+rMNrFQcQpqmKTKV8NDb2KB/1siovUL2vNXl2X8D8a0/y2MDk/ID1KCXF0bQlmaP5Rji8E9bb+owJNKvfgp2S+0N9Vu9VfBlewzztpwJJKqnBkzAR76ehfTYpmHpoYlvYxtWFGrpri2sEOSsRLf6QgzFy6vPxnYgDfMw/hC3X7x1BmFVBcY8QrGhJ/Nu6ZHsfwrH6PiK8XB58R0OyIRWcKK1FtEt3j2lTdkd7bsl8NBeQDm8L7deSRSIiPAc4pwIDAQAB","osSku":"Windows - 10 Enterprise","domainName":"WORKGROUP","adFqdn":"DorothysSurface","dnsFqdn":"DorothysSurface","mssqlDiscovered":"false","cloudMetadata":{"provider":"N/A"},"detectedProperties":{"cloudprovider":"N/A","manufacturer":"Microsoft - Corporation","model":"Surface Book 2","mssqldiscovered":"false"},"agentConfiguration":{"proxyUrl":"","incomingConnectionsPorts":[],"extensionsAllowList":[],"extensionsBlockList":[],"proxyBypass":[],"extensionsEnabled":"true","guestConfigurationEnabled":"true"},"serviceStatuses":{"extensionService":{"status":"running","startupType":"automatic"},"guestConfigurationService":{"status":"running","startupType":"automatic"}}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/dorothylinux2-Virtual-Machine","name":"dorothylinux2-Virtual-Machine","location":"eastus2euap","tags":{},"identity":{"type":"SystemAssigned","principalId":"5ce02094-bd55-44ba-b1e4-2d56b6a6ba69","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"type":"Microsoft.HybridCompute/machines","properties":{"provisioningState":"Succeeded","agentVersion":"1.7.21162.005","status":"Expired","lastStatusChange":"2021-09-30T06:14:01.8555779Z","errorDetails":[],"displayName":"dorothylinux2-Virtual-Machine","machineFqdn":"dorothylinux2-Virtual-Machine","osName":"linux","osVersion":"5.8.0-59-generic","osType":"linux","osProfile":{"computerName":"dorothylinux2-Virtual-Machine","linuxConfiguration":{"patchSettings":{"assessmentMode":"null"}}},"vmId":"8948ef10-f369-471d-b363-8e2ff44614ca","vmUuid":"80f26cf0-d9a7-4637-a2ff-587bd51626fc","clientPublicKey":"MIIBCgKCAQEAukhdoNaMfaHRGP6MvgdWdyefHdET/mV0J3NdpMU+LFRE5IWwZxG+mGOb2lK3dsgX6HenWyRiumC2BMDX6RuLfRuscZw+HT/W4W/9ScDxbD18o4vECD7DmiFmIs4iPaF8GLTjO2fJzjAl59k7nblfr38SexA8EKo5WqG2LFhbT6CAXtBMPtWebWeZCQ3uXCri8838nDtqhQtqY6Efg4A2sEV9s4Mk7LjINpzcVuPYdvxcFngM22hixUawE9GH8UKIV5XF+/c8xk1b1fvUGizf+sNbgSMZFyJ3Vgg5ne5ibepxyR3WBtmvd3L/mF1negSh/5h9QQKTt7djeUYCb+ztjwIDAQAB","osSku":"Ubuntu - 20.04 LTS","domainName":"unknown","adFqdn":"unknown","dnsFqdn":"dorothylinux2-Virtual-Machine","mssqlDiscovered":"false","detectedProperties":{"cloudprovider":"N/A","manufacturer":"Microsoft - Corporation","model":"Virtual Machine","mssqldiscovered":"false"},"agentConfiguration":{}}}]}' - headers: - cache-control: - - no-cache - content-length: - - '3516' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 May 2022 23:00:45 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"location": "eastus2euap", "properties": {"publisher": "Microsoft.Compute", - "type": "CustomScriptExtension", "typeHandlerVersion": "1.10.10", "enableAutomaticUpgrade": - true, "settings": {"commandToExecute": "hostname"}, "instanceView": {"name": - "custom-000001"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension create - Connection: - - keep-alive - Content-Length: - - '264' - Content-Type: - - application/json - ParameterSetName: - - --name --location --enable-auto-upgrade --type --publisher --type-handler-version - --machine-name --resource-group --settings - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/d3c75246-97de-491a-a4eb-01bee20c7d0b?api-version=2022-03-10 - cache-control: - - no-cache - content-length: - - '0' - content-type: - - application/json - date: - - Mon, 23 May 2022 23:00:49 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/d3c75246-97de-491a-a4eb-01bee20c7d0b?api-version=2022-03-10 - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-resource-requests: - - '319' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension create - Connection: - - keep-alive - ParameterSetName: - - --name --location --enable-auto-upgrade --type --publisher --type-handler-version - --machine-name --resource-group --settings - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/d3c75246-97de-491a-a4eb-01bee20c7d0b?api-version=2022-03-10 - response: - body: - string: '{"name":"d3c75246-97de-491a-a4eb-01bee20c7d0b","status":"Succeeded","startTime":"2022-05-23T23:00:49.6799697Z","properties":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}}' - headers: - cache-control: - - no-cache - content-length: - - '878' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 May 2022 23:02:49 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension create - Connection: - - keep-alive - ParameterSetName: - - --name --location --enable-auto-upgrade --type --publisher --type-handler-version - --machine-name --resource-group --settings - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}' - headers: - cache-control: - - no-cache - content-length: - - '753' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 May 2022 23:02:49 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension list - Connection: - - keep-alive - ParameterSetName: - - --machine-name -g - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions?api-version=2022-03-10 - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}]}' - headers: - cache-control: - - no-cache - content-length: - - '765' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 May 2022 23:02:50 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension show - Connection: - - keep-alive - ParameterSetName: - - --name --machine-name --resource-group - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}' - headers: - cache-control: - - no-cache - content-length: - - '753' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 May 2022 23:02:52 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"extensionTargets": {"Microsoft.Compute.CustomScriptExtension": {"targetVersion": - "1.10.12"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine upgrade-extension - Connection: - - keep-alive - Content-Length: - - '95' - Content-Type: - - application/json - ParameterSetName: - - --extension-targets --machine-name --resource-group - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/upgradeExtensions?api-version=2022-03-10 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/ea8afb78-b38f-4179-b7da-f2a94486f3a1?api-version=2022-03-10 - cache-control: - - no-cache - content-length: - - '0' - content-type: - - application/json - date: - - Mon, 23 May 2022 23:02:53 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/ea8afb78-b38f-4179-b7da-f2a94486f3a1?api-version=2022-03-10 - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine upgrade-extension - Connection: - - keep-alive - ParameterSetName: - - --extension-targets --machine-name --resource-group - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/ea8afb78-b38f-4179-b7da-f2a94486f3a1?api-version=2022-03-10 - response: - body: - string: '{"name":"ea8afb78-b38f-4179-b7da-f2a94486f3a1","status":"Succeeded","startTime":"2022-05-23T23:02:53.8776167Z","properties":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}]}' - headers: - cache-control: - - no-cache - content-length: - - '881' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 May 2022 23:07:54 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine upgrade-extension - Connection: - - keep-alive - ParameterSetName: - - --extension-targets --machine-name --resource-group - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/ea8afb78-b38f-4179-b7da-f2a94486f3a1?api-version=2022-03-10 - response: - body: - string: '[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: DorothysSurface\r\n"}}}}]' - headers: - cache-control: - - no-cache - content-length: - - '756' - content-type: - - application/json - date: - - Mon, 23 May 2022 23:07:54 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"properties": {"enableAutomaticUpgrade": false, "settings": {"commandToExecute": - "dir"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension update - Connection: - - keep-alive - Content-Length: - - '90' - Content-Type: - - application/json - ParameterSetName: - - --name --enable-auto-upgrade --settings --machine-name --resource-group - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: PATCH - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/44ade452-9ccb-4611-9e84-fdad48bffc87?api-version=2022-03-10 - cache-control: - - no-cache - content-length: - - '0' - content-type: - - application/json - date: - - Mon, 23 May 2022 23:07:56 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/44ade452-9ccb-4611-9e84-fdad48bffc87?api-version=2022-03-10 - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-resource-requests: - - '319' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension update - Connection: - - keep-alive - ParameterSetName: - - --name --enable-auto-upgrade --settings --machine-name --resource-group - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/44ade452-9ccb-4611-9e84-fdad48bffc87?api-version=2022-03-10 - response: - body: - string: '{"name":"44ade452-9ccb-4611-9e84-fdad48bffc87","status":"Succeeded","startTime":"2022-05-23T23:07:56.9038639Z","properties":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"dir"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: Volume in drive C has no label.\r\n - Volume Serial Number is 867D-A9DE\r\n\r\n Directory of C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.12\\Downloads\\1\r\n\r\n05/23/2022 04:08 - PM .\r\n05/23/2022 04:08 PM ..\r\n 0 - File(s) 0 bytes\r\n 2 Dir(s) 270,794,014,720 bytes - free\r\n"}}}}}' - headers: - cache-control: - - no-cache - content-length: - - '1233' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 May 2022 23:09:56 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension update - Connection: - - keep-alive - ParameterSetName: - - --name --enable-auto-upgrade --settings --machine-name --resource-group - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001","name":"custom-000001","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"dir"},"provisioningState":"Succeeded","instanceView":{"name":"custom-000001","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"success","level":"Information","message":"Extension - Message: Command execution finished, StdOut: Volume in drive C has no label.\r\n - Volume Serial Number is 867D-A9DE\r\n\r\n Directory of C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.12\\Downloads\\1\r\n\r\n05/23/2022 04:08 - PM .\r\n05/23/2022 04:08 PM ..\r\n 0 - File(s) 0 bytes\r\n 2 Dir(s) 270,794,014,720 bytes - free\r\n"}}}}' - headers: - cache-control: - - no-cache - content-length: - - '1108' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 May 2022 23:09:57 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -y --name --machine-name --resource-group - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine/extensions/custom-000001?api-version=2022-03-10 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/5140375a-e5a8-4698-9823-b9e9a38b00cd?api-version=2022-03-10 - cache-control: - - no-cache - content-length: - - '0' - content-type: - - application/json - date: - - Mon, 23 May 2022 23:10:01 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/5140375a-e5a8-4698-9823-b9e9a38b00cd?api-version=2022-03-10 - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine extension delete - Connection: - - keep-alive - ParameterSetName: - - -y --name --machine-name --resource-group - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/5140375a-e5a8-4698-9823-b9e9a38b00cd?api-version=2022-03-10 - response: - body: - string: '{"name":"5140375a-e5a8-4698-9823-b9e9a38b00cd","status":"Succeeded","startTime":"2022-05-23T23:10:01.0608346Z"}' - headers: - cache-control: - - no-cache - content-length: - - '111' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 May 2022 23:12:01 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedmachine delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -y --name --resource-group - User-Agent: - - AZURECLI/2.32.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testMachine?api-version=2022-03-10 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - content-type: - - application/json - date: - - Mon, 23 May 2022 23:12:06 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 200 - message: OK -version: 1 diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_machine_and_extension.yaml b/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_machine_and_extension.yaml new file mode 100644 index 00000000000..5793b995dca --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_machine_and_extension.yaml @@ -0,0 +1,2200 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine","name":"testmachine","location":"eastus2euap","tags":{},"identity":{"type":"SystemAssigned","principalId":"4fd2261f-4664-4ff3-b7e6-e713648070da","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"type":"Microsoft.HybridCompute/machines","properties":{"provisioningState":"Succeeded","agentVersion":"1.33.02399.1173","status":"Connected","lastStatusChange":"2023-08-07T22:25:03.0904274Z","errorDetails":[],"displayName":"LAPTOP-S0HSJ7FB","machineFqdn":"LAPTOP-S0HSJ7FB","osName":"windows","osVersion":"6.2.9200.3208","osType":"windows","osProfile":{"computerName":"LAPTOP-S0HSJ7FB"},"vmId":"8443d520-2330-4ab0-9bbd-fa6ac84e1698","vmUuid":"1A9E1B42-3894-11EC-80F0-84A9388B55FE","clientPublicKey":"MIIBCgKCAQEAwRhntzC0w8sWz4LY1rKjn0oh8KkhK/t2o7M/Y7dtxH9pSrIcJ/VdvXxRfsAMbnyr93x+OaaxQoGsfKM9D1GuTKklJ6Kc7P9QmB88yHRfiX+o+vm7WwVDncjnaek+gNc9W7psWlshmXfaBslv70W/ZZxoUveCZyFYoZva91TvhBS5WM11kb3kfsC9mwQpxHqwg6i+qjZ3mMSmF++e/vJfgWqQAfOR1u6ikT22hKaOpQgRa+xCp1J6Zrx+2K70Okyq3Xny2RTSoIs9Dmt6BRwXgUayfcSh12DQZq5twIzFPZi9W621CYm526z0Y+ILmZkhHsaJjGRO1rZewVVTaX9rIQIDAQAB","osSku":"Windows + 10 Enterprise","domainName":"WORKGROUP","adFqdn":"LAPTOP-S0HSJ7FB","dnsFqdn":"LAPTOP-S0HSJ7FB","mssqlDiscovered":"false","cloudMetadata":{"provider":"N/A"},"detectedProperties":{"cloudprovider":"N/A","coreCount":"4","logicalCoreCount":"8","manufacturer":"LENOVO","model":"20Y0S2PE00","mssqldiscovered":"false","processorCount":"1","productType":"4"},"agentConfiguration":{"proxyUrl":"","incomingConnectionsPorts":[],"extensionsAllowList":[],"extensionsBlockList":[],"proxyBypass":[],"extensionsEnabled":"true","guestConfigurationEnabled":"true","configMode":"full"},"serviceStatuses":{"extensionService":{"status":"running","startupType":"automatic"},"guestConfigurationService":{"status":"running","startupType":"automatic"}},"agentUpgrade":{"enableAutomaticUpgrade":false},"networkProfile":{"networkInterfaces":[{"ipAddresses":[{"address":"172.31.32.1","ipAddressVersion":"IPv4","subnet":{"addressPrefix":"172.31.32.0/20"}}]},{"ipAddresses":[{"address":"10.144.1.251","ipAddressVersion":"IPv4","subnet":{"addressPrefix":"10.144.1.0/24"}}]},{"ipAddresses":[{"address":"2001:0:2877:7aa:2c2b:10ef:f354:db0b","ipAddressVersion":"IPv6","subnet":{"addressPrefix":"2001:0:2877:7aa::/64"}}]}]}},"resources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test","name":"custom-test","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-test","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"0","level":"Information","message":"Extension + Message: Command execution finished, StdOut: LAPTOP-S0HSJ7FB\r\n"}}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/WindowsOsUpdateExtension","name":"WindowsOsUpdateExtension","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.SoftwareUpdateManagement","type":"WindowsOsUpdateExtension","typeHandlerVersion":"1.0.15.0","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"updateConfiguration":{"activityId":"c6504ee8-dd71-4495-b978-7aee41a928b5","startTime":"2023-08-07T22:55:37.0925719Z","action":"Assessment"}},"provisioningState":"Succeeded","instanceView":{"name":"WindowsOsUpdateExtension","type":"WindowsOsUpdateExtension","typeHandlerVersion":"1.0.15.0","status":{"code":"0","level":"Information","message":"Extension + Message: Assessment operation with activity id c6504ee8-dd71-4495-b978-7aee41a928b5 + completed successfully. 6 patches were found. , OperationResult: {\"activityId\":\"c6504ee8-dd71-4495-b978-7aee41a928b5\",\"inputStartTime\":\"2023-08-07T22:55:37Z\",\"lastModifiedTime\":\"2023-08-07T22:55:57Z\",\"extensionTriggerTime\":\"2023-08-07T22:55:45Z\",\"action\":\"Assessment\",\"actionStatus\":\"success\",\"patchServiceUsed\":\"WU\",\"assessmentDetails\":{\"rebootPending\":false,\"countByCategory\":{\"critical\":0,\"security\":0,\"updateRollup\":0,\"featurePack\":0,\"servicePack\":0,\"definition\":0,\"tools\":0,\"updates\":0,\"other\":6},\"totalCount\":6,\"patches\":\"zdRLa9wwEADgv7L4nPGO3tLe2oTSQHJJAoWGHEavxnR3ndrehFD63ztOoOmLtksvCz7YssSMPs3o+nOzu8s0ldPcrBqS0gZUEVzRDnRRBbw3AtAXFCJEZ31tjpotbQrPPt1OZb2AxeXjOJUNv+ilkEuJwi2EXCHys3h1zuNCt9K32rVWIS//GOdg2916fdSkNY1jV7tEU9dvx2Z1fcODnM+HfujK/N2UWJOoyYATpEFXFyFQIlAxkEElUBM2vGoose+n1+WW7rt+4PyOaXtRPu3KOF08/eLQd7u47sbbkk84xFX3tA1O2AMqkPoK3XPa73nqZhzSZbkvQzc9Pmf75egHrGycKwYJasQIWicPXpoMkaKrpgjhKb1gnXdp6Me+Tuzx9vTkeN73TINL6WYz85NZaEMr0LcHCxZAiD3BKHlJIkANkUCbkIHU7Gds1lFJW4n+UF1hKcJvq0u0rkXGwoO1MiD3tKpWVY+5cjVVCTpyhtFaA1Y5q2JG6bx6sTor2/6+X5xNuWWQN92weaChzDatRbY5SBipAC3IsB+MrSY5tBZEkgg68RUVnUAwCWsuMvtc5QvMu26b+4eRa+SbQGNQeuHnSf/AoKwPMXNrR8mnqKlq8FkTkFVB6mRKyOb/GdzeveSir5Zy4JPRHnSIAihprpSa+NoO0mipf6mP75pJtqIV5nALg5vmryI3XwE=\",\"action\":\"Assessment\"},\"topLevelStatusMessage\":\"Assessment + operation with activity id c6504ee8-dd71-4495-b978-7aee41a928b5 completed + successfully. 6 patches were found. \",\"internalErrorMessage\":\"\",\"topLevelStatus\":0,\"logs\":\"i44FAA==\",\"errorCount\":0,\"failureRetryCount\":0,\"retriggerCount\":0,\"sequenceNumber\":1,\"errors\":null}"}}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '5742' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:09:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines?api-version=2022-12-27 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine","name":"testmachine","location":"eastus2euap","type":"Microsoft.HybridCompute/machines","tags":{},"identity":{"type":"SystemAssigned","principalId":"4fd2261f-4664-4ff3-b7e6-e713648070da","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"properties":{"provisioningState":"Succeeded","agentVersion":"1.33.02399.1173","status":"Connected","lastStatusChange":"2023-08-07T22:25:03.0904274Z","errorDetails":[],"displayName":"LAPTOP-S0HSJ7FB","machineFqdn":"LAPTOP-S0HSJ7FB","osName":"windows","osVersion":"6.2.9200.3208","osType":"windows","osProfile":{"computerName":"LAPTOP-S0HSJ7FB"},"vmId":"8443d520-2330-4ab0-9bbd-fa6ac84e1698","vmUuid":"1A9E1B42-3894-11EC-80F0-84A9388B55FE","clientPublicKey":"MIIBCgKCAQEAwRhntzC0w8sWz4LY1rKjn0oh8KkhK/t2o7M/Y7dtxH9pSrIcJ/VdvXxRfsAMbnyr93x+OaaxQoGsfKM9D1GuTKklJ6Kc7P9QmB88yHRfiX+o+vm7WwVDncjnaek+gNc9W7psWlshmXfaBslv70W/ZZxoUveCZyFYoZva91TvhBS5WM11kb3kfsC9mwQpxHqwg6i+qjZ3mMSmF++e/vJfgWqQAfOR1u6ikT22hKaOpQgRa+xCp1J6Zrx+2K70Okyq3Xny2RTSoIs9Dmt6BRwXgUayfcSh12DQZq5twIzFPZi9W621CYm526z0Y+ILmZkhHsaJjGRO1rZewVVTaX9rIQIDAQAB","osSku":"Windows + 10 Enterprise","domainName":"WORKGROUP","adFqdn":"LAPTOP-S0HSJ7FB","dnsFqdn":"LAPTOP-S0HSJ7FB","mssqlDiscovered":"false","cloudMetadata":{"provider":"N/A"},"detectedProperties":{"cloudprovider":"N/A","coreCount":"4","logicalCoreCount":"8","manufacturer":"LENOVO","model":"20Y0S2PE00","mssqldiscovered":"false","processorCount":"1","productType":"4"},"agentConfiguration":{"proxyUrl":"","incomingConnectionsPorts":[],"extensionsAllowList":[],"extensionsBlockList":[],"proxyBypass":[],"extensionsEnabled":"true","guestConfigurationEnabled":"true","configMode":"full"},"serviceStatuses":{"extensionService":{"status":"running","startupType":"automatic"},"guestConfigurationService":{"status":"running","startupType":"automatic"}},"agentUpgrade":{"enableAutomaticUpgrade":false},"networkProfile":{"networkInterfaces":[{"ipAddresses":[{"address":"172.31.32.1","ipAddressVersion":"IPv4","subnet":{"addressPrefix":"172.31.32.0/20"}}]},{"ipAddresses":[{"address":"10.144.1.251","ipAddressVersion":"IPv4","subnet":{"addressPrefix":"10.144.1.0/24"}}]},{"ipAddresses":[{"address":"2001:0:2877:7aa:2c2b:10ef:f354:db0b","ipAddressVersion":"IPv6","subnet":{"addressPrefix":"2001:0:2877:7aa::/64"}}]}]}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '2418' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:09:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "properties": {"enableAutomaticUpgrade": true, + "publisher": "Microsoft.Compute", "settings": {"commandToExecute": "hostname"}, + "type": "CustomScriptExtension", "typeHandlerVersion": "1.10.10"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension create + Connection: + - keep-alive + Content-Length: + - '221' + Content-Type: + - application/json + ParameterSetName: + - --name --location --enable-automatic-upgrade --type --publisher --type-handler-version + --machine-name --resource-group --settings + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test?api-version=2022-12-27 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/dbadf993-5fc7-4bad-b920-e7849b33cfcd?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Mon, 07 Aug 2023 23:09:06 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/dbadf993-5fc7-4bad-b920-e7849b33cfcd?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '319' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension create + Connection: + - keep-alive + ParameterSetName: + - --name --location --enable-automatic-upgrade --type --publisher --type-handler-version + --machine-name --resource-group --settings + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/dbadf993-5fc7-4bad-b920-e7849b33cfcd?api-version=2022-12-27 + response: + body: + string: '{"name":"dbadf993-5fc7-4bad-b920-e7849b33cfcd","status":"Queued","startTime":"2023-08-07T23:09:06.7996939Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/dbadf993-5fc7-4bad-b920-e7849b33cfcd?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:09:06 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/dbadf993-5fc7-4bad-b920-e7849b33cfcd?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension create + Connection: + - keep-alive + ParameterSetName: + - --name --location --enable-automatic-upgrade --type --publisher --type-handler-version + --machine-name --resource-group --settings + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/dbadf993-5fc7-4bad-b920-e7849b33cfcd?api-version=2022-12-27 + response: + body: + string: '{"name":"dbadf993-5fc7-4bad-b920-e7849b33cfcd","status":"InProgress","startTime":"2023-08-07T23:09:06.7996939Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/dbadf993-5fc7-4bad-b920-e7849b33cfcd?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '112' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:11:06 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/dbadf993-5fc7-4bad-b920-e7849b33cfcd?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension create + Connection: + - keep-alive + ParameterSetName: + - --name --location --enable-automatic-upgrade --type --publisher --type-handler-version + --machine-name --resource-group --settings + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/dbadf993-5fc7-4bad-b920-e7849b33cfcd?api-version=2022-12-27 + response: + body: + string: '{"name":"dbadf993-5fc7-4bad-b920-e7849b33cfcd","status":"Succeeded","startTime":"2023-08-07T23:09:06.7996939Z","properties":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test","name":"custom-test","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-test","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"0","level":"Information","message":"Extension + Message: Command execution finished, StdOut: LAPTOP-S0HSJ7FB\r\n"}}}}}' + headers: + cache-control: + - no-cache + content-length: + - '866' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:13:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension create + Connection: + - keep-alive + ParameterSetName: + - --name --location --enable-automatic-upgrade --type --publisher --type-handler-version + --machine-name --resource-group --settings + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test","name":"custom-test","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-test","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"0","level":"Information","message":"Extension + Message: Command execution finished, StdOut: LAPTOP-S0HSJ7FB\r\n"}}}}' + headers: + cache-control: + - no-cache + content-length: + - '741' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:13:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"maximumDuration": "PT4H", "rebootSetting": "IfRequired", "windowsParameters": + {"classificationsToInclude": ["Critical", "Security"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine install-patches + Connection: + - keep-alive + Content-Length: + - '135' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --name --maximum-duration --reboot-setting --windows-parameters + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/installPatches?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:13:17 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine install-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --maximum-duration --reboot-setting --windows-parameters + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:13:17 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine install-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --maximum-duration --reboot-setting --windows-parameters + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:13:47 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine install-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --maximum-duration --reboot-setting --windows-parameters + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:14:18 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '997' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine install-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --maximum-duration --reboot-setting --windows-parameters + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:14:48 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '996' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine install-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --maximum-duration --reboot-setting --windows-parameters + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:15:18 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '995' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine install-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --maximum-duration --reboot-setting --windows-parameters + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:15:48 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '994' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine install-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --maximum-duration --reboot-setting --windows-parameters + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:16:18 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '993' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine install-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --maximum-duration --reboot-setting --windows-parameters + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/80622c71-7e18-40ce-ac82-9f524d4dea97?api-version=2022-12-27 + response: + body: + string: '{"startDateTime":"2023-08-07T23:13:16.8321253Z","lastModifiedDateTime":"2023-08-07T23:16:22.4147538Z","startedBy":"User","patchServiceUsed":"WU","status":"Succeeded","maintenanceWindowExceeded":false,"rebootStatus":"NotNeeded","notSelectedPatchCount":6,"pendingPatchCount":0,"failedPatchCount":0,"installedPatchCount":0,"excludedPatchCount":0,"osType":"Windows","installationActivityId":"80622c71-7e18-40ce-ac82-9f524d4dea97"}' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '426' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:16:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '992' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine assess-patches + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/assessPatches?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:16:51 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine assess-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:16:51 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine assess-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:17:21 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine assess-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:17:51 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '997' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine assess-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:18:21 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '996' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine assess-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:18:51 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '995' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine assess-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:19:22 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '994' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine assess-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 07 Aug 2023 23:19:52 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '993' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine assess-patches + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/updateCenterOperationResults/a16ec1df-b83a-4fcb-abf4-cb63a6878608?api-version=2022-12-27 + response: + body: + string: '{"startDateTime":"2023-08-07T23:16:51.6655543Z","lastModifiedDateTime":"2023-08-07T23:19:56.476838Z","startedBy":"User","rebootPending":false,"patchServiceUsed":"WU","status":"Succeeded","availablePatchCountByClassification":{"security":0,"critical":0,"definition":0,"updateRollup":0,"featurePack":0,"servicePack":0,"tools":0,"updates":0},"assessmentActivityId":"a16ec1df-b83a-4fcb-abf4-cb63a6878608","osType":"Windows"}' + headers: + api-supported-versions: + - 2020-08-15-preview + cache-control: + - no-cache + content-length: + - '420' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:20:22 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '992' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension list + Connection: + - keep-alive + ParameterSetName: + - --machine-name -g + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions?api-version=2022-12-27 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test","name":"custom-test","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-test","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"0","level":"Information","message":"Extension + Message: Command execution finished, StdOut: LAPTOP-S0HSJ7FB\r\n"}}}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/WindowsOsUpdateExtension","name":"WindowsOsUpdateExtension","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.SoftwareUpdateManagement","type":"WindowsOsUpdateExtension","typeHandlerVersion":"1.0.15.0","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"updateConfiguration":{"activityId":"a16ec1df-b83a-4fcb-abf4-cb63a6878608","startTime":"2023-08-07T23:16:51.6655543Z","action":"Assessment"}},"provisioningState":"Succeeded","instanceView":{"name":"WindowsOsUpdateExtension","type":"WindowsOsUpdateExtension","typeHandlerVersion":"1.0.15.0","status":{"code":"0","level":"Information","message":"Extension + Message: Assessment operation with activity id a16ec1df-b83a-4fcb-abf4-cb63a6878608 + completed successfully. 6 patches were found. , OperationResult: {\"activityId\":\"a16ec1df-b83a-4fcb-abf4-cb63a6878608\",\"inputStartTime\":\"2023-08-07T23:16:51Z\",\"lastModifiedTime\":\"2023-08-07T23:17:15Z\",\"extensionTriggerTime\":\"2023-08-07T23:17:03Z\",\"action\":\"Assessment\",\"actionStatus\":\"success\",\"patchServiceUsed\":\"WU\",\"assessmentDetails\":{\"rebootPending\":false,\"countByCategory\":{\"critical\":0,\"security\":0,\"updateRollup\":0,\"featurePack\":0,\"servicePack\":0,\"definition\":0,\"tools\":0,\"updates\":0,\"other\":6},\"totalCount\":6,\"patches\":\"zdRLa9wwEADgv7L4nPGO3tLe2oTSQHJJAoWGHEavxnR3ndrehFD63ztOoOmLtksvCz7YssSMPs3o+nOzu8s0ldPcrBqS0gZUEVzRDnRRBbw3AtAXFCJEZ31tjpotbQrPPt1OZb2AxeXjOJUNv+ilkEuJwi2EXCHys3h1zuNCt9K32rVWIS//GOdg2916fdSkNY1jV7tEU9dvx2Z1fcODnM+HfujK/N2UWJOoyYATpEFXFyFQIlAxkEElUBM2vGoose+n1+WW7rt+4PyOaXtRPu3KOF08/eLQd7u47sbbkk84xFX3tA1O2AMqkPoK3XPa73nqZhzSZbkvQzc9Pmf75egHrGycKwYJasQIWicPXpoMkaKrpgjhKb1gnXdp6Me+Tuzx9vTkeN73TINL6WYz85NZaEMr0LcHCxZAiD3BKHlJIkANkUCbkIHU7Gds1lFJW4n+UF1hKcJvq0u0rkXGwoO1MiD3tKpWVY+5cjVVCTpyhtFaA1Y5q2JG6bx6sTor2/6+X5xNuWWQN92weaChzDatRbY5SBipAC3IsB+MrSY5tBZEkgg68RUVnUAwCWsuMvtc5QvMu26b+4eRa+SbQGNQeuHnSf/AoKwPMXNrR8mnqKlq8FkTkFVB6mRKyOb/GdzeveSir5Zy4JPRHnSIAihprpSa+NoO0mipf6mP75pJtqIV5nALg5vmryI3XwE=\",\"action\":\"Assessment\"},\"topLevelStatusMessage\":\"Assessment + operation with activity id a16ec1df-b83a-4fcb-abf4-cb63a6878608 completed + successfully. 6 patches were found. \",\"internalErrorMessage\":\"\",\"topLevelStatus\":0,\"logs\":\"i44FAA==\",\"errorCount\":0,\"failureRetryCount\":0,\"retriggerCount\":0,\"sequenceNumber\":3,\"errors\":null}"}}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '3333' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:20:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension show + Connection: + - keep-alive + ParameterSetName: + - --name --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test","name":"custom-test","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-test","type":"CustomScriptExtension","typeHandlerVersion":"1.10.10","status":{"code":"0","level":"Information","message":"Extension + Message: Command execution finished, StdOut: LAPTOP-S0HSJ7FB\r\n"}}}}' + headers: + cache-control: + - no-cache + content-length: + - '741' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:20:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension image show + Connection: + - keep-alive + ParameterSetName: + - --publisher --extension-type --location --version + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/publishers/Microsoft.Compute/extensionTypes/CustomScriptExtension/versions/1.10.10?api-version=2022-12-27 + response: + body: + string: '{"id":"/providers/Microsoft.HybridCompute/locations/eastus2euap/publishers/microsoft.compute/extensionTypes/customscriptextension/versions/1.10.10","location":"eastus2euap","properties":{"version":"1.10.10","extensionType":"customscriptextension","publisher":"microsoft.compute"}}' + headers: + cache-control: + - no-cache + content-length: + - '280' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:20:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension image list + Connection: + - keep-alive + ParameterSetName: + - --publisher --extension-type --location + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/publishers/Microsoft.Compute/extensionTypes/CustomScriptExtension/versions?api-version=2022-12-27 + response: + body: + string: '{"value":[{"id":"/providers/Microsoft.HybridCompute/locations/eastus2euap/publishers/microsoft.compute/extensionTypes/customscriptextension/versions/1.10.15","location":"eastus2euap","properties":{"version":"1.10.15","extensionType":"customscriptextension","publisher":"microsoft.compute"}},{"id":"/providers/Microsoft.HybridCompute/locations/eastus2euap/publishers/microsoft.compute/extensionTypes/customscriptextension/versions/1.10.14","location":"eastus2euap","properties":{"version":"1.10.14","extensionType":"customscriptextension","publisher":"microsoft.compute"}},{"id":"/providers/Microsoft.HybridCompute/locations/eastus2euap/publishers/microsoft.compute/extensionTypes/customscriptextension/versions/1.10.12","location":"eastus2euap","properties":{"version":"1.10.12","extensionType":"customscriptextension","publisher":"microsoft.compute"}},{"id":"/providers/Microsoft.HybridCompute/locations/eastus2euap/publishers/microsoft.compute/extensionTypes/customscriptextension/versions/1.10.11","location":"eastus2euap","properties":{"version":"1.10.11","extensionType":"customscriptextension","publisher":"microsoft.compute"}},{"id":"/providers/Microsoft.HybridCompute/locations/eastus2euap/publishers/microsoft.compute/extensionTypes/customscriptextension/versions/1.10.10","location":"eastus2euap","properties":{"version":"1.10.10","extensionType":"customscriptextension","publisher":"microsoft.compute"}},{"id":"/providers/Microsoft.HybridCompute/locations/eastus2euap/publishers/microsoft.compute/extensionTypes/customscriptextension/versions/1.10.9","location":"eastus2euap","properties":{"version":"1.10.9","extensionType":"customscriptextension","publisher":"microsoft.compute"}},{"id":"/providers/Microsoft.HybridCompute/locations/eastus2euap/publishers/microsoft.compute/extensionTypes/customscriptextension/versions/1.10.8","location":"eastus2euap","properties":{"version":"1.10.8","extensionType":"customscriptextension","publisher":"microsoft.compute"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1974' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:20:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"extensionTargets": {"Microsoft.Compute.CustomScriptExtension": {"targetVersion": + "1.10.12"}}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine upgrade-extension + Connection: + - keep-alive + Content-Length: + - '95' + Content-Type: + - application/json + ParameterSetName: + - --extension-targets --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/upgradeExtensions?api-version=2022-12-27 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Mon, 07 Aug 2023 23:20:27 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine upgrade-extension + Connection: + - keep-alive + ParameterSetName: + - --extension-targets --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + response: + body: + string: '{"name":"640f0819-ed7f-4e2e-91aa-0c7dfe5159d7","status":"Queued","startTime":"2023-08-07T23:20:27.2477145Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:20:27 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine upgrade-extension + Connection: + - keep-alive + ParameterSetName: + - --extension-targets --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + response: + body: + string: '{"name":"640f0819-ed7f-4e2e-91aa-0c7dfe5159d7","status":"InProgress","startTime":"2023-08-07T23:20:27.2477145Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '112' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:22:27 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine upgrade-extension + Connection: + - keep-alive + ParameterSetName: + - --extension-targets --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + response: + body: + string: '{"name":"640f0819-ed7f-4e2e-91aa-0c7dfe5159d7","status":"InProgress","startTime":"2023-08-07T23:20:27.2477145Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '112' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:24:27 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine upgrade-extension + Connection: + - keep-alive + ParameterSetName: + - --extension-targets --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + response: + body: + string: '{"name":"640f0819-ed7f-4e2e-91aa-0c7dfe5159d7","status":"InProgress","startTime":"2023-08-07T23:20:27.2477145Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '112' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:26:28 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine upgrade-extension + Connection: + - keep-alive + ParameterSetName: + - --extension-targets --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/640f0819-ed7f-4e2e-91aa-0c7dfe5159d7?api-version=2022-12-27 + response: + body: + string: '{"name":"640f0819-ed7f-4e2e-91aa-0c7dfe5159d7","status":"Succeeded","startTime":"2023-08-07T23:20:27.2477145Z","properties":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test","name":"custom-test","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-test","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"0","level":"Information","message":"Extension + Message: Command execution finished, StdOut: LAPTOP-S0HSJ7FB\r\n"}}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '868' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:28:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension update + Connection: + - keep-alive + ParameterSetName: + - --name --enable-automatic-upgrade --settings --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test","name":"custom-test","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":true,"settings":{"commandToExecute":"hostname"},"provisioningState":"Succeeded","instanceView":{"name":"custom-test","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"0","level":"Information","message":"Extension + Message: Command execution finished, StdOut: LAPTOP-S0HSJ7FB\r\n"}}}}' + headers: + cache-control: + - no-cache + content-length: + - '741' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:28:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "properties": {"autoUpgradeMinorVersion": false, + "enableAutomaticUpgrade": false, "instanceView": {"name": "custom-test", "status": + {"code": "0", "level": "Information", "message": "Extension Message: Command + execution finished, StdOut: LAPTOP-S0HSJ7FB\r\n"}, "type": "CustomScriptExtension", + "typeHandlerVersion": "1.10.12"}, "publisher": "Microsoft.Compute", "settings": + {"commandToExecute": "dir"}, "type": "CustomScriptExtension", "typeHandlerVersion": + "1.10.12"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension update + Connection: + - keep-alive + Content-Length: + - '496' + Content-Type: + - application/json + ParameterSetName: + - --name --enable-automatic-upgrade --settings --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test?api-version=2022-12-27 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/2e7faab5-2672-4626-acd1-6ef5fd51105d?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Mon, 07 Aug 2023 23:28:30 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/2e7faab5-2672-4626-acd1-6ef5fd51105d?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '319' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension update + Connection: + - keep-alive + ParameterSetName: + - --name --enable-automatic-upgrade --settings --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/2e7faab5-2672-4626-acd1-6ef5fd51105d?api-version=2022-12-27 + response: + body: + string: '{"name":"2e7faab5-2672-4626-acd1-6ef5fd51105d","status":"Queued","startTime":"2023-08-07T23:28:31.0312588Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/2e7faab5-2672-4626-acd1-6ef5fd51105d?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:28:31 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/2e7faab5-2672-4626-acd1-6ef5fd51105d?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension update + Connection: + - keep-alive + ParameterSetName: + - --name --enable-automatic-upgrade --settings --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/2e7faab5-2672-4626-acd1-6ef5fd51105d?api-version=2022-12-27 + response: + body: + string: '{"name":"2e7faab5-2672-4626-acd1-6ef5fd51105d","status":"InProgress","startTime":"2023-08-07T23:28:31.0312588Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/2e7faab5-2672-4626-acd1-6ef5fd51105d?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '112' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:30:31 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/2e7faab5-2672-4626-acd1-6ef5fd51105d?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension update + Connection: + - keep-alive + ParameterSetName: + - --name --enable-automatic-upgrade --settings --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/2e7faab5-2672-4626-acd1-6ef5fd51105d?api-version=2022-12-27 + response: + body: + string: '{"name":"2e7faab5-2672-4626-acd1-6ef5fd51105d","status":"Succeeded","startTime":"2023-08-07T23:28:31.0312588Z","properties":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test","name":"custom-test","location":"eastus2euap","type":"Microsoft.HybridCompute/machines/extensions","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"dir"},"provisioningState":"Succeeded","instanceView":{"name":"custom-test","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"0","level":"Information","message":"Extension + Message: Command execution finished, StdOut: Volume in drive C is Windows\r\n + Volume Serial Number is 8ACF-78D8\r\n\r\n Directory of C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.12\\Downloads\\1\r\n\r\n08/07/2023 04:28 + PM .\r\n08/07/2023 04:28 PM ..\r\n 0 + File(s) 0 bytes\r\n 2 Dir(s) 265,810,886,656 bytes + free\r\n"}}}}}' + headers: + cache-control: + - no-cache + content-length: + - '1218' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:32:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension update + Connection: + - keep-alive + ParameterSetName: + - --name --enable-automatic-upgrade --settings --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test","name":"custom-test","type":"Microsoft.HybridCompute/machines/extensions","location":"eastus2euap","properties":{"publisher":"Microsoft.Compute","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","autoUpgradeMinorVersion":false,"enableAutomaticUpgrade":false,"settings":{"commandToExecute":"dir"},"provisioningState":"Succeeded","instanceView":{"name":"custom-test","type":"CustomScriptExtension","typeHandlerVersion":"1.10.12","status":{"code":"0","level":"Information","message":"Extension + Message: Command execution finished, StdOut: Volume in drive C is Windows\r\n + Volume Serial Number is 8ACF-78D8\r\n\r\n Directory of C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.12\\Downloads\\1\r\n\r\n08/07/2023 04:28 + PM .\r\n08/07/2023 04:28 PM ..\r\n 0 + File(s) 0 bytes\r\n 2 Dir(s) 265,810,886,656 bytes + free\r\n"}}}}' + headers: + cache-control: + - no-cache + content-length: + - '1093' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:32:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine/extensions/custom-test?api-version=2022-12-27 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Mon, 07 Aug 2023 23:32:33 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension delete + Connection: + - keep-alive + ParameterSetName: + - -y --name --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0?api-version=2022-12-27 + response: + body: + string: '{"name":"fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0","status":"Queued","startTime":"2023-08-07T23:32:33.3518788Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:32:33 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension delete + Connection: + - keep-alive + ParameterSetName: + - -y --name --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0?api-version=2022-12-27 + response: + body: + string: '{"name":"fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0","status":"InProgress","startTime":"2023-08-07T23:32:33.3518788Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '112' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:34:33 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine extension delete + Connection: + - keep-alive + ParameterSetName: + - -y --name --machine-name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0?api-version=2022-12-27 + response: + body: + string: '{"name":"fbdaedb4-c3fc-4e47-9039-a9edbb6e4fd0","status":"Succeeded","startTime":"2023-08-07T23:32:33.3518788Z"}' + headers: + cache-control: + - no-cache + content-length: + - '111' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 07 Aug 2023 23:36:33 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/machines/testmachine?api-version=2022-12-27 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Mon, 07 Aug 2023 23:36:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_private_link.yaml b/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_private_link.yaml new file mode 100644 index 00000000000..f8dd009e04c --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/recordings/test_private_link.yaml @@ -0,0 +1,1679 @@ +interactions: +- request: + body: '{"location": "eastus2euap"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - group create + Connection: + - keep-alive + Content-Length: + - '27' + Content-Type: + - application/json + ParameterSetName: + - -n -l + User-Agent: + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/az-sdk-test?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test","name":"az-sdk-test","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '224' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:05 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "properties": {"addressSpace": {"addressPrefixes": + ["10.0.0.0/16"]}, "enableDdosProtection": false, "enableVmProtection": false, + "subnets": [{"name": "subnet-test", "properties": {"addressPrefix": "10.0.0.0/24"}}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + Content-Length: + - '243' + Content-Type: + - application/json + ParameterSetName: + - -n -g -l --subnet-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"vnet-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test\",\r\n + \ \"etag\": \"W/\\\"c4501690-2764-4f83-8471-c6d95e4d25cc\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus2euap\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": + \"70674239-21b8-42d7-a4a9-c5bffbfc7bd4\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n + \ {\r\n \"name\": \"subnet-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test\",\r\n + \ \"etag\": \"W/\\\"c4501690-2764-4f83-8471-c6d95e4d25cc\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/cddf4365-c9f8-42aa-b419-cac53b045be7?api-version=2022-01-01 + cache-control: + - no-cache + content-length: + - '1232' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 9d5eb460-e529-493c-989e-b6fb83374508 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g -l --subnet-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/cddf4365-c9f8-42aa-b419-cac53b045be7?api-version=2022-01-01 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - c9153833-3312-4f79-8e7d-f6c6660af98c + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g -l --subnet-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/cddf4365-c9f8-42aa-b419-cac53b045be7?api-version=2022-01-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 118d77d1-9ee1-4539-b103-3b908d6f9cd3 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g -l --subnet-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"vnet-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test\",\r\n + \ \"etag\": \"W/\\\"822422bb-47b3-4753-b9c5-67b66fe63287\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus2euap\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": + \"70674239-21b8-42d7-a4a9-c5bffbfc7bd4\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": + [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n + \ {\r\n \"name\": \"subnet-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test\",\r\n + \ \"etag\": \"W/\\\"822422bb-47b3-4753-b9c5-67b66fe63287\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1234' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:20 GMT + etag: + - W/"822422bb-47b3-4753-b9c5-67b66fe63287" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - f3c3bccf-9d36-40a1-bb21-87fceec226ad + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"subnet-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test\",\r\n + \ \"etag\": \"W/\\\"822422bb-47b3-4753-b9c5-67b66fe63287\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '535' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:20 GMT + etag: + - W/"822422bb-47b3-4753-b9c5-67b66fe63287" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 53a0d246-c88b-41f6-bac7-c6e6b1e377af + status: + code: 200 + message: '' +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test", + "name": "subnet-test", "properties": {"addressPrefix": "10.0.0.0/24", "delegations": + [], "privateEndpointNetworkPolicies": "Disabled", "privateLinkServiceNetworkPolicies": + "Enabled"}, "type": "Microsoft.Network/virtualNetworks/subnets"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + Content-Length: + - '399' + Content-Type: + - application/json + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"subnet-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test\",\r\n + \ \"etag\": \"W/\\\"24e51d8b-4557-4da7-82b3-c49f1a051519\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/efd7ed15-82bb-4928-818f-104fae0de047?api-version=2022-01-01 + cache-control: + - no-cache + content-length: + - '535' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 42f9e3b3-19c4-47b4-b785-ab714ff9fabd + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/efd7ed15-82bb-4928-818f-104fae0de047?api-version=2022-01-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - a167ce44-e03b-44b5-9511-7c50701ae6bf + status: + code: 200 + message: '' +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"subnet-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test\",\r\n + \ \"etag\": \"W/\\\"24e51d8b-4557-4da7-82b3-c49f1a051519\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '535' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:21 GMT + etag: + - W/"24e51d8b-4557-4da7-82b3-c49f1a051519" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - b0a768e4-df53-44dd-b299-96037fb58ef4 + status: + code: 200 + message: '' +- request: + body: '{"location": "eastus2euap", "properties": {"publicNetworkAccess": "Disabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope create + Connection: + - keep-alive + Content-Length: + - '78' + Content-Type: + - application/json + ParameterSetName: + - --location --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test","name":"scope-test","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","properties":{"privateLinkScopeId":"a10ff14f-baa9-4d83-a0af-1ac85460dc07","publicNetworkAccess":"Disabled","provisioningState":"Succeeded","privateEndpointConnections":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '418' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope update + Connection: + - keep-alive + ParameterSetName: + - --tags --public-network-access --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test","name":"scope-test","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","properties":{"privateLinkScopeId":"a10ff14f-baa9-4d83-a0af-1ac85460dc07","publicNetworkAccess":"Disabled","provisioningState":"Succeeded","privateEndpointConnections":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '418' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "properties": {"publicNetworkAccess": "Enabled"}, + "tags": {"Tag1": "Value1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope update + Connection: + - keep-alive + Content-Length: + - '105' + Content-Type: + - application/json + ParameterSetName: + - --tags --public-network-access --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test","name":"scope-test","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","properties":{"privateLinkScopeId":"a10ff14f-baa9-4d83-a0af-1ac85460dc07","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":[]},"tags":{"Tag1":"Value1"}}' + headers: + cache-control: + - no-cache + content-length: + - '442' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes?api-version=2022-12-27 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test","name":"scope-test","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","tags":{"Tag1":"Value1"},"properties":{"privateLinkScopeId":"a10ff14f-baa9-4d83-a0af-1ac85460dc07","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":[]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '454' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"tags": {"Tag1": "Value1", "Tag2": "Value2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope update-tag + Connection: + - keep-alive + Content-Length: + - '46' + Content-Type: + - application/json + ParameterSetName: + - --tags --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 azsdk-python-mgmt-hybridcompute/1.0.0b1 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test","name":"scope-test","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","properties":{"privateLinkScopeId":"a10ff14f-baa9-4d83-a0af-1ac85460dc07","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":[]},"tags":{"Tag1":"Value1","Tag2":"Value2"}}' + headers: + cache-control: + - no-cache + content-length: + - '458' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-scope show + Connection: + - keep-alive + ParameterSetName: + - --scope-name -g + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test","name":"scope-test","type":"Microsoft.HybridCompute/privateLinkScopes","location":"eastus2euap","properties":{"privateLinkScopeId":"a10ff14f-baa9-4d83-a0af-1ac85460dc07","publicNetworkAccess":"Enabled","provisioningState":"Succeeded","privateEndpointConnections":[]},"tags":{"Tag1":"Value1","Tag2":"Value2"}}' + headers: + cache-control: + - no-cache + content-length: + - '458' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-resource show + Connection: + - keep-alive + ParameterSetName: + - --scope-name -g --group-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateLinkResources/hybridcompute?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateLinkResources/hybridcompute","name":"hybridcompute","type":"Microsoft.HybridCompute/privateLinkScopes/privateLinkResources","properties":{"groupId":"hybridcompute","requiredMembers":["HybridCompute.Global","HybridCompute.Server","GuestConfig.GlobalService","GuestConfig.AgentService.eapeus2","GuestConfig.AgentService.eastus2euap","HybridCompute.K8sConfiguration"],"requiredZoneNames":["privatelink.his.arc.azure.com","privatelink.Guestconfiguration.azure.com","privatelink.dp.kubernetesconfiguration.azure.com"]}}' + headers: + cache-control: + - no-cache + content-length: + - '670' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-link-resource list + Connection: + - keep-alive + ParameterSetName: + - --scope-name -g + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateLinkResources?api-version=2022-12-27 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateLinkResources/hybridcompute","name":"hybridcompute","type":"Microsoft.HybridCompute/privateLinkScopes/privateLinkResources","properties":{"groupId":"hybridcompute","requiredMembers":["HybridCompute.Global","HybridCompute.Server","GuestConfig.GlobalService","GuestConfig.AgentService.eapeus2","GuestConfig.AgentService.eastus2euap","HybridCompute.K8sConfiguration"],"requiredZoneNames":["privatelink.his.arc.azure.com","privatelink.Guestconfiguration.azure.com","privatelink.dp.kubernetesconfiguration.azure.com"]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '682' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/az-sdk-test?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test","name":"az-sdk-test","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '224' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "properties": {"privateLinkServiceConnections": + [{"name": "pec-test", "properties": {"groupIds": ["hybridcompute"], "privateLinkServiceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test"}}], + "subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + Content-Length: + - '490' + Content-Type: + - application/json + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"pe-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test\",\r\n + \ \"etag\": \"W/\\\"c9a4317f-b738-4a2b-8e16-7eb9e238e845\\\"\",\r\n \"type\": + \"Microsoft.Network/privateEndpoints\",\r\n \"location\": \"eastus2euap\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": + \"b4751955-eba2-4505-8856-934983f909e6\",\r\n \"privateLinkServiceConnections\": + [\r\n {\r\n \"name\": \"pec-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test/privateLinkServiceConnections/pec-test\",\r\n + \ \"etag\": \"W/\\\"c9a4317f-b738-4a2b-8e16-7eb9e238e845\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateLinkServiceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test\",\r\n + \ \"groupIds\": [\r\n \"hybridcompute\"\r\n ],\r\n + \ \"privateLinkServiceConnectionState\": {\r\n \"status\": + \"Approved\",\r\n \"description\": \"Auto Approved\",\r\n \"actionsRequired\": + \"None\"\r\n }\r\n },\r\n \"type\": \"Microsoft.Network/privateEndpoints/privateLinkServiceConnections\"\r\n + \ }\r\n ],\r\n \"manualPrivateLinkServiceConnections\": [],\r\n + \ \"customNetworkInterfaceName\": \"\",\r\n \"subnet\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test\"\r\n + \ },\r\n \"ipConfigurations\": [],\r\n \"networkInterfaces\": [\r\n + \ {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/networkInterfaces/pe-test.nic.f3912f7c-6228-41f2-8b4e-01fbe72801f3\"\r\n + \ }\r\n ],\r\n \"customDnsConfigs\": []\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/101d3edf-5747-41bb-866a-7d3845d2cd84?api-version=2022-01-01 + cache-control: + - no-cache + content-length: + - '1954' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:33 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 3405f2a4-e0f0-41af-864a-03a466678cd3 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/101d3edf-5747-41bb-866a-7d3845d2cd84?api-version=2022-01-01 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:33 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 1db5c803-69b7-4d74-8498-76e686ef0839 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/101d3edf-5747-41bb-866a-7d3845d2cd84?api-version=2022-01-01 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:58:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - b43547b3-50a2-4f98-b5d1-561df1e08cd0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/operations/101d3edf-5747-41bb-866a-7d3845d2cd84?api-version=2022-01-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:59:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 0cb873bd-33e4-4f73-bb25-eb4a4aeac6b4 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet --private-connection-resource-id --connection-name + --group-id + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"pe-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test\",\r\n + \ \"etag\": \"W/\\\"91659025-71c8-47cd-b9de-862c7da95420\\\"\",\r\n \"type\": + \"Microsoft.Network/privateEndpoints\",\r\n \"location\": \"eastus2euap\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": + \"b4751955-eba2-4505-8856-934983f909e6\",\r\n \"privateLinkServiceConnections\": + [\r\n {\r\n \"name\": \"pec-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test/privateLinkServiceConnections/pec-test\",\r\n + \ \"etag\": \"W/\\\"91659025-71c8-47cd-b9de-862c7da95420\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateLinkServiceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test\",\r\n + \ \"groupIds\": [\r\n \"hybridcompute\"\r\n ],\r\n + \ \"privateLinkServiceConnectionState\": {\r\n \"status\": + \"Approved\",\r\n \"description\": \"Auto-approved\",\r\n \"actionsRequired\": + \"None\"\r\n }\r\n },\r\n \"type\": \"Microsoft.Network/privateEndpoints/privateLinkServiceConnections\"\r\n + \ }\r\n ],\r\n \"manualPrivateLinkServiceConnections\": [],\r\n + \ \"customNetworkInterfaceName\": \"\",\r\n \"subnet\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/subnet-test\"\r\n + \ },\r\n \"ipConfigurations\": [],\r\n \"networkInterfaces\": [\r\n + \ {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/networkInterfaces/pe-test.nic.f3912f7c-6228-41f2-8b4e-01fbe72801f3\"\r\n + \ }\r\n ],\r\n \"customDnsConfigs\": [\r\n {\r\n \"fqdn\": + \"gbl.his.arc.azure.com\",\r\n \"ipAddresses\": [\r\n \"10.0.0.4\"\r\n + \ ]\r\n },\r\n {\r\n \"fqdn\": \"cbn.his.arc.azure.com\",\r\n + \ \"ipAddresses\": [\r\n \"10.0.0.5\"\r\n ]\r\n },\r\n + \ {\r\n \"fqdn\": \"agentserviceapi.guestconfiguration.azure.com\",\r\n + \ \"ipAddresses\": [\r\n \"10.0.0.6\"\r\n ]\r\n },\r\n + \ {\r\n \"fqdn\": \"eapeus2-gas.guestconfiguration.azure.com\",\r\n + \ \"ipAddresses\": [\r\n \"10.0.0.7\"\r\n ]\r\n },\r\n + \ {\r\n \"fqdn\": \"eastus2euap-gas.guestconfiguration.azure.com\",\r\n + \ \"ipAddresses\": [\r\n \"10.0.0.8\"\r\n ]\r\n },\r\n + \ {\r\n \"fqdn\": \"eastus2euap.dp.kubernetesconfiguration.azure.com\",\r\n + \ \"ipAddresses\": [\r\n \"10.0.0.9\"\r\n ]\r\n }\r\n + \ ]\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2772' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:59:03 GMT + etag: + - W/"91659025-71c8-47cd-b9de-862c7da95420" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 57ae1f84-80b1-4cd1-b13e-0892b18663ed + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection list + Connection: + - keep-alive + ParameterSetName: + - --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections?api-version=2022-12-27 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections/pe-test.b4751955-eba2-4505-8856-934983f909e6","name":"pe-test.b4751955-eba2-4505-8856-934983f909e6","type":"Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test"},"privateLinkServiceConnectionState":{"status":"Approved","description":"Auto-approved","actionsRequired":"None"}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '685' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:59:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection update + Connection: + - keep-alive + ParameterSetName: + - --connection-state --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections/pe-test.b4751955-eba2-4505-8856-934983f909e6?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections/pe-test.b4751955-eba2-4505-8856-934983f909e6","name":"pe-test.b4751955-eba2-4505-8856-934983f909e6","type":"Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test"},"privateLinkServiceConnectionState":{"status":"Approved","description":"Auto-approved","actionsRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '673' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:59:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"privateEndpoint": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test"}, + "privateLinkServiceConnectionState": {"description": "Rejected by AZ CLI", "status": + "Rejected"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection update + Connection: + - keep-alive + Content-Length: + - '276' + Content-Type: + - application/json + ParameterSetName: + - --connection-state --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections/pe-test.b4751955-eba2-4505-8856-934983f909e6?api-version=2022-12-27 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/a00ee93e-8e07-401a-956f-449ff8a9aec0?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Tue, 25 Jul 2023 18:59:07 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/a00ee93e-8e07-401a-956f-449ff8a9aec0?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection update + Connection: + - keep-alive + ParameterSetName: + - --connection-state --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/a00ee93e-8e07-401a-956f-449ff8a9aec0?api-version=2022-12-27 + response: + body: + string: '{"name":"a00ee93e-8e07-401a-956f-449ff8a9aec0","status":"Succeeded","startTime":"2023-07-25T18:59:07.3177632Z"}' + headers: + cache-control: + - no-cache + content-length: + - '111' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:59:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection update + Connection: + - keep-alive + ParameterSetName: + - --connection-state --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections/pe-test.b4751955-eba2-4505-8856-934983f909e6?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections/pe-test.b4751955-eba2-4505-8856-934983f909e6","name":"pe-test.b4751955-eba2-4505-8856-934983f909e6","type":"Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test"},"privateLinkServiceConnectionState":{"status":"Rejected","description":"Rejected + by AZ CLI","actionsRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '678' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:59:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections/pe-test.b4751955-eba2-4505-8856-934983f909e6?api-version=2022-12-27 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections/pe-test.b4751955-eba2-4505-8856-934983f909e6","name":"pe-test.b4751955-eba2-4505-8856-934983f909e6","type":"Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.Network/privateEndpoints/pe-test"},"privateLinkServiceConnectionState":{"status":"Rejected","description":"Rejected + by AZ CLI","actionsRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '678' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:59:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections/pe-test.b4751955-eba2-4505-8856-934983f909e6?api-version=2022-12-27 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/8047bfa2-2db8-4b97-a604-431e2dd79e13?api-version=2022-12-27 + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Tue, 25 Jul 2023 18:59:09 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationresults/8047bfa2-2db8-4b97-a604-431e2dd79e13?api-version=2022-12-27 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection delete + Connection: + - keep-alive + ParameterSetName: + - -y --name --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridCompute/locations/eastus2euap/operationstatus/8047bfa2-2db8-4b97-a604-431e2dd79e13?api-version=2022-12-27 + response: + body: + string: '{"name":"8047bfa2-2db8-4b97-a604-431e2dd79e13","status":"Succeeded","startTime":"2023-07-25T18:59:10.6675819Z"}' + headers: + cache-control: + - no-cache + content-length: + - '111' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:59:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedmachine private-endpoint-connection list + Connection: + - keep-alive + ParameterSetName: + - --resource-group --scope-name + User-Agent: + - AZURECLI/2.49.0 (AAZ) azsdk-python-core/1.26.0 Python/3.8.10 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-sdk-test/providers/Microsoft.HybridCompute/privateLinkScopes/scope-test/privateEndpointConnections?api-version=2022-12-27 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 25 Jul 2023 18:59:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario.py b/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario.py index 8e811d2d0a9..a9522f0eb3d 100644 --- a/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario.py +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario.py @@ -21,7 +21,6 @@ from .example_steps import step_extension_delete from .example_steps import step_delete from .. import ( - try_manual, raise_if, calc_coverage ) @@ -29,116 +28,120 @@ TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) - -# Env setup_scenario -@try_manual -def setup_scenario(test): - pass - - -# Env cleanup_scenario -@try_manual -def cleanup_scenario(test): - pass - - -@try_manual -def test_machine_and_extension(test): - test.kwargs.update({ - 'machine': 'testMachine', - 'rg': 'az-sdk-test', - 'location': 'eastus2euap', - 'customScriptName': test.create_random_name('custom-', 20), - }) - - test.cmd('az connectedmachine show -n {machine} -g {rg}', checks=[ - test.check('name', '{machine}'), - test.check('resourceGroup', '{rg}') - ]) - - test.cmd('az connectedmachine list -g {rg}', checks=[ - test.check('length(@)', 2) - ]) - - test.cmd('az connectedmachine extension create ' - '--name "{customScriptName}" ' - '--location "{location}" ' - '--enable-auto-upgrade true ' - '--type "CustomScriptExtension" ' - '--publisher "Microsoft.Compute" ' - '--type-handler-version "1.10.10" ' - '--machine-name "{machine}" ' - '--resource-group "{rg}" ' - '--settings "{{\\"commandToExecute\\":\\"hostname\\"}}"', - checks=[ - test.check('name', '{customScriptName}'), - test.check('properties.enableAutomaticUpgrade', True), - test.check('properties.typeHandlerVersion', '1.10.10'), - test.check('properties.settings.commandToExecute', 'hostname') - ]) - - test.cmd('az connectedmachine extension list ' - '--machine-name {machine} -g {rg}', - checks=[ - test.check('length(@)', 1) - ]) - - test.cmd('az connectedmachine extension show ' - '--name {customScriptName} ' - '--machine-name "{machine}" ' - '--resource-group "{rg}"', - checks=[ - test.check('name', '{customScriptName}'), - test.check('properties.typeHandlerVersion', '1.10.10') - ]) - - test.cmd('az connectedmachine upgrade-extension ' - '--extension-targets "{{\\"Microsoft.Compute.CustomScriptExtension\\":{{\\"targetVersion\\":\\"1.10.12\\"}}}}" ' - '--machine-name "{machine}" ' - '--resource-group "{rg}"', - checks=[]) - - test.cmd('az connectedmachine extension update ' - '--name "{customScriptName}" ' - '--enable-auto-upgrade false ' - '--settings "{{\\"commandToExecute\\":\\"dir\\"}}" ' - '--machine-name "{machine}" ' - '--resource-group "{rg}"', - checks=[ - test.check('name', '{customScriptName}'), - test.check('properties.enableAutomaticUpgrade', False), - test.check('properties.provisioningState', 'Succeeded'), - test.check('properties.settings.commandToExecute', 'dir'), - test.check('properties.typeHandlerVersion', '1.10.12') - ]) - - test.cmd('az connectedmachine extension delete -y ' - '--name "{customScriptName}" ' - '--machine-name "{machine}" ' - '--resource-group "{rg}"', - checks=[]) - - test.cmd('az connectedmachine delete -y ' - '--name "{machine}" ' - '--resource-group "{rg}"', - checks=[]) - -# Testcase: Scenario -@try_manual -def call_scenario(test): - setup_scenario(test) - test_machine_and_extension(test) - cleanup_scenario(test) - - -# Test class for Scenario -@try_manual class ConnectedMachineAndExtensionScenarioTest(ScenarioTest): - def __init__(self, *args, **kwargs): - super(ConnectedMachineAndExtensionScenarioTest, self).__init__(*args, **kwargs) - - def test_ConnectedMachineAndExtension_Scenario(self): - call_scenario(self) - calc_coverage(__file__) - raise_if() + @ResourceGroupPreparer(name_prefix='cli_test_machineextension') + def test_machine_and_extension(self): + self.kwargs.update({ + 'machine': 'testmachine', + 'rg': 'az-sdk-test', + 'location': 'eastus2euap', + 'customScriptName': 'custom-test', + }) + + self.cmd('az connectedmachine show -n {machine} -g {rg}', checks=[ + self.check('name', '{machine}'), + self.check('resourceGroup', '{rg}') + ]) + + self.cmd('az connectedmachine list -g {rg}', checks=[ + self.check('length(@)', 1) + ]) + + self.cmd('az connectedmachine extension create ' + '--name "{customScriptName}" ' + '--location "{location}" ' + '--enable-auto-upgrade true ' + '--type "CustomScriptExtension" ' + '--publisher "Microsoft.Compute" ' + '--type-handler-version "1.10.10" ' + '--machine-name "{machine}" ' + '--resource-group "{rg}" ' + '--settings "{{\\"commandToExecute\\":\\"hostname\\"}}"', + checks=[ + self.check('name', '{customScriptName}'), + self.check('properties.enableAutomaticUpgrade', True), + self.check('properties.typeHandlerVersion', '1.10.10'), + self.check('properties.settings.commandToExecute', 'hostname') + ]) + + self.cmd('az connectedmachine install-patches ' + '--resource-group "{rg}" ' + '--name "{machine}" ' + '--maximum-duration "PT4H" ' + '--reboot-setting "IfRequired" ' + '--windows-parameters "{{\\"classificationsToInclude\\":[\\"Critical\\", \\"Security\\"]}}"', + checks=[ + self.check('status', 'Succeeded') + ]) + + self.cmd('az connectedmachine assess-patches ' + '--resource-group "{rg}" ' + '--name "{machine}"', + checks=[ + self.check('status', 'Succeeded') + ]) + + self.cmd('az connectedmachine extension list ' + '--machine-name {machine} -g {rg}', + checks=[ + # self.check('length(@)', 1) + ]) + + self.cmd('az connectedmachine extension show ' + '--name {customScriptName} ' + '--machine-name "{machine}" ' + '--resource-group "{rg}"', + checks=[ + self.check('name', '{customScriptName}'), + self.check('properties.typeHandlerVersion', '1.10.10') + ]) + + self.cmd('az connectedmachine extension image show ' + '--publisher "Microsoft.Compute" ' + '--extension-type "CustomScriptExtension" ' + '--location "{location}" ' + '--version "1.10.10"', + checks=[ + self.check('version', '1.10.10'), + self.check('publisher', 'microsoft.compute'), + self.check('extensionType', 'customscriptextension') + ]) + + self.cmd('az connectedmachine extension image list ' + '--publisher "Microsoft.Compute" ' + '--extension-type "CustomScriptExtension" ' + '--location "{location}"', + checks=[ + ]) + + self.cmd('az connectedmachine upgrade-extension ' + '--extension-targets "{{\\"Microsoft.Compute.CustomScriptExtension\\":{{\\"targetVersion\\":\\"1.10.12\\"}}}}" ' + '--machine-name "{machine}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az connectedmachine extension update ' + '--name "{customScriptName}" ' + '--enable-auto-upgrade false ' + '--settings "{{\\"commandToExecute\\":\\"dir\\"}}" ' + '--machine-name "{machine}" ' + '--resource-group "{rg}"', + checks=[ + self.check('name', '{customScriptName}'), + self.check('properties.enableAutomaticUpgrade', False), + self.check('properties.provisioningState', 'Succeeded'), + self.check('properties.settings.commandToExecute', 'dir'), + self.check('properties.typeHandlerVersion', '1.10.12') + ]) + + self.cmd('az connectedmachine extension delete -y ' + '--name "{customScriptName}" ' + '--machine-name "{machine}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az connectedmachine delete -y ' + '--name "{machine}" ' + '--resource-group "{rg}"', + checks=[]) diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario.py b/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario.py index d46a0a1bdc8..11624035611 100644 --- a/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario.py +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario.py @@ -33,148 +33,120 @@ TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) -# Env setup_scenario -@try_manual -def setup_scenario(test): - pass - - -# Env cleanup_scenario -@try_manual -def cleanup_scenario(test): - pass - - -def test_private_link(test): - rand_string = test.create_random_name('', 5) - test.kwargs.update({ - 'machine': 'testMachine', - 'rg': 'az-sdk-test-' + rand_string, - 'scope': 'scope-' + rand_string, - 'vnet': 'vnet-' + rand_string, - 'subnet': 'subnet-' + rand_string, - 'private_endpoint': 'pe-' + rand_string, - 'private_endpoint_connection': 'pec-' + rand_string, - 'location': 'eastus2euap', - 'customScriptName': 'custom-' + rand_string, - }) - - # Prepare network - test.cmd('az group create -n {rg} -l {location}', - checks=test.check('name', '{rg}')) - - # Prepare network - test.cmd('az network vnet create -n {vnet} -g {rg} -l {location} --subnet-name {subnet}', - checks=test.check('length(newVNet.subnets)', 1)) - test.cmd('az network vnet subnet update -n {subnet} --vnet-name {vnet} -g {rg} ' - '--disable-private-endpoint-network-policies true', - checks=test.check('privateEndpointNetworkPolicies', 'Disabled')) - - # Create a private link scope - test.cmd('az connectedmachine private-link-scope create ' - '--location "{location}" ' - '--resource-group "{rg}" ' - '--scope-name "{scope}"', - checks=[ - test.check('name','{scope}'), - test.check('properties.publicNetworkAccess','Disabled') - ]) - - # Update the private link scope - test.cmd('az connectedmachine private-link-scope update ' - '--location "{location}" ' - '--tags Tag1="Value1" ' - '--public-network-access Enabled ' - '--resource-group "{rg}" ' - '--scope-name "{scope}"', - checks=[ - test.check('name','{scope}'), - test.check('properties.publicNetworkAccess','Enabled') - ]) - - # Test private link scope list - test.cmd('az connectedmachine private-link-scope list ' - '--resource-group "{rg}"', - checks=[ - test.check('length(@)', 1) - ]) - - # Private link scope update tag - test.cmd('az connectedmachine private-link-scope update-tag ' - '--tags Tag1="Value1" Tag2="Value2" ' - '--resource-group "{rg}" ' - '--scope-name "{scope}"', - checks=[ - test.check('length(tags)', 2) - ]) - - # Private link scope show - private_link_scope = test.cmd('az connectedmachine private-link-scope show --scope-name {scope} -g {rg}').get_output_in_json() - test.kwargs['scope_id'] = private_link_scope['id'] - - # Test private link resource list - test.cmd('az connectedmachine private-link-resource list --scope-name {scope} -g {rg}', checks=[ - test.check('length(@)', 1) - ]) - - result = test.cmd('az network private-endpoint create -g {rg} -n {private_endpoint} --vnet-name {vnet} --subnet {subnet} --private-connection-resource-id {scope_id} ' - '--connection-name {private_endpoint_connection} --group-id hybridcompute').get_output_in_json() - test.assertTrue(test.kwargs['private_endpoint'].lower() in result['name'].lower()) - - connection_list = test.cmd('az connectedmachine private-endpoint-connection list ' - '--resource-group "{rg}" ' - '--scope-name "{scope}"').get_output_in_json() - test.kwargs['private_endpoint_connection_name'] = connection_list[0]['name'] - - test.cmd('az connectedmachine private-endpoint-connection update ' - '--connection-state description="Rejected by AZ CLI test" status="Rejected" ' - '--name "{private_endpoint_connection_name}" ' - '--resource-group "{rg}" ' - '--scope-name "{scope}"', - checks=[ - test.check('name', '{private_endpoint_connection_name}'), - test.check('properties.privateLinkServiceConnectionState.description', 'Rejected by AZ CLI test'), - test.check('properties.privateLinkServiceConnectionState.status', 'Rejected') - ]) - - test.cmd('az connectedmachine private-endpoint-connection show ' - '--name "{private_endpoint_connection_name}" ' - '--resource-group "{rg}" ' - '--scope-name "{scope}"', - checks=[ - test.check('name', '{private_endpoint_connection_name}'), - test.check('properties.privateLinkServiceConnectionState.description', 'Rejected by AZ CLI test'), - test.check('properties.privateLinkServiceConnectionState.status', 'Rejected') - ]) - - test.cmd('az connectedmachine private-endpoint-connection delete -y ' - '--name "{private_endpoint_connection_name}" ' - '--resource-group "{rg}" ' - '--scope-name "{scope}"', - checks=[]) - - test.cmd('az connectedmachine private-endpoint-connection list ' - '--resource-group "{rg}" ' - '--scope-name "{scope}"', - checks=[ - test.check('length(@)', 0) - ]) - - -# Testcase: Scenario -@try_manual -def call_scenario(test): - setup_scenario(test) - test_private_link(test) - cleanup_scenario(test) - - -# Test class for Scenario -@try_manual class PrivateLinkAndPrivateEndpointConnectionScenarioTest(ScenarioTest): - def __init__(self, *args, **kwargs): - super(PrivateLinkAndPrivateEndpointConnectionScenarioTest, self).__init__(*args, **kwargs) - def test_PrivateLinkAndPrivateEndpointConnection_Scenario(self): - call_scenario(self) - calc_coverage(__file__) - raise_if() + + @ResourceGroupPreparer(name_prefix='cli_test_privatelink') + def test_private_link(self): + rand_string = 'test' + self.kwargs.update({ + 'machine': 'testMachine', + 'rg': 'az-sdk-test', + 'scope': 'scope-' + rand_string, + 'vnet': 'vnet-' + rand_string, + 'subnet': 'subnet-' + rand_string, + 'private_endpoint': 'pe-' + rand_string, + 'private_endpoint_connection': 'pec-' + rand_string, + 'location': 'eastus2euap', + 'customScriptName': 'custom-' + rand_string, + }) + + # Prepare network + self.cmd('az group create -n {rg} -l {location}', + checks=self.check('name', '{rg}')) + + # Prepare network + self.cmd('az network vnet create -n {vnet} -g {rg} -l {location} --subnet-name {subnet}', + checks=self.check('length(newVNet.subnets)', 1)) + self.cmd('az network vnet subnet update -n {subnet} --vnet-name {vnet} -g {rg} ' + '--disable-private-endpoint-network-policies true', + checks=self.check('privateEndpointNetworkPolicies', 'Disabled')) + + # Create a private link scope + self.cmd('az connectedmachine private-link-scope create ' + '--location "{location}" ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + self.check('name','{scope}'), + self.check('properties.publicNetworkAccess','Disabled') + ]) + + # Update the private link scope + self.cmd('az connectedmachine private-link-scope update ' + '--tags Tag1="Value1" ' + '--public-network-access Enabled ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + self.check('name','{scope}'), + self.check('properties.publicNetworkAccess','Enabled') + ]) + + # Test private link scope list + self.cmd('az connectedmachine private-link-scope list ' + '--resource-group "{rg}"', + checks=[]) + + # Private link scope update tag + self.cmd('az connectedmachine private-link-scope update-tag ' + '--tags Tag1="Value1" Tag2="Value2" ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + self.check('length(tags)', 2) + ]) + + # Private link scope show + private_link_scope = self.cmd('az connectedmachine private-link-scope show --scope-name {scope} -g {rg}').get_output_in_json() + self.kwargs['scope_id'] = private_link_scope['id'] + + # Test private link resource show + self.cmd('az connectedmachine private-link-resource show --scope-name {scope} -g {rg} --group-name hybridcompute', checks=[ + # self.check('length(@)', 6) + ]) + + # Test private link resource list + self.cmd('az connectedmachine private-link-resource list --scope-name {scope} -g {rg}', checks=[]) + + result = self.cmd('az network private-endpoint create -g {rg} -n {private_endpoint} --vnet-name {vnet} --subnet {subnet} --private-connection-resource-id {scope_id} ' + '--connection-name {private_endpoint_connection} --group-id hybridcompute').get_output_in_json() + self.assertTrue(self.kwargs['private_endpoint'].lower() in result['name'].lower()) + + connection_list = self.cmd('az connectedmachine private-endpoint-connection list ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"').get_output_in_json() + self.kwargs['private_endpoint_connection_name'] = connection_list[0]['name'] + + self.cmd('az connectedmachine private-endpoint-connection update ' + '--connection-state "{{\\"description\\":\\"Rejected by AZ CLI\\", \\"status\\":\\"Rejected\\"}}" ' + '--name "{private_endpoint_connection_name}" ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + self.check('name', '{private_endpoint_connection_name}'), + self.check('properties.privateLinkServiceConnectionState.description', 'Rejected by AZ CLI'), + self.check('properties.privateLinkServiceConnectionState.status', 'Rejected') + ]) + + self.cmd('az connectedmachine private-endpoint-connection show ' + '--name "{private_endpoint_connection_name}" ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + self.check('name', '{private_endpoint_connection_name}'), + self.check('properties.privateLinkServiceConnectionState.description', 'Rejected by AZ CLI'), + self.check('properties.privateLinkServiceConnectionState.status', 'Rejected') + ]) + + self.cmd('az connectedmachine private-endpoint-connection delete -y ' + '--name "{private_endpoint_connection_name}" ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[]) + + self.cmd('az connectedmachine private-endpoint-connection list ' + '--resource-group "{rg}" ' + '--scope-name "{scope}"', + checks=[ + self.check('length(@)', 0) + ]) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py index 7016f1261ab..dfcc4211733 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py @@ -59,7 +59,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" def prepare_request(next_link=None): @@ -129,7 +129,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" def prepare_request(next_link=None): @@ -192,7 +192,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" # Construct URL @@ -312,7 +312,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" # Construct URL @@ -376,7 +376,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -429,8 +429,7 @@ async def update_tags( private_link_scope_tags: "models.TagsResource", **kwargs ) -> "models.HybridComputePrivateLinkScope": - """Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate - method. + """Updates an existing PrivateLinkScope's tags. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -449,7 +448,7 @@ async def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -513,7 +512,7 @@ async def get_validation_details( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" # Construct URL @@ -573,7 +572,7 @@ async def get_validation_details_for_machine( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" # Construct URL diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py index 416b5f99784..a5f464c401c 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" def prepare_request(next_link=None): @@ -135,7 +135,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" def prepare_request(next_link=None): @@ -199,7 +199,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" # Construct URL @@ -321,7 +321,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" # Construct URL @@ -386,7 +386,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -440,8 +440,7 @@ def update_tags( **kwargs # type: Any ): # type: (...) -> "models.HybridComputePrivateLinkScope" - """Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate - method. + """Updates an existing PrivateLinkScope's tags. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -460,7 +459,7 @@ def update_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -525,7 +524,7 @@ def get_validation_details( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" # Construct URL @@ -586,7 +585,7 @@ def get_validation_details_for_machine( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2022-03-10" + api_version = "2022-12-27" accept = "application/json" # Construct URL diff --git a/src/connectedmachine/report.md b/src/connectedmachine/report.md index 53b59e29969..8afb199a12e 100644 --- a/src/connectedmachine/report.md +++ b/src/connectedmachine/report.md @@ -62,8 +62,6 @@ |[az connectedmachine private-link-scope create](#PrivateLinkScopesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersPrivateLinkScopesCreateOrUpdate#Create)|[Example](#ExamplesPrivateLinkScopesCreateOrUpdate#Create)| |[az connectedmachine private-link-scope update](#PrivateLinkScopesCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersPrivateLinkScopesCreateOrUpdate#Update)|[Example](#ExamplesPrivateLinkScopesCreateOrUpdate#Update)| |[az connectedmachine private-link-scope delete](#PrivateLinkScopesDelete)|Delete|[Parameters](#ParametersPrivateLinkScopesDelete)|[Example](#ExamplesPrivateLinkScopesDelete)| -|[az connectedmachine private-link-scope show-validation-detail](#PrivateLinkScopesGetValidationDetails)|GetValidationDetails|[Parameters](#ParametersPrivateLinkScopesGetValidationDetails)|[Example](#ExamplesPrivateLinkScopesGetValidationDetails)| -|[az connectedmachine private-link-scope show-validation-detail-for-machine](#PrivateLinkScopesGetValidationDetailsForMachine)|GetValidationDetailsForMachine|[Parameters](#ParametersPrivateLinkScopesGetValidationDetailsForMachine)|[Example](#ExamplesPrivateLinkScopesGetValidationDetailsForMachine)| |[az connectedmachine private-link-scope update-tag](#PrivateLinkScopesUpdateTags)|UpdateTags|[Parameters](#ParametersPrivateLinkScopesUpdateTags)|[Example](#ExamplesPrivateLinkScopesUpdateTags)| @@ -390,32 +388,6 @@ az connectedmachine private-link-scope delete --resource-group "my-resource-grou |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| -#### Command `az connectedmachine private-link-scope show-validation-detail` - -##### Example -``` -az connectedmachine private-link-scope show-validation-detail --location "wus2" --private-link-scope-id \ -"f5dc51d3-92ed-4d7e-947a-775ea79b4919" -``` -##### Parameters -|Option|Type|Description|Path (SDK)|Swagger name| -|------|----|-----------|----------|------------| -|**--location**|string|The location of the target resource.|location|location| -|**--private-link-scope-id**|string|The id (Guid) of the Azure Arc PrivateLinkScope resource.|private_link_scope_id|privateLinkScopeId| - -#### Command `az connectedmachine private-link-scope show-validation-detail-for-machine` - -##### Example -``` -az connectedmachine private-link-scope show-validation-detail-for-machine --machine-name "machineName" \ ---resource-group "my-resource-group" -``` -##### Parameters -|Option|Type|Description|Path (SDK)|Swagger name| -|------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| -|**--machine-name**|string|The name of the target machine to get the private link scope validation details for.|machine_name|machineName| - #### Command `az connectedmachine private-link-scope update-tag` ##### Example diff --git a/src/connectedmachine/setup.py b/src/connectedmachine/setup.py index 15f0503fbc9..a3083ec0d57 100644 --- a/src/connectedmachine/setup.py +++ b/src/connectedmachine/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # HISTORY.rst entry. -VERSION = '0.5.1' +VERSION = '0.6.0' try: from azext_connectedmachine.manual.version import VERSION except ImportError: @@ -19,7 +19,7 @@ # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Programming Language :: Python',