diff --git a/src/connectedmachine/HISTORY.rst b/src/connectedmachine/HISTORY.rst index 8f4aaca642b..1c139576ba0 100644 --- a/src/connectedmachine/HISTORY.rst +++ b/src/connectedmachine/HISTORY.rst @@ -3,10 +3,6 @@ Release History =============== -0.1.1 -+++++ -* Remove the limitation of max compatible cli core version - 0.1.0 ++++++ -* Initial release. \ No newline at end of file +* Initial release. diff --git a/src/connectedmachine/README.rst b/src/connectedmachine/README.md similarity index 84% rename from src/connectedmachine/README.rst rename to src/connectedmachine/README.md index 34c3267a1f5..e5dcacc3081 100644 --- a/src/connectedmachine/README.rst +++ b/src/connectedmachine/README.md @@ -2,4 +2,4 @@ Microsoft Azure CLI 'connectedmachine' Extension ========================================== This package is for the 'connectedmachine' extension. -i.e. 'az connectedmachine' \ No newline at end of file +i.e. 'az connectedmachine' diff --git a/src/connectedmachine/azext_connectedmachine/__init__.py b/src/connectedmachine/azext_connectedmachine/__init__.py index 2844f4e0207..0e9b9399cd1 100644 --- a/src/connectedmachine/azext_connectedmachine/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/__init__.py @@ -1,32 +1,50 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- from azure.cli.core import AzCommandsLoader +from azext_connectedmachine.generated._help import helps # pylint: disable=unused-import +try: + from azext_connectedmachine.manual._help import helps # pylint: disable=reimported +except ImportError: + pass -from azext_connectedmachine._help import helps # pylint: disable=unused-import - -class ConnectedmachineCommandsLoader(AzCommandsLoader): +class ConnectedMachineCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType - from azext_connectedmachine._client_factory import cf_connectedmachine + from azext_connectedmachine.generated._client_factory import cf_connectedmachine_cl connectedmachine_custom = CliCommandType( operations_tmpl='azext_connectedmachine.custom#{}', - client_factory=cf_connectedmachine) - super(ConnectedmachineCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=connectedmachine_custom) + client_factory=cf_connectedmachine_cl) + parent = super(ConnectedMachineCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=connectedmachine_custom) def load_command_table(self, args): - from azext_connectedmachine.commands import load_command_table + from azext_connectedmachine.generated.commands import load_command_table load_command_table(self, args) + try: + from azext_connectedmachine.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass return self.command_table def load_arguments(self, command): - from azext_connectedmachine._params import load_arguments + from azext_connectedmachine.generated._params import load_arguments load_arguments(self, command) + try: + from azext_connectedmachine.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass -COMMAND_LOADER_CLS = ConnectedmachineCommandsLoader +COMMAND_LOADER_CLS = ConnectedMachineCommandsLoader diff --git a/src/connectedmachine/azext_connectedmachine/_client_factory.py b/src/connectedmachine/azext_connectedmachine/_client_factory.py deleted file mode 100644 index b788393389f..00000000000 --- a/src/connectedmachine/azext_connectedmachine/_client_factory.py +++ /dev/null @@ -1,11 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -def cf_connectedmachine(cli_ctx, *_): - - from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azext_connectedmachine.vendored_sdks import HybridComputeManagementClient - return get_mgmt_service_client(cli_ctx, HybridComputeManagementClient) diff --git a/src/connectedmachine/azext_connectedmachine/_help.py b/src/connectedmachine/azext_connectedmachine/_help.py deleted file mode 100644 index feb986be4a3..00000000000 --- a/src/connectedmachine/azext_connectedmachine/_help.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -from knack.help_files import helps # pylint: disable=unused-import - - -helps['connectedmachine'] = """ - type: group - short-summary: Commands to manage Connected machines. -""" - -helps['connectedmachine list'] = """ - type: command - short-summary: List Connected machines. -""" - -helps['connectedmachine delete'] = """ - type: command - short-summary: Delete a Connected machine. -""" - -helps['connectedmachine show'] = """ - type: command - short-summary: Show details of a Connected machine. -""" diff --git a/src/connectedmachine/azext_connectedmachine/_params.py b/src/connectedmachine/azext_connectedmachine/_params.py deleted file mode 100644 index 54124e4aebd..00000000000 --- a/src/connectedmachine/azext_connectedmachine/_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long - -from knack.arguments import CLIArgumentType - - -def load_arguments(self, _): - - from azure.cli.core.commands.parameters import tags_type - from azure.cli.core.commands.validators import get_default_location_from_resource_group - - name_type = CLIArgumentType(options_list='--name', help='Name of the Connected machine.', id_part='name') - - with self.argument_context('connectedmachine') as c: - c.argument('tags', tags_type) - c.argument('location', validator=get_default_location_from_resource_group) - c.argument('name', name_type, options_list=['--name', '-n']) - - with self.argument_context('connectedmachine list') as c: - c.argument('name', name_type, id_part=None) diff --git a/src/connectedmachine/azext_connectedmachine/_validators.py b/src/connectedmachine/azext_connectedmachine/_validators.py deleted file mode 100644 index bdbc5023a4d..00000000000 --- a/src/connectedmachine/azext_connectedmachine/_validators.py +++ /dev/null @@ -1,21 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -def example_name_or_id_validator(cmd, namespace): - # Example of a storage account name or ID validator. - # See: - # https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters - from azure.cli.core.commands.client_factory import get_subscription_id - from msrestazure.tools import is_valid_resource_id, resource_id - if namespace.storage_account: - if not is_valid_resource_id(namespace.RESOURCE): - namespace.storage_account = resource_id( - subscription=get_subscription_id(cmd.cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Storage', - type='storageAccounts', - name=namespace.storage_account - ) diff --git a/src/connectedmachine/azext_connectedmachine/action.py b/src/connectedmachine/azext_connectedmachine/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/action.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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/connectedmachine/azext_connectedmachine/azext_metadata.json b/src/connectedmachine/azext_connectedmachine/azext_metadata.json index 55c81bf3328..4f48fa652a5 100644 --- a/src/connectedmachine/azext_connectedmachine/azext_metadata.json +++ b/src/connectedmachine/azext_connectedmachine/azext_metadata.json @@ -1,4 +1,4 @@ { - "azext.isPreview": true, - "azext.minCliCoreVersion": "2.0.67" + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.11.0" } \ No newline at end of file diff --git a/src/connectedmachine/azext_connectedmachine/commands.py b/src/connectedmachine/azext_connectedmachine/commands.py deleted file mode 100644 index 1b88b101410..00000000000 --- a/src/connectedmachine/azext_connectedmachine/commands.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -# pylint: disable=line-too-long -from azure.cli.core.commands import CliCommandType -from azext_connectedmachine._client_factory import cf_connectedmachine - - -def load_command_table(self, _): - - connectedmachine_sdk = CliCommandType( - operations_tmpl='azext_connectedmachine.vendored_sdks.operations#MachinesOperations.{}', - client_factory=cf_connectedmachine) - - with self.command_group('connectedmachine', connectedmachine_sdk, client_factory=cf_connectedmachine) as g: - g.custom_command('delete', 'delete_connectedmachine') - g.custom_command('list', 'list_connectedmachine') - g.custom_show_command('show', 'show_connectedmachine') - - with self.command_group('connectedmachine', is_preview=True): - pass diff --git a/src/connectedmachine/azext_connectedmachine/custom.py b/src/connectedmachine/azext_connectedmachine/custom.py index 3107989aac5..dbe9d5f9742 100644 --- a/src/connectedmachine/azext_connectedmachine/custom.py +++ b/src/connectedmachine/azext_connectedmachine/custom.py @@ -1,18 +1,17 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import - -def list_connectedmachine(client, resource_group_name=None): - if resource_group_name: - return client.machines.list_by_resource_group(resource_group_name) - return client.machines.list_by_subscription() - - -def show_connectedmachine(client, resource_group_name, name): - return client.machines.get(resource_group_name, name) - - -def delete_connectedmachine(client, resource_group_name, name): - return client.machines.delete(resource_group_name, name) +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/__init__.py b/src/connectedmachine/azext_connectedmachine/generated/__init__.py similarity index 65% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/__init__.py rename to src/connectedmachine/azext_connectedmachine/generated/__init__.py index f362d1375d6..c9cfdc73e77 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/generated/__init__.py @@ -9,12 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -from ._machines_operations import MachinesOperations -from ._machine_extensions_operations import MachineExtensionsOperations -from ._operations import Operations - -__all__ = [ - 'MachinesOperations', - 'MachineExtensionsOperations', - 'Operations', -] +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/connectedmachine/azext_connectedmachine/generated/_client_factory.py b/src/connectedmachine/azext_connectedmachine/generated/_client_factory.py new file mode 100644 index 00000000000..e9940cc3c93 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/generated/_client_factory.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +def cf_connectedmachine_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.connectedmachine import ConnectedMachine + return get_mgmt_service_client(cli_ctx, + ConnectedMachine) + + +def cf_machine(cli_ctx, *_): + return cf_connectedmachine_cl(cli_ctx).machine + + +def cf_machine_extension(cli_ctx, *_): + return cf_connectedmachine_cl(cli_ctx).machine_extension diff --git a/src/connectedmachine/azext_connectedmachine/generated/_help.py b/src/connectedmachine/azext_connectedmachine/generated/_help.py new file mode 100644 index 00000000000..70926115ac6 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/generated/_help.py @@ -0,0 +1,127 @@ +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['connectedmachine machine'] = """ + type: group + short-summary: connectedmachine machine +""" + +helps['connectedmachine machine list'] = """ + type: command + short-summary: "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 machine list --resource-group "myResourceGroup" +""" + +helps['connectedmachine machine show'] = """ + type: command + short-summary: "Retrieves information about the model view or the instance view of a hybrid machine." + examples: + - name: Get Machine + text: |- + az connectedmachine machine show --name "myMachine" --resource-group "myResourceGroup" +""" + +helps['connectedmachine machine delete'] = """ + type: command + short-summary: "The operation to remove a hybrid machine identity in Azure." + examples: + - name: Delete a Machine + text: |- + az connectedmachine machine delete --name "myMachine" --resource-group "myResourceGroup" +""" + +helps['connectedmachine machine-extension'] = """ + type: group + short-summary: connectedmachine machine-extension +""" + +helps['connectedmachine machine-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 machine-extension list --machine-name "myMachine" --resource-group \ +"myResourceGroup" +""" + +helps['connectedmachine machine-extension show'] = """ + type: command + short-summary: "The operation to get the extension." + examples: + - name: GET Machine Extension + text: |- + az connectedmachine machine-extension show --machine-name "myMachine" --name "CustomScriptExtension" \ +--resource-group "myResourceGroup" +""" + +helps['connectedmachine machine-extension create'] = """ + type: command + short-summary: "The operation to create or update the extension." + examples: + - name: Create or Update a Machine Extension + text: |- + az connectedmachine machine-extension create --machine-name "myMachine" --name "CustomScriptExtension" \ +--location "eastus2euap" --type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings \ +"{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object { $_.CPU -gt 10000 }\\\\\\"\\"}" \ +--type-handler-version "1.10" --resource-group "myResourceGroup" +""" + +helps['connectedmachine machine-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 machine-extension update --machine-name "myMachine" --name "CustomScriptExtension" \ +--type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings "{\\"commandToExecute\\":\\"powershell.exe \ +-c \\\\\\"Get-Process | Where-Object { $_.CPU -lt 100 }\\\\\\"\\"}" --type-handler-version "1.10" --resource-group \ +"myResourceGroup" +""" + +helps['connectedmachine machine-extension delete'] = """ + type: command + short-summary: "The operation to delete the extension." + examples: + - name: Delete a Machine Extension + text: |- + az connectedmachine machine-extension delete --machine-name "myMachine" --name "MMA" --resource-group \ +"myResourceGroup" +""" + +helps['connectedmachine machine-extension wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the connectedmachine machine-extension is \ +met. + examples: + - name: Pause executing next line of CLI script until the connectedmachine machine-extension is successfully \ +created. + text: |- + az connectedmachine machine-extension wait --machine-name "myMachine" --name "CustomScriptExtension" \ +--resource-group "myResourceGroup" --created + - name: Pause executing next line of CLI script until the connectedmachine machine-extension is successfully \ +updated. + text: |- + az connectedmachine machine-extension wait --machine-name "myMachine" --name "CustomScriptExtension" \ +--resource-group "myResourceGroup" --updated + - name: Pause executing next line of CLI script until the connectedmachine machine-extension is successfully \ +deleted. + text: |- + az connectedmachine machine-extension wait --machine-name "myMachine" --name "CustomScriptExtension" \ +--resource-group "myResourceGroup" --deleted +""" diff --git a/src/connectedmachine/azext_connectedmachine/generated/_params.py b/src/connectedmachine/azext_connectedmachine/generated/_params.py new file mode 100644 index 00000000000..6dd47d4fee1 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/generated/_params.py @@ -0,0 +1,105 @@ +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_three_state_flag, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + validate_file_or_dict +) + + +def load_arguments(self, _): + + with self.argument_context('connectedmachine machine list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('connectedmachine machine show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str, help='The name of the ' + 'hybrid machine.', id_part='name') + + with self.argument_context('connectedmachine machine delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('machine_name', options_list=['--name', '-n', '--machine-name'], type=str, help='The name of the ' + 'hybrid machine.', id_part='name') + + with self.argument_context('connectedmachine machine-extension list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('machine_name', type=str, help='The name of the machine containing the extension.') + c.argument('expand', type=str, help='The expand expression to apply on the operation.') + + with self.argument_context('connectedmachine machine-extension show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('machine_name', type=str, help='The name of the machine containing the extension.', id_part='name') + c.argument('name', type=str, help='The name of the machine extension.', id_part='child_name_1') + + with self.argument_context('connectedmachine machine-extension create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('machine_name', type=str, help='The name of the machine where the extension should be created or ' + 'updated.') + c.argument('name', type=str, help='The name of the machine extension.') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('force_update_tag', type=str, 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'], type=str, help='Specifies the type of the extension; an example ' + 'is "CustomScriptExtension".') + c.argument('type_handler_version', type=str, help='Specifies the version of the script handler.') + c.argument('auto_upgrade_minor_version', options_list=['--auto-upgrade-minor'], + arg_type=get_three_state_flag(), 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.') + c.argument('settings', type=validate_file_or_dict, help='Json formatted public settings for the extension. ' + 'Expected value: json-string/@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.') + + with self.argument_context('connectedmachine machine-extension update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('machine_name', type=str, help='The name of the machine where the extension should be created or ' + 'updated.', id_part='name') + c.argument('name', type=str, help='The name of the machine extension.', id_part='child_name_1') + c.argument('tags', tags_type) + c.argument('force_update_tag', type=str, 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'], type=str, help='Specifies the type of the extension; an example ' + 'is "CustomScriptExtension".') + c.argument('type_handler_version', type=str, help='Specifies the version of the script handler.') + c.argument('auto_upgrade_minor_version', options_list=['--auto-upgrade-minor'], + arg_type=get_three_state_flag(), 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.') + c.argument('settings', type=validate_file_or_dict, help='Json formatted public settings for the extension. ' + 'Expected value: json-string/@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.') + + with self.argument_context('connectedmachine machine-extension delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('machine_name', type=str, help='The name of the machine where the extension should be deleted.', + id_part='name') + c.argument('name', type=str, help='The name of the machine extension.', id_part='child_name_1') + + with self.argument_context('connectedmachine machine-extension wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('machine_name', type=str, help='The name of the machine containing the extension.', id_part='name') + c.argument('name', type=str, help='The name of the machine extension.', id_part='child_name_1') diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/version.py b/src/connectedmachine/azext_connectedmachine/generated/_validators.py similarity index 92% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/version.py rename to src/connectedmachine/azext_connectedmachine/generated/_validators.py index 3266861fd6b..b33a44c1ebf 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/version.py +++ b/src/connectedmachine/azext_connectedmachine/generated/_validators.py @@ -1,4 +1,3 @@ -# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for @@ -8,5 +7,3 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- - -VERSION = "0.1.0rc1" diff --git a/src/connectedmachine/azext_connectedmachine/generated/action.py b/src/connectedmachine/azext_connectedmachine/generated/action.py new file mode 100644 index 00000000000..b49bfaeeefe --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/generated/action.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access diff --git a/src/connectedmachine/azext_connectedmachine/generated/commands.py b/src/connectedmachine/azext_connectedmachine/generated/commands.py new file mode 100644 index 00000000000..39032d402e4 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/generated/commands.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_connectedmachine.generated._client_factory import cf_machine + connectedmachine_machine = CliCommandType( + operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._machine_operations#MachineOp' + 'erations.{}', + client_factory=cf_machine) + with self.command_group('connectedmachine machine', connectedmachine_machine, client_factory=cf_machine, + is_experimental=True) as g: + g.custom_command('list', 'connectedmachine_machine_list') + g.custom_show_command('show', 'connectedmachine_machine_show') + g.custom_command('delete', 'connectedmachine_machine_delete', confirmation=True) + + from azext_connectedmachine.generated._client_factory import cf_machine_extension + connectedmachine_machine_extension = CliCommandType( + operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._machine_extension_operations' + '#MachineExtensionOperations.{}', + client_factory=cf_machine_extension) + with self.command_group('connectedmachine machine-extension', connectedmachine_machine_extension, + client_factory=cf_machine_extension, is_experimental=True) as g: + g.custom_command('list', 'connectedmachine_machine_extension_list') + g.custom_show_command('show', 'connectedmachine_machine_extension_show') + g.custom_command('create', 'connectedmachine_machine_extension_create', supports_no_wait=True) + g.custom_command('update', 'connectedmachine_machine_extension_update', supports_no_wait=True) + g.custom_command('delete', 'connectedmachine_machine_extension_delete', supports_no_wait=True, + confirmation=True) + g.custom_wait_command('wait', 'connectedmachine_machine_extension_show') diff --git a/src/connectedmachine/azext_connectedmachine/generated/custom.py b/src/connectedmachine/azext_connectedmachine/generated/custom.py new file mode 100644 index 00000000000..34070c45e44 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/generated/custom.py @@ -0,0 +1,123 @@ +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from azure.cli.core.util import sdk_no_wait + + +def connectedmachine_machine_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_machine_show(client, + resource_group_name, + machine_name): + return client.get(resource_group_name=resource_group_name, + name=machine_name, + expand="instanceView") + + +def connectedmachine_machine_delete(client, + resource_group_name, + machine_name): + return client.delete(resource_group_name=resource_group_name, + name=machine_name) + + +def connectedmachine_machine_extension_list(client, + resource_group_name, + machine_name, + expand=None): + return client.list(resource_group_name=resource_group_name, + name=machine_name, + expand=expand) + + +def connectedmachine_machine_extension_show(client, + resource_group_name, + machine_name, + name): + return client.get(resource_group_name=resource_group_name, + name=machine_name, + extension_name=name) + + +def connectedmachine_machine_extension_create(client, + resource_group_name, + machine_name, + name, + location, + tags=None, + force_update_tag=None, + publisher=None, + type_=None, + type_handler_version=None, + auto_upgrade_minor_version=None, + settings=None, + protected_settings=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + name=machine_name, + extension_name=name, + tags=tags, + location=location, + force_update_tag=force_update_tag, + publisher=publisher, + type=type_, + type_handler_version=type_handler_version, + auto_upgrade_minor_version=auto_upgrade_minor_version, + settings=settings, + protected_settings=protected_settings, + status=None) + + +def connectedmachine_machine_extension_update(client, + resource_group_name, + machine_name, + name, + tags=None, + force_update_tag=None, + publisher=None, + type_=None, + type_handler_version=None, + auto_upgrade_minor_version=None, + settings=None, + protected_settings=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + name=machine_name, + extension_name=name, + tags=tags, + force_update_tag=force_update_tag, + publisher=publisher, + type=type_, + type_handler_version=type_handler_version, + auto_upgrade_minor_version=auto_upgrade_minor_version, + settings=settings, + protected_settings=protected_settings) + + +def connectedmachine_machine_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, + name=machine_name, + extension_name=name) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_hybrid_compute_management_client_enums.py b/src/connectedmachine/azext_connectedmachine/manual/__init__.py similarity index 60% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_hybrid_compute_management_client_enums.py rename to src/connectedmachine/azext_connectedmachine/manual/__init__.py index 3abdca4c61f..c9cfdc73e77 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_hybrid_compute_management_client_enums.py +++ b/src/connectedmachine/azext_connectedmachine/manual/__init__.py @@ -9,23 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class StatusTypes(str, Enum): - - connected = "Connected" - disconnected = "Disconnected" - error = "Error" - - -class StatusLevelTypes(str, Enum): - - info = "Info" - warning = "Warning" - error = "Error" - - -class InstanceViewTypes(str, Enum): - - instance_view = "instanceView" +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/connectedmachine/azext_connectedmachine/tests/__init__.py b/src/connectedmachine/azext_connectedmachine/tests/__init__.py index 99c0f28cd71..50e0627daff 100644 --- a/src/connectedmachine/azext_connectedmachine/tests/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/tests/__init__.py @@ -1,5 +1,114 @@ -# ----------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- # 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +import inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func) + module_path = __path__[0] + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/__init__.py b/src/connectedmachine/azext_connectedmachine/tests/latest/__init__.py index 99c0f28cd71..c9cfdc73e77 100644 --- a/src/connectedmachine/azext_connectedmachine/tests/latest/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/__init__.py @@ -1,5 +1,12 @@ -# ----------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- # 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/test_connectedmachine_scenario.py b/src/connectedmachine/azext_connectedmachine/tests/latest/test_connectedmachine_scenario.py index 53d9ed8d2ad..98b18e63ac8 100644 --- a/src/connectedmachine/azext_connectedmachine/tests/latest/test_connectedmachine_scenario.py +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/test_connectedmachine_scenario.py @@ -1,32 +1,147 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- import os -import unittest - -from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) +from azure.cli.testsdk import ScenarioTest +from .. import try_manual, raise_if, calc_coverage +from azure.cli.testsdk import ResourceGroupPreparer TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) -class ConnectedmachineScenarioTest(ScenarioTest): - - @ResourceGroupPreparer(name_prefix='cli_test_connectedmachine') - @AllowLargeResponse(size_kb=3072) - def test_connectedmachine(self, resource_group): - self.kwargs.update({ - 'name': '0.4.19298.002', - 'rg': 'hybridrptest', - }) - count = len(self.cmd('connectedmachine list').get_output_in_json()) - self.cmd('az connectedmachine show --resource-group {rg} --name {name}', checks=[ - self.check('name', '{name}'), - self.check('resourceGroup', '{rg}'), - ]) - self.cmd('connectedmachine delete -g {rg} -n {name}') - final_count = len(self.cmd('connectedmachine list').get_output_in_json()) - self.assertTrue(final_count, count - 1) +@try_manual +def setup(test, rg): + pass + + +# EXAMPLE: /MachineExtensions/put/Create or Update a Machine Extension +@try_manual +def step__machineextensions_put(test, rg): + test.cmd('az connectedmachine machine-extension create ' + '--machine-name "myMachine" ' + '--name "CustomScriptExtension" ' + '--location "eastus2euap" ' + '--type "CustomScriptExtension" ' + '--publisher "Microsoft.Compute" ' + '--settings "{{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object {{ $_.CPU ' + '-gt 10000 }}\\\\\\"\\"}}" ' + '--type-handler-version "1.10" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /MachineExtensions/get/GET Machine Extension +@try_manual +def step__machineextensions_get_get_machine_extension(test, rg): + test.cmd('az connectedmachine machine-extension show ' + '--machine-name "myMachine" ' + '--name "CustomScriptExtension" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /MachineExtensions/get/GET all Machine Extensions +@try_manual +def step__machineextensions_get(test, rg): + test.cmd('az connectedmachine machine-extension list ' + '--machine-name "myMachine" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /MachineExtensions/patch/Create or Update a Machine Extension +@try_manual +def step__machineextensions_patch(test, rg): + test.cmd('az connectedmachine machine-extension update ' + '--machine-name "myMachine" ' + '--name "CustomScriptExtension" ' + '--type "CustomScriptExtension" ' + '--publisher "Microsoft.Compute" ' + '--settings "{{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object {{ $_.CPU ' + '-lt 100 }}\\\\\\"\\"}}" ' + '--type-handler-version "1.10" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /Machines/get/Get Machine +@try_manual +def step__machines_get_get_machine(test, rg): + test.cmd('az connectedmachine machine show ' + '--name "myMachine" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /Machines/get/List Machines by resource group +@try_manual +def step__machines_get_list_machines_by_resource_group(test, rg): + test.cmd('az connectedmachine machine list ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /Machines/get/List Machines by resource group +@try_manual +def step__machines_get_list_machines_by_resource_group(test, rg): + test.cmd('az connectedmachine machine list ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /MachineExtensions/delete/Delete a Machine Extension +@try_manual +def step__machineextensions_delete(test, rg): + test.cmd('az connectedmachine machine-extension delete -y ' + '--machine-name "myMachine" ' + '--name "MMA" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /Machines/delete/Delete a Machine +@try_manual +def step__machines_delete_delete_a_machine(test, rg): + test.cmd('az connectedmachine machine delete -y ' + '--name "myMachine" ' + '--resource-group "{rg}"', + checks=[]) + + +@try_manual +def cleanup(test, rg): + pass + + +@try_manual +def call_scenario(test, rg): + setup(test, rg) + step__machineextensions_put(test, rg) + step__machineextensions_get_get_machine_extension(test, rg) + step__machineextensions_get(test, rg) + step__machineextensions_patch(test, rg) + step__machines_get_get_machine(test, rg) + step__machines_get_list_machines_by_resource_group(test, rg) + step__machines_get_list_machines_by_resource_group(test, rg) + step__machineextensions_delete(test, rg) + step__machines_delete_delete_a_machine(test, rg) + cleanup(test, rg) + + +@try_manual +class ConnectedMachineScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestconnectedmachine_myResourceGroup'[:7], key='rg', parameter_name='rg') + def test_connectedmachine(self, rg): + + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/__init__.py index ec0845f7e17..c9cfdc73e77 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/__init__.py @@ -9,11 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -from ._configuration import HybridComputeManagementClientConfiguration -from ._hybrid_compute_management_client import HybridComputeManagementClient -__all__ = ['HybridComputeManagementClient', 'HybridComputeManagementClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION - +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/_configuration.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/_configuration.py deleted file mode 100644 index 869afbc539a..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/_configuration.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration - -from .version import VERSION - - -class HybridComputeManagementClientConfiguration(AzureConfiguration): - """Configuration for HybridComputeManagementClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(HybridComputeManagementClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-hybridcompute/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/_hybrid_compute_management_client.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/_hybrid_compute_management_client.py deleted file mode 100644 index ed04d1bcc9d..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/_hybrid_compute_management_client.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer - -from ._configuration import HybridComputeManagementClientConfiguration -from .operations import MachinesOperations -from .operations import MachineExtensionsOperations -from .operations import Operations -from . import models - - -class HybridComputeManagementClient(SDKClient): - """The Hybrid Compute Management Client. - - :ivar config: Configuration for client. - :vartype config: HybridComputeManagementClientConfiguration - - :ivar machines: Machines operations - :vartype machines: azure.mgmt.hybridcompute.operations.MachinesOperations - :ivar machine_extensions: MachineExtensions operations - :vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.hybridcompute.operations.Operations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = HybridComputeManagementClientConfiguration(credentials, subscription_id, base_url) - super(HybridComputeManagementClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-08-02-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.machines = MachinesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.machine_extensions = MachineExtensionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/__init__.py new file mode 100644 index 00000000000..35ef17cd924 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._connected_machine import ConnectedMachine +__all__ = ['ConnectedMachine'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py new file mode 100644 index 00000000000..30e13b4570d --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ConnectedMachineConfiguration(Configuration): + """Configuration for ConnectedMachine. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ConnectedMachineConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-08-02" + self.credential_scopes = ['https://management.azure.com/.default'] + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + kwargs.setdefault('sdk_moniker', 'connectedmachine/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_connected_machine.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_connected_machine.py new file mode 100644 index 00000000000..c9fe364e257 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_connected_machine.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import ConnectedMachineConfiguration +from .operations import MachineOperations +from .operations import MachineExtensionOperations +from .operations import OperationOperations +from . import models + + +class ConnectedMachine(object): + """The Hybrid Compute Management Client. + + :ivar machine: MachineOperations operations + :vartype machine: connected_machine.operations.MachineOperations + :ivar machine_extension: MachineExtensionOperations operations + :vartype machine_extension: connected_machine.operations.MachineExtensionOperations + :ivar operation: OperationOperations operations + :vartype operation: connected_machine.operations.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ConnectedMachineConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.machine = MachineOperations( + self._client, self._config, self._serialize, self._deserialize) + self.machine_extension = MachineExtensionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ConnectedMachine + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/__init__.py new file mode 100644 index 00000000000..73b411ccdcb --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._connected_machine_async import ConnectedMachine +__all__ = ['ConnectedMachine'] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration_async.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration_async.py new file mode 100644 index 00000000000..7a22244ff57 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration_async.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class ConnectedMachineConfiguration(Configuration): + """Configuration for ConnectedMachine. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ConnectedMachineConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-08-02" + self.credential_scopes = ['https://management.azure.com/.default'] + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + kwargs.setdefault('sdk_moniker', 'connectedmachine/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine_async.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine_async.py new file mode 100644 index 00000000000..f0a492604f8 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine_async.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration_async import ConnectedMachineConfiguration +from .operations_async import MachineOperations +from .operations_async import MachineExtensionOperations +from .operations_async import OperationOperations +from .. import models + + +class ConnectedMachine(object): + """The Hybrid Compute Management Client. + + :ivar machine: MachineOperations operations + :vartype machine: connected_machine.aio.operations_async.MachineOperations + :ivar machine_extension: MachineExtensionOperations operations + :vartype machine_extension: connected_machine.aio.operations_async.MachineExtensionOperations + :ivar operation: OperationOperations operations + :vartype operation: connected_machine.aio.operations_async.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ConnectedMachineConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.machine = MachineOperations( + self._client, self._config, self._serialize, self._deserialize) + self.machine_extension = MachineExtensionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ConnectedMachine": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/__init__.py new file mode 100644 index 00000000000..ff66f70f156 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._machine_operations_async import MachineOperations +from ._machine_extension_operations_async import MachineExtensionOperations +from ._operation_operations_async import OperationOperations + +__all__ = [ + 'MachineOperations', + 'MachineExtensionOperations', + 'OperationOperations', +] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_machine_extension_operations_async.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_machine_extension_operations_async.py new file mode 100644 index 00000000000..c00ffed3c04 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_machine_extension_operations_async.py @@ -0,0 +1,623 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MachineExtensionOperations: + """MachineExtensionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~connected_machine.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + extension_name: str, + location: str, + tags: Optional[Dict[str, str]] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + status: Optional["models.MachineExtensionInstanceViewStatus"] = None, + **kwargs + ) -> Optional["models.MachineExtension"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MachineExtension"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _extension_parameters = models.MachineExtension(tags=tags, location=location, force_update_tag=force_update_tag, publisher=publisher, type_properties_type=type, type_handler_version_properties_type_handler_version=type_handler_version, auto_upgrade_minor_version=auto_upgrade_minor_version, settings=settings, protected_settings=protected_settings, status=status) + api_version = "2020-08-02" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_extension_parameters, 'MachineExtension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + extension_name: str, + location: str, + tags: Optional[Dict[str, str]] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + status: Optional["models.MachineExtensionInstanceViewStatus"] = None, + **kwargs + ) -> AsyncLROPoller["models.MachineExtension"]: + """The operation to create or update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine where the extension should be created or updated. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param location: The geo-location where the resource lives. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~connected_machine.models.MachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + location=location, + tags=tags, + force_update_tag=force_update_tag, + publisher=publisher, + type=type, + type_handler_version=type_handler_version, + auto_upgrade_minor_version=auto_upgrade_minor_version, + settings=settings, + protected_settings=protected_settings, + status=status, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + name: str, + extension_name: str, + tags: Optional[Dict[str, str]] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + **kwargs + ) -> Optional["models.MachineExtension"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MachineExtension"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _extension_parameters = models.MachineExtensionUpdate(tags=tags, force_update_tag=force_update_tag, publisher=publisher, type=type, type_handler_version=type_handler_version, auto_upgrade_minor_version=auto_upgrade_minor_version, settings=settings, protected_settings=protected_settings) + api_version = "2020-08-02" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_extension_parameters, 'MachineExtensionUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + name: str, + extension_name: str, + tags: Optional[Dict[str, str]] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + **kwargs + ) -> AsyncLROPoller["models.MachineExtension"]: + """The operation to create or update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine where the extension should be created or updated. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~connected_machine.models.MachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + tags=tags, + force_update_tag=force_update_tag, + publisher=publisher, + type=type, + type_handler_version=type_handler_version, + auto_upgrade_minor_version=auto_upgrade_minor_version, + settings=settings, + protected_settings=protected_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + name: str, + extension_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + name: str, + extension_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to delete the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine where the extension should be deleted. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + extension_name: str, + **kwargs + ) -> "models.MachineExtension": + """The operation to get the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine containing the extension. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MachineExtension, or the result of cls(response) + :rtype: ~connected_machine.models.MachineExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + def list( + self, + resource_group_name: str, + name: str, + expand: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.MachineExtensionsListResult"]: + """The operation to get all extensions of a non-Azure machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine containing the extension. + :type name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MachineExtensionsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_machine.models.MachineExtensionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtensionsListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MachineExtensionsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_machine_operations_async.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_machine_operations_async.py new file mode 100644 index 00000000000..b936343745a --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_machine_operations_async.py @@ -0,0 +1,289 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MachineOperations: + """MachineOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~connected_machine.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + name: str, + **kwargs + ) -> None: + """The operation to remove a hybrid machine identity in Azure. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the hybrid machine. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + expand: Optional[Union[str, "models.InstanceViewTypes"]] = None, + **kwargs + ) -> "models.Machine": + """Retrieves information about the model view or the instance view of a hybrid machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the hybrid machine. + :type name: str + :param expand: The expand expression to apply on the operation. + :type expand: str or ~connected_machine.models.InstanceViewTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Machine, or the result of cls(response) + :rtype: ~connected_machine.models.Machine + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Machine"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Machine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.MachineListResult"]: + """Lists all the hybrid machines in the specified resource group. Use the nextLink property in the + response to get the next page of hybrid machines. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MachineListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_machine.models.MachineListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MachineListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.MachineListResult"]: + """Lists all the hybrid machines in the specified subscription. Use the nextLink property in the + response to get the next page of hybrid machines. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MachineListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_machine.models.MachineListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MachineListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_operation_operations_async.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_operation_operations_async.py new file mode 100644 index 00000000000..8c3939cae8e --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_operation_operations_async.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~connected_machine.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.OperationListResult"]: + """Gets a list of hybrid compute operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_machine.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.HybridCompute/operations'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py new file mode 100644 index 00000000000..d9ce4d9297c --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import Identity + from ._models_py3 import LocationData + from ._models_py3 import Machine + from ._models_py3 import MachineExtension + from ._models_py3 import MachineExtensionInstanceView + from ._models_py3 import MachineExtensionInstanceViewStatus + from ._models_py3 import MachineExtensionProperties + from ._models_py3 import MachineExtensionPropertiesInstanceView + from ._models_py3 import MachineExtensionPropertiesautogenerated + from ._models_py3 import MachineExtensionUpdate + from ._models_py3 import MachineExtensionUpdateProperties + from ._models_py3 import MachineExtensionUpdatePropertiesautogenerated + from ._models_py3 import MachineExtensionsListResult + from ._models_py3 import MachineIdentity + from ._models_py3 import MachineListResult + from ._models_py3 import MachineProperties + from ._models_py3 import MachinePropertiesOsProfile + from ._models_py3 import MachinePropertiesautogenerated + from ._models_py3 import MachineUpdate + from ._models_py3 import MachineUpdateIdentity + from ._models_py3 import MachineUpdateProperties + from ._models_py3 import MachineUpdatePropertiesautogenerated + from ._models_py3 import OperationListResult + from ._models_py3 import OperationValue + from ._models_py3 import OperationValueDisplay + from ._models_py3 import OperationValueDisplayautogenerated + from ._models_py3 import OsProfile + from ._models_py3 import Resource + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateResource +except (SyntaxError, ImportError): + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import Identity # type: ignore + from ._models import LocationData # type: ignore + from ._models import Machine # type: ignore + from ._models import MachineExtension # type: ignore + from ._models import MachineExtensionInstanceView # type: ignore + from ._models import MachineExtensionInstanceViewStatus # type: ignore + from ._models import MachineExtensionProperties # type: ignore + from ._models import MachineExtensionPropertiesInstanceView # type: ignore + from ._models import MachineExtensionPropertiesautogenerated # type: ignore + from ._models import MachineExtensionUpdate # type: ignore + from ._models import MachineExtensionUpdateProperties # type: ignore + from ._models import MachineExtensionUpdatePropertiesautogenerated # type: ignore + from ._models import MachineExtensionsListResult # type: ignore + from ._models import MachineIdentity # type: ignore + from ._models import MachineListResult # type: ignore + from ._models import MachineProperties # type: ignore + from ._models import MachinePropertiesOsProfile # type: ignore + from ._models import MachinePropertiesautogenerated # type: ignore + from ._models import MachineUpdate # type: ignore + from ._models import MachineUpdateIdentity # type: ignore + from ._models import MachineUpdateProperties # type: ignore + from ._models import MachineUpdatePropertiesautogenerated # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import OperationValue # type: ignore + from ._models import OperationValueDisplay # type: ignore + from ._models import OperationValueDisplayautogenerated # type: ignore + from ._models import OsProfile # type: ignore + from ._models import Resource # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import UpdateResource # type: ignore + +from ._connected_machine_enums import ( + InstanceViewTypes, + StatusLevelTypes, + StatusTypes, +) + +__all__ = [ + 'ErrorDetail', + 'ErrorResponse', + 'Identity', + 'LocationData', + 'Machine', + 'MachineExtension', + 'MachineExtensionInstanceView', + 'MachineExtensionInstanceViewStatus', + 'MachineExtensionProperties', + 'MachineExtensionPropertiesInstanceView', + 'MachineExtensionPropertiesautogenerated', + 'MachineExtensionUpdate', + 'MachineExtensionUpdateProperties', + 'MachineExtensionUpdatePropertiesautogenerated', + 'MachineExtensionsListResult', + 'MachineIdentity', + 'MachineListResult', + 'MachineProperties', + 'MachinePropertiesOsProfile', + 'MachinePropertiesautogenerated', + 'MachineUpdate', + 'MachineUpdateIdentity', + 'MachineUpdateProperties', + 'MachineUpdatePropertiesautogenerated', + 'OperationListResult', + 'OperationValue', + 'OperationValueDisplay', + 'OperationValueDisplayautogenerated', + 'OsProfile', + 'Resource', + 'TrackedResource', + 'UpdateResource', + 'InstanceViewTypes', + 'StatusLevelTypes', + 'StatusTypes', +] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py new file mode 100644 index 00000000000..c3ccf88fe6a --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_connected_machine_enums.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class InstanceViewTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + INSTANCE_VIEW = "instanceView" + +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The level code. + """ + + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" + +class StatusTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the hybrid machine agent. + """ + + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + ERROR = "Error" diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py new file mode 100644 index 00000000000..b54993920c6 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py @@ -0,0 +1,1492 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class ErrorDetail(msrest.serialization.Model): + """Error details. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error's code. + :type code: str + :param message: Required. A human readable error message. + :type message: str + :param target: Indicates which property in the request is responsible for the error. + :type target: str + :param details: Additional error details. + :type details: list[~connected_machine.models.ErrorDetail] + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class ErrorResponse(msrest.serialization.Model): + """Contains details when the response code indicates an error. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The error details. + :type error: ~connected_machine.models.ErrorDetail + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs['error'] + + +class Identity(msrest.serialization.Model): + """Managed Identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. + :vartype principal_id: str + :ivar tenant_id: The identity's tenant id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None + + +class LocationData(msrest.serialization.Model): + """Metadata pertaining to the geographic location of the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A canonical name for the geographic or physical location. + :type name: str + :param city: The city or locality where the resource is located. + :type city: str + :param district: The district, state, or province where the resource is located. + :type district: str + :param country_or_region: The country or region where the resource is located. + :type country_or_region: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 256, 'min_length': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'district': {'key': 'district', 'type': 'str'}, + 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LocationData, self).__init__(**kwargs) + self.name = kwargs['name'] + self.city = kwargs.get('city', None) + self.district = kwargs.get('district', None) + self.country_or_region = kwargs.get('country_or_region', None) + + +class Resource(msrest.serialization.Model): + """Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + + +class Machine(TrackedResource): + """Describes a hybrid machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :param identity: Managed Identity. + :type identity: ~connected_machine.models.Identity + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + :ivar os_profile: Specifies the operating system settings for the hybrid machine. + :vartype os_profile: ~connected_machine.models.OsProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar status: The status of the hybrid machine agent. Possible values include: "Connected", + "Disconnected", "Error". + :vartype status: str or ~connected_machine.models.StatusTypes + :ivar last_status_change: The time of the last status change. + :vartype last_status_change: ~datetime.datetime + :ivar error_details: Details about the error state. + :vartype error_details: list[~connected_machine.models.ErrorDetail] + :ivar agent_version: The hybrid machine agent full version. + :vartype agent_version: str + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :ivar display_name: Specifies the hybrid machine display name. + :vartype display_name: str + :ivar machine_fqdn: Specifies the hybrid machine FQDN. + :vartype machine_fqdn: str + :param client_public_key: Public Key that the client provides to be used during initial + resource onboarding. + :type client_public_key: str + :ivar os_name: The Operating System running on the hybrid machine. + :vartype os_name: str + :ivar os_version: The version of Operating System running on the hybrid machine. + :vartype os_version: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. + :vartype vm_uuid: str + :ivar extensions: Machine Extensions information. + :vartype extensions: list[~connected_machine.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'os_profile': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'last_status_change': {'readonly': True}, + 'error_details': {'readonly': True}, + 'agent_version': {'readonly': True}, + 'display_name': {'readonly': True}, + 'machine_fqdn': {'readonly': True}, + 'os_name': {'readonly': True}, + 'os_version': {'readonly': True}, + 'vm_uuid': {'readonly': True}, + 'extensions': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'ad_fqdn': {'readonly': True}, + 'dns_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location_data': {'key': 'properties.locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OsProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_status_change': {'key': 'properties.lastStatusChange', 'type': 'iso-8601'}, + 'error_details': {'key': 'properties.errorDetails', 'type': '[ErrorDetail]'}, + 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'machine_fqdn': {'key': 'properties.machineFqdn', 'type': 'str'}, + 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, + 'os_name': {'key': 'properties.osName', 'type': 'str'}, + 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, + 'vm_uuid': {'key': 'properties.vmUuid', 'type': 'str'}, + 'extensions': {'key': 'properties.extensions', 'type': '[MachineExtensionInstanceView]'}, + 'os_sku': {'key': 'properties.osSku', 'type': 'str'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'ad_fqdn': {'key': 'properties.adFqdn', 'type': 'str'}, + 'dns_fqdn': {'key': 'properties.dnsFqdn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Machine, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.location_data = kwargs.get('location_data', None) + self.os_profile = None + self.provisioning_state = None + self.status = None + self.last_status_change = None + self.error_details = None + self.agent_version = None + self.vm_id = kwargs.get('vm_id', None) + self.display_name = None + self.machine_fqdn = None + self.client_public_key = kwargs.get('client_public_key', None) + self.os_name = None + self.os_version = None + self.vm_uuid = None + self.extensions = None + self.os_sku = None + self.domain_name = None + self.ad_fqdn = None + self.dns_fqdn = None + + +class MachineExtension(TrackedResource): + """Describes a Machine Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type_properties_type: str + :param type_handler_version_properties_type_handler_version: Specifies the version of the + script handler. + :type type_handler_version_properties_type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar name_properties_instance_view_name: The machine extension name. + :vartype name_properties_instance_view_name: str + :ivar type_properties_instance_view_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :vartype type_properties_instance_view_type: str + :ivar type_handler_version_properties_instance_view_type_handler_version: Specifies the version + of the script handler. + :vartype type_handler_version_properties_instance_view_type_handler_version: str + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name_properties_instance_view_name': {'readonly': True}, + 'type_properties_instance_view_type': {'readonly': True}, + 'type_handler_version_properties_instance_view_type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version_properties_type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_properties_instance_view_name': {'key': 'properties.instanceView.name', 'type': 'str'}, + 'type_properties_instance_view_type': {'key': 'properties.instanceView.type', 'type': 'str'}, + 'type_handler_version_properties_instance_view_type_handler_version': {'key': 'properties.instanceView.typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'properties.instanceView.status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtension, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type_properties_type = kwargs.get('type_properties_type', None) + self.type_handler_version_properties_type_handler_version = kwargs.get('type_handler_version_properties_type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + self.provisioning_state = None + self.name_properties_instance_view_name = None + self.type_properties_instance_view_type = None + self.type_handler_version_properties_instance_view_type_handler_version = None + self.status = kwargs.get('status', None) + + +class MachineExtensionInstanceView(msrest.serialization.Model): + """Describes the Machine Extension Instance View. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The machine extension name. + :vartype name: str + :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionInstanceView, self).__init__(**kwargs) + self.name = None + self.type = None + self.type_handler_version = None + self.status = kwargs.get('status', None) + + +class MachineExtensionInstanceViewStatus(msrest.serialization.Model): + """Instance view status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The status code. + :vartype code: str + :ivar level: The level code. Possible values include: "Info", "Warning", "Error". + :vartype level: str or ~connected_machine.models.StatusLevelTypes + :ivar display_status: The short localizable label for the status. + :vartype display_status: str + :ivar message: The detailed status message, including for alerts and error messages. + :vartype message: str + :ivar time: The time of the status. + :vartype time: ~datetime.datetime + """ + + _validation = { + 'code': {'readonly': True}, + 'level': {'readonly': True}, + 'display_status': {'readonly': True}, + 'message': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionInstanceViewStatus, self).__init__(**kwargs) + self.code = None + self.level = None + self.display_status = None + self.message = None + self.time = None + + +class MachineExtensionProperties(msrest.serialization.Model): + """Describes the properties of a Machine Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar name: The machine extension name. + :vartype name: str + :ivar type_instance_view_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :vartype type_instance_view_type: str + :ivar type_handler_version_instance_view_type_handler_version: Specifies the version of the + script handler. + :vartype type_handler_version_instance_view_type_handler_version: str + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'type_instance_view_type': {'readonly': True}, + 'type_handler_version_instance_view_type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'name': {'key': 'instanceView.name', 'type': 'str'}, + 'type_instance_view_type': {'key': 'instanceView.type', 'type': 'str'}, + 'type_handler_version_instance_view_type_handler_version': {'key': 'instanceView.typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'instanceView.status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionProperties, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + self.provisioning_state = None + self.name = None + self.type_instance_view_type = None + self.type_handler_version_instance_view_type_handler_version = None + self.status = kwargs.get('status', None) + + +class MachineExtensionPropertiesautogenerated(MachineExtensionProperties): + """Describes Machine Extension Properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar name: The machine extension name. + :vartype name: str + :ivar type_instance_view_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :vartype type_instance_view_type: str + :ivar type_handler_version_instance_view_type_handler_version: Specifies the version of the + script handler. + :vartype type_handler_version_instance_view_type_handler_version: str + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'type_instance_view_type': {'readonly': True}, + 'type_handler_version_instance_view_type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'name': {'key': 'instanceView.name', 'type': 'str'}, + 'type_instance_view_type': {'key': 'instanceView.type', 'type': 'str'}, + 'type_handler_version_instance_view_type_handler_version': {'key': 'instanceView.typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'instanceView.status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionPropertiesautogenerated, self).__init__(**kwargs) + + +class MachineExtensionPropertiesInstanceView(MachineExtensionInstanceView): + """The machine extension instance view. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The machine extension name. + :vartype name: str + :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionPropertiesInstanceView, self).__init__(**kwargs) + + +class MachineExtensionsListResult(msrest.serialization.Model): + """Describes the Machine Extensions List Result. + + :param value: The list of extensions. + :type value: list[~connected_machine.models.MachineExtension] + :param next_link: The uri to fetch the next page of machine extensions. Call ListNext() with + this to fetch the next page of extensions. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MachineExtension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionsListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class UpdateResource(msrest.serialization.Model): + """The Update Resource model definition. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class MachineExtensionUpdate(UpdateResource): + """Describes a Machine Extension Update. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionUpdate, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + + +class MachineExtensionUpdateProperties(msrest.serialization.Model): + """Describes the properties of a Machine Extension. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionUpdateProperties, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + + +class MachineExtensionUpdatePropertiesautogenerated(MachineExtensionUpdateProperties): + """Describes Machine Extension Update Properties. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionUpdatePropertiesautogenerated, self).__init__(**kwargs) + + +class MachineIdentity(Identity): + """MachineIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. + :vartype principal_id: str + :ivar tenant_id: The identity's tenant id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineIdentity, self).__init__(**kwargs) + + +class MachineListResult(msrest.serialization.Model): + """The List hybrid machine operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of hybrid machines. + :type value: list[~connected_machine.models.Machine] + :param next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI to + fetch the next page of hybrid machines. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Machine]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class MachineProperties(msrest.serialization.Model): + """Describes the properties of a hybrid machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + :ivar os_profile: Specifies the operating system settings for the hybrid machine. + :vartype os_profile: ~connected_machine.models.OsProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar status: The status of the hybrid machine agent. Possible values include: "Connected", + "Disconnected", "Error". + :vartype status: str or ~connected_machine.models.StatusTypes + :ivar last_status_change: The time of the last status change. + :vartype last_status_change: ~datetime.datetime + :ivar error_details: Details about the error state. + :vartype error_details: list[~connected_machine.models.ErrorDetail] + :ivar agent_version: The hybrid machine agent full version. + :vartype agent_version: str + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :ivar display_name: Specifies the hybrid machine display name. + :vartype display_name: str + :ivar machine_fqdn: Specifies the hybrid machine FQDN. + :vartype machine_fqdn: str + :param client_public_key: Public Key that the client provides to be used during initial + resource onboarding. + :type client_public_key: str + :ivar os_name: The Operating System running on the hybrid machine. + :vartype os_name: str + :ivar os_version: The version of Operating System running on the hybrid machine. + :vartype os_version: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. + :vartype vm_uuid: str + :ivar extensions: Machine Extensions information. + :vartype extensions: list[~connected_machine.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + """ + + _validation = { + 'os_profile': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'last_status_change': {'readonly': True}, + 'error_details': {'readonly': True}, + 'agent_version': {'readonly': True}, + 'display_name': {'readonly': True}, + 'machine_fqdn': {'readonly': True}, + 'os_name': {'readonly': True}, + 'os_version': {'readonly': True}, + 'vm_uuid': {'readonly': True}, + 'extensions': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'ad_fqdn': {'readonly': True}, + 'dns_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, + 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetail]'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'machine_fqdn': {'key': 'machineFqdn', 'type': 'str'}, + 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'vm_uuid': {'key': 'vmUuid', 'type': 'str'}, + 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, + 'os_sku': {'key': 'osSku', 'type': 'str'}, + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'ad_fqdn': {'key': 'adFqdn', 'type': 'str'}, + 'dns_fqdn': {'key': 'dnsFqdn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineProperties, self).__init__(**kwargs) + self.location_data = kwargs.get('location_data', None) + self.os_profile = None + self.provisioning_state = None + self.status = None + self.last_status_change = None + self.error_details = None + self.agent_version = None + self.vm_id = kwargs.get('vm_id', None) + self.display_name = None + self.machine_fqdn = None + self.client_public_key = kwargs.get('client_public_key', None) + self.os_name = None + self.os_version = None + self.vm_uuid = None + self.extensions = None + self.os_sku = None + self.domain_name = None + self.ad_fqdn = None + self.dns_fqdn = None + + +class MachinePropertiesautogenerated(MachineProperties): + """Hybrid Compute Machine properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + :ivar os_profile: Specifies the operating system settings for the hybrid machine. + :vartype os_profile: ~connected_machine.models.OsProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar status: The status of the hybrid machine agent. Possible values include: "Connected", + "Disconnected", "Error". + :vartype status: str or ~connected_machine.models.StatusTypes + :ivar last_status_change: The time of the last status change. + :vartype last_status_change: ~datetime.datetime + :ivar error_details: Details about the error state. + :vartype error_details: list[~connected_machine.models.ErrorDetail] + :ivar agent_version: The hybrid machine agent full version. + :vartype agent_version: str + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :ivar display_name: Specifies the hybrid machine display name. + :vartype display_name: str + :ivar machine_fqdn: Specifies the hybrid machine FQDN. + :vartype machine_fqdn: str + :param client_public_key: Public Key that the client provides to be used during initial + resource onboarding. + :type client_public_key: str + :ivar os_name: The Operating System running on the hybrid machine. + :vartype os_name: str + :ivar os_version: The version of Operating System running on the hybrid machine. + :vartype os_version: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. + :vartype vm_uuid: str + :ivar extensions: Machine Extensions information. + :vartype extensions: list[~connected_machine.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + """ + + _validation = { + 'os_profile': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'last_status_change': {'readonly': True}, + 'error_details': {'readonly': True}, + 'agent_version': {'readonly': True}, + 'display_name': {'readonly': True}, + 'machine_fqdn': {'readonly': True}, + 'os_name': {'readonly': True}, + 'os_version': {'readonly': True}, + 'vm_uuid': {'readonly': True}, + 'extensions': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'ad_fqdn': {'readonly': True}, + 'dns_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, + 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetail]'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'machine_fqdn': {'key': 'machineFqdn', 'type': 'str'}, + 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'vm_uuid': {'key': 'vmUuid', 'type': 'str'}, + 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, + 'os_sku': {'key': 'osSku', 'type': 'str'}, + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'ad_fqdn': {'key': 'adFqdn', 'type': 'str'}, + 'dns_fqdn': {'key': 'dnsFqdn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachinePropertiesautogenerated, self).__init__(**kwargs) + + +class OsProfile(msrest.serialization.Model): + """Specifies the operating system settings for the hybrid machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar computer_name: Specifies the host OS name of the hybrid machine. + :vartype computer_name: str + """ + + _validation = { + 'computer_name': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OsProfile, self).__init__(**kwargs) + self.computer_name = None + + +class MachinePropertiesOsProfile(OsProfile): + """Specifies the operating system settings for the hybrid machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar computer_name: Specifies the host OS name of the hybrid machine. + :vartype computer_name: str + """ + + _validation = { + 'computer_name': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachinePropertiesOsProfile, self).__init__(**kwargs) + + +class MachineUpdate(UpdateResource): + """Describes a hybrid machine Update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. + :vartype principal_id: str + :ivar tenant_id: The identity's tenant id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location_data': {'key': 'properties.locationData', 'type': 'LocationData'}, + 'type': {'key': 'identity.type', 'type': 'str'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineUpdate, self).__init__(**kwargs) + self.location_data = kwargs.get('location_data', None) + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None + + +class MachineUpdateIdentity(Identity): + """Hybrid Compute Machine Managed Identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. + :vartype principal_id: str + :ivar tenant_id: The identity's tenant id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineUpdateIdentity, self).__init__(**kwargs) + + +class MachineUpdateProperties(msrest.serialization.Model): + """Describes the ARM updatable properties of a hybrid machine. + + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + """ + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineUpdateProperties, self).__init__(**kwargs) + self.location_data = kwargs.get('location_data', None) + + +class MachineUpdatePropertiesautogenerated(MachineUpdateProperties): + """Hybrid Compute Machine properties. + + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + """ + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineUpdatePropertiesautogenerated, self).__init__(**kwargs) + + +class OperationListResult(msrest.serialization.Model): + """The List Compute Operation operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of compute operations. + :vartype value: list[~connected_machine.models.OperationValue] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationValue]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + + +class OperationValue(msrest.serialization.Model): + """Describes the properties of a Compute Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the compute operation. + :vartype origin: str + :ivar name: The name of the compute operation. + :vartype name: str + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class OperationValueDisplay(msrest.serialization.Model): + """Describes the properties of a Hybrid Compute Operation Value Display. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValueDisplay, self).__init__(**kwargs) + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class OperationValueDisplayautogenerated(OperationValueDisplay): + """Display properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValueDisplayautogenerated, self).__init__(**kwargs) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py new file mode 100644 index 00000000000..8098f04304a --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py @@ -0,0 +1,1604 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Dict, List, Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class ErrorDetail(msrest.serialization.Model): + """Error details. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error's code. + :type code: str + :param message: Required. A human readable error message. + :type message: str + :param target: Indicates which property in the request is responsible for the error. + :type target: str + :param details: Additional error details. + :type details: list[~connected_machine.models.ErrorDetail] + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + } + + def __init__( + self, + *, + code: str, + message: str, + target: Optional[str] = None, + details: Optional[List["ErrorDetail"]] = None, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ErrorResponse(msrest.serialization.Model): + """Contains details when the response code indicates an error. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The error details. + :type error: ~connected_machine.models.ErrorDetail + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: "ErrorDetail", + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class Identity(msrest.serialization.Model): + """Managed Identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. + :vartype principal_id: str + :ivar tenant_id: The identity's tenant id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + + +class LocationData(msrest.serialization.Model): + """Metadata pertaining to the geographic location of the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A canonical name for the geographic or physical location. + :type name: str + :param city: The city or locality where the resource is located. + :type city: str + :param district: The district, state, or province where the resource is located. + :type district: str + :param country_or_region: The country or region where the resource is located. + :type country_or_region: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 256, 'min_length': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'district': {'key': 'district', 'type': 'str'}, + 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + city: Optional[str] = None, + district: Optional[str] = None, + country_or_region: Optional[str] = None, + **kwargs + ): + super(LocationData, self).__init__(**kwargs) + self.name = name + self.city = city + self.district = district + self.country_or_region = country_or_region + + +class Resource(msrest.serialization.Model): + """Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class Machine(TrackedResource): + """Describes a hybrid machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :param identity: Managed Identity. + :type identity: ~connected_machine.models.Identity + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + :ivar os_profile: Specifies the operating system settings for the hybrid machine. + :vartype os_profile: ~connected_machine.models.OsProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar status: The status of the hybrid machine agent. Possible values include: "Connected", + "Disconnected", "Error". + :vartype status: str or ~connected_machine.models.StatusTypes + :ivar last_status_change: The time of the last status change. + :vartype last_status_change: ~datetime.datetime + :ivar error_details: Details about the error state. + :vartype error_details: list[~connected_machine.models.ErrorDetail] + :ivar agent_version: The hybrid machine agent full version. + :vartype agent_version: str + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :ivar display_name: Specifies the hybrid machine display name. + :vartype display_name: str + :ivar machine_fqdn: Specifies the hybrid machine FQDN. + :vartype machine_fqdn: str + :param client_public_key: Public Key that the client provides to be used during initial + resource onboarding. + :type client_public_key: str + :ivar os_name: The Operating System running on the hybrid machine. + :vartype os_name: str + :ivar os_version: The version of Operating System running on the hybrid machine. + :vartype os_version: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. + :vartype vm_uuid: str + :ivar extensions: Machine Extensions information. + :vartype extensions: list[~connected_machine.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'os_profile': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'last_status_change': {'readonly': True}, + 'error_details': {'readonly': True}, + 'agent_version': {'readonly': True}, + 'display_name': {'readonly': True}, + 'machine_fqdn': {'readonly': True}, + 'os_name': {'readonly': True}, + 'os_version': {'readonly': True}, + 'vm_uuid': {'readonly': True}, + 'extensions': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'ad_fqdn': {'readonly': True}, + 'dns_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location_data': {'key': 'properties.locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OsProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_status_change': {'key': 'properties.lastStatusChange', 'type': 'iso-8601'}, + 'error_details': {'key': 'properties.errorDetails', 'type': '[ErrorDetail]'}, + 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'machine_fqdn': {'key': 'properties.machineFqdn', 'type': 'str'}, + 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, + 'os_name': {'key': 'properties.osName', 'type': 'str'}, + 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, + 'vm_uuid': {'key': 'properties.vmUuid', 'type': 'str'}, + 'extensions': {'key': 'properties.extensions', 'type': '[MachineExtensionInstanceView]'}, + 'os_sku': {'key': 'properties.osSku', 'type': 'str'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'ad_fqdn': {'key': 'properties.adFqdn', 'type': 'str'}, + 'dns_fqdn': {'key': 'properties.dnsFqdn', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["Identity"] = None, + location_data: Optional["LocationData"] = None, + vm_id: Optional[str] = None, + client_public_key: Optional[str] = None, + **kwargs + ): + super(Machine, self).__init__(tags=tags, location=location, **kwargs) + self.identity = identity + self.location_data = location_data + self.os_profile = None + self.provisioning_state = None + self.status = None + self.last_status_change = None + self.error_details = None + self.agent_version = None + self.vm_id = vm_id + self.display_name = None + self.machine_fqdn = None + self.client_public_key = client_public_key + self.os_name = None + self.os_version = None + self.vm_uuid = None + self.extensions = None + self.os_sku = None + self.domain_name = None + self.ad_fqdn = None + self.dns_fqdn = None + + +class MachineExtension(TrackedResource): + """Describes a Machine Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type_properties_type: str + :param type_handler_version_properties_type_handler_version: Specifies the version of the + script handler. + :type type_handler_version_properties_type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar name_properties_instance_view_name: The machine extension name. + :vartype name_properties_instance_view_name: str + :ivar type_properties_instance_view_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :vartype type_properties_instance_view_type: str + :ivar type_handler_version_properties_instance_view_type_handler_version: Specifies the version + of the script handler. + :vartype type_handler_version_properties_instance_view_type_handler_version: str + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name_properties_instance_view_name': {'readonly': True}, + 'type_properties_instance_view_type': {'readonly': True}, + 'type_handler_version_properties_instance_view_type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version_properties_type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_properties_instance_view_name': {'key': 'properties.instanceView.name', 'type': 'str'}, + 'type_properties_instance_view_type': {'key': 'properties.instanceView.type', 'type': 'str'}, + 'type_handler_version_properties_instance_view_type_handler_version': {'key': 'properties.instanceView.typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'properties.instanceView.status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type_properties_type: Optional[str] = None, + type_handler_version_properties_type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + status: Optional["MachineExtensionInstanceViewStatus"] = None, + **kwargs + ): + super(MachineExtension, self).__init__(tags=tags, location=location, **kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type_properties_type = type_properties_type + self.type_handler_version_properties_type_handler_version = type_handler_version_properties_type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.name_properties_instance_view_name = None + self.type_properties_instance_view_type = None + self.type_handler_version_properties_instance_view_type_handler_version = None + self.status = status + + +class MachineExtensionInstanceView(msrest.serialization.Model): + """Describes the Machine Extension Instance View. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The machine extension name. + :vartype name: str + :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + *, + status: Optional["MachineExtensionInstanceViewStatus"] = None, + **kwargs + ): + super(MachineExtensionInstanceView, self).__init__(**kwargs) + self.name = None + self.type = None + self.type_handler_version = None + self.status = status + + +class MachineExtensionInstanceViewStatus(msrest.serialization.Model): + """Instance view status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The status code. + :vartype code: str + :ivar level: The level code. Possible values include: "Info", "Warning", "Error". + :vartype level: str or ~connected_machine.models.StatusLevelTypes + :ivar display_status: The short localizable label for the status. + :vartype display_status: str + :ivar message: The detailed status message, including for alerts and error messages. + :vartype message: str + :ivar time: The time of the status. + :vartype time: ~datetime.datetime + """ + + _validation = { + 'code': {'readonly': True}, + 'level': {'readonly': True}, + 'display_status': {'readonly': True}, + 'message': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionInstanceViewStatus, self).__init__(**kwargs) + self.code = None + self.level = None + self.display_status = None + self.message = None + self.time = None + + +class MachineExtensionProperties(msrest.serialization.Model): + """Describes the properties of a Machine Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar name: The machine extension name. + :vartype name: str + :ivar type_instance_view_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :vartype type_instance_view_type: str + :ivar type_handler_version_instance_view_type_handler_version: Specifies the version of the + script handler. + :vartype type_handler_version_instance_view_type_handler_version: str + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'type_instance_view_type': {'readonly': True}, + 'type_handler_version_instance_view_type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'name': {'key': 'instanceView.name', 'type': 'str'}, + 'type_instance_view_type': {'key': 'instanceView.type', 'type': 'str'}, + 'type_handler_version_instance_view_type_handler_version': {'key': 'instanceView.typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'instanceView.status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + *, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + status: Optional["MachineExtensionInstanceViewStatus"] = None, + **kwargs + ): + super(MachineExtensionProperties, self).__init__(**kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.name = None + self.type_instance_view_type = None + self.type_handler_version_instance_view_type_handler_version = None + self.status = status + + +class MachineExtensionPropertiesautogenerated(MachineExtensionProperties): + """Describes Machine Extension Properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar name: The machine extension name. + :vartype name: str + :ivar type_instance_view_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :vartype type_instance_view_type: str + :ivar type_handler_version_instance_view_type_handler_version: Specifies the version of the + script handler. + :vartype type_handler_version_instance_view_type_handler_version: str + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'type_instance_view_type': {'readonly': True}, + 'type_handler_version_instance_view_type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'name': {'key': 'instanceView.name', 'type': 'str'}, + 'type_instance_view_type': {'key': 'instanceView.type', 'type': 'str'}, + 'type_handler_version_instance_view_type_handler_version': {'key': 'instanceView.typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'instanceView.status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + *, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + status: Optional["MachineExtensionInstanceViewStatus"] = None, + **kwargs + ): + super(MachineExtensionPropertiesautogenerated, self).__init__(force_update_tag=force_update_tag, publisher=publisher, type=type, type_handler_version=type_handler_version, auto_upgrade_minor_version=auto_upgrade_minor_version, settings=settings, protected_settings=protected_settings, status=status, **kwargs) + + +class MachineExtensionPropertiesInstanceView(MachineExtensionInstanceView): + """The machine extension instance view. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The machine extension name. + :vartype name: str + :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + *, + status: Optional["MachineExtensionInstanceViewStatus"] = None, + **kwargs + ): + super(MachineExtensionPropertiesInstanceView, self).__init__(status=status, **kwargs) + + +class MachineExtensionsListResult(msrest.serialization.Model): + """Describes the Machine Extensions List Result. + + :param value: The list of extensions. + :type value: list[~connected_machine.models.MachineExtension] + :param next_link: The uri to fetch the next page of machine extensions. Call ListNext() with + this to fetch the next page of extensions. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MachineExtension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["MachineExtension"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(MachineExtensionsListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class UpdateResource(msrest.serialization.Model): + """The Update Resource model definition. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(UpdateResource, self).__init__(**kwargs) + self.tags = tags + + +class MachineExtensionUpdate(UpdateResource): + """Describes a Machine Extension Update. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + **kwargs + ): + super(MachineExtensionUpdate, self).__init__(tags=tags, **kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + + +class MachineExtensionUpdateProperties(msrest.serialization.Model): + """Describes the properties of a Machine Extension. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + *, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + **kwargs + ): + super(MachineExtensionUpdateProperties, self).__init__(**kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + + +class MachineExtensionUpdatePropertiesautogenerated(MachineExtensionUpdateProperties): + """Describes Machine Extension Update Properties. + + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + *, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + **kwargs + ): + super(MachineExtensionUpdatePropertiesautogenerated, self).__init__(force_update_tag=force_update_tag, publisher=publisher, type=type, type_handler_version=type_handler_version, auto_upgrade_minor_version=auto_upgrade_minor_version, settings=settings, protected_settings=protected_settings, **kwargs) + + +class MachineIdentity(Identity): + """MachineIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. + :vartype principal_id: str + :ivar tenant_id: The identity's tenant id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + **kwargs + ): + super(MachineIdentity, self).__init__(type=type, **kwargs) + + +class MachineListResult(msrest.serialization.Model): + """The List hybrid machine operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of hybrid machines. + :type value: list[~connected_machine.models.Machine] + :param next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI to + fetch the next page of hybrid machines. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Machine]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Machine"], + next_link: Optional[str] = None, + **kwargs + ): + super(MachineListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class MachineProperties(msrest.serialization.Model): + """Describes the properties of a hybrid machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + :ivar os_profile: Specifies the operating system settings for the hybrid machine. + :vartype os_profile: ~connected_machine.models.OsProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar status: The status of the hybrid machine agent. Possible values include: "Connected", + "Disconnected", "Error". + :vartype status: str or ~connected_machine.models.StatusTypes + :ivar last_status_change: The time of the last status change. + :vartype last_status_change: ~datetime.datetime + :ivar error_details: Details about the error state. + :vartype error_details: list[~connected_machine.models.ErrorDetail] + :ivar agent_version: The hybrid machine agent full version. + :vartype agent_version: str + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :ivar display_name: Specifies the hybrid machine display name. + :vartype display_name: str + :ivar machine_fqdn: Specifies the hybrid machine FQDN. + :vartype machine_fqdn: str + :param client_public_key: Public Key that the client provides to be used during initial + resource onboarding. + :type client_public_key: str + :ivar os_name: The Operating System running on the hybrid machine. + :vartype os_name: str + :ivar os_version: The version of Operating System running on the hybrid machine. + :vartype os_version: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. + :vartype vm_uuid: str + :ivar extensions: Machine Extensions information. + :vartype extensions: list[~connected_machine.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + """ + + _validation = { + 'os_profile': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'last_status_change': {'readonly': True}, + 'error_details': {'readonly': True}, + 'agent_version': {'readonly': True}, + 'display_name': {'readonly': True}, + 'machine_fqdn': {'readonly': True}, + 'os_name': {'readonly': True}, + 'os_version': {'readonly': True}, + 'vm_uuid': {'readonly': True}, + 'extensions': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'ad_fqdn': {'readonly': True}, + 'dns_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, + 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetail]'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'machine_fqdn': {'key': 'machineFqdn', 'type': 'str'}, + 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'vm_uuid': {'key': 'vmUuid', 'type': 'str'}, + 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, + 'os_sku': {'key': 'osSku', 'type': 'str'}, + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'ad_fqdn': {'key': 'adFqdn', 'type': 'str'}, + 'dns_fqdn': {'key': 'dnsFqdn', 'type': 'str'}, + } + + def __init__( + self, + *, + location_data: Optional["LocationData"] = None, + vm_id: Optional[str] = None, + client_public_key: Optional[str] = None, + **kwargs + ): + super(MachineProperties, self).__init__(**kwargs) + self.location_data = location_data + self.os_profile = None + self.provisioning_state = None + self.status = None + self.last_status_change = None + self.error_details = None + self.agent_version = None + self.vm_id = vm_id + self.display_name = None + self.machine_fqdn = None + self.client_public_key = client_public_key + self.os_name = None + self.os_version = None + self.vm_uuid = None + self.extensions = None + self.os_sku = None + self.domain_name = None + self.ad_fqdn = None + self.dns_fqdn = None + + +class MachinePropertiesautogenerated(MachineProperties): + """Hybrid Compute Machine properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + :ivar os_profile: Specifies the operating system settings for the hybrid machine. + :vartype os_profile: ~connected_machine.models.OsProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar status: The status of the hybrid machine agent. Possible values include: "Connected", + "Disconnected", "Error". + :vartype status: str or ~connected_machine.models.StatusTypes + :ivar last_status_change: The time of the last status change. + :vartype last_status_change: ~datetime.datetime + :ivar error_details: Details about the error state. + :vartype error_details: list[~connected_machine.models.ErrorDetail] + :ivar agent_version: The hybrid machine agent full version. + :vartype agent_version: str + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :ivar display_name: Specifies the hybrid machine display name. + :vartype display_name: str + :ivar machine_fqdn: Specifies the hybrid machine FQDN. + :vartype machine_fqdn: str + :param client_public_key: Public Key that the client provides to be used during initial + resource onboarding. + :type client_public_key: str + :ivar os_name: The Operating System running on the hybrid machine. + :vartype os_name: str + :ivar os_version: The version of Operating System running on the hybrid machine. + :vartype os_version: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID. + :vartype vm_uuid: str + :ivar extensions: Machine Extensions information. + :vartype extensions: list[~connected_machine.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + """ + + _validation = { + 'os_profile': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'last_status_change': {'readonly': True}, + 'error_details': {'readonly': True}, + 'agent_version': {'readonly': True}, + 'display_name': {'readonly': True}, + 'machine_fqdn': {'readonly': True}, + 'os_name': {'readonly': True}, + 'os_version': {'readonly': True}, + 'vm_uuid': {'readonly': True}, + 'extensions': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'ad_fqdn': {'readonly': True}, + 'dns_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, + 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetail]'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'machine_fqdn': {'key': 'machineFqdn', 'type': 'str'}, + 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'vm_uuid': {'key': 'vmUuid', 'type': 'str'}, + 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, + 'os_sku': {'key': 'osSku', 'type': 'str'}, + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'ad_fqdn': {'key': 'adFqdn', 'type': 'str'}, + 'dns_fqdn': {'key': 'dnsFqdn', 'type': 'str'}, + } + + def __init__( + self, + *, + location_data: Optional["LocationData"] = None, + vm_id: Optional[str] = None, + client_public_key: Optional[str] = None, + **kwargs + ): + super(MachinePropertiesautogenerated, self).__init__(location_data=location_data, vm_id=vm_id, client_public_key=client_public_key, **kwargs) + + +class OsProfile(msrest.serialization.Model): + """Specifies the operating system settings for the hybrid machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar computer_name: Specifies the host OS name of the hybrid machine. + :vartype computer_name: str + """ + + _validation = { + 'computer_name': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OsProfile, self).__init__(**kwargs) + self.computer_name = None + + +class MachinePropertiesOsProfile(OsProfile): + """Specifies the operating system settings for the hybrid machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar computer_name: Specifies the host OS name of the hybrid machine. + :vartype computer_name: str + """ + + _validation = { + 'computer_name': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachinePropertiesOsProfile, self).__init__(**kwargs) + + +class MachineUpdate(UpdateResource): + """Describes a hybrid machine Update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. + :vartype principal_id: str + :ivar tenant_id: The identity's tenant id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location_data': {'key': 'properties.locationData', 'type': 'LocationData'}, + 'type': {'key': 'identity.type', 'type': 'str'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + location_data: Optional["LocationData"] = None, + type: Optional[str] = None, + **kwargs + ): + super(MachineUpdate, self).__init__(tags=tags, **kwargs) + self.location_data = location_data + self.type = type + self.principal_id = None + self.tenant_id = None + + +class MachineUpdateIdentity(Identity): + """Hybrid Compute Machine Managed Identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. + :vartype principal_id: str + :ivar tenant_id: The identity's tenant id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + **kwargs + ): + super(MachineUpdateIdentity, self).__init__(type=type, **kwargs) + + +class MachineUpdateProperties(msrest.serialization.Model): + """Describes the ARM updatable properties of a hybrid machine. + + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + """ + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + } + + def __init__( + self, + *, + location_data: Optional["LocationData"] = None, + **kwargs + ): + super(MachineUpdateProperties, self).__init__(**kwargs) + self.location_data = location_data + + +class MachineUpdatePropertiesautogenerated(MachineUpdateProperties): + """Hybrid Compute Machine properties. + + :param location_data: Metadata pertaining to the geographic location of the resource. + :type location_data: ~connected_machine.models.LocationData + """ + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + } + + def __init__( + self, + *, + location_data: Optional["LocationData"] = None, + **kwargs + ): + super(MachineUpdatePropertiesautogenerated, self).__init__(location_data=location_data, **kwargs) + + +class OperationListResult(msrest.serialization.Model): + """The List Compute Operation operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of compute operations. + :vartype value: list[~connected_machine.models.OperationValue] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationValue]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + + +class OperationValue(msrest.serialization.Model): + """Describes the properties of a Compute Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the compute operation. + :vartype origin: str + :ivar name: The name of the compute operation. + :vartype name: str + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class OperationValueDisplay(msrest.serialization.Model): + """Describes the properties of a Hybrid Compute Operation Value Display. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValueDisplay, self).__init__(**kwargs) + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class OperationValueDisplayautogenerated(OperationValueDisplay): + """Display properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValueDisplayautogenerated, self).__init__(**kwargs) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py new file mode 100644 index 00000000000..7a5d284a13f --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._machine_operations import MachineOperations +from ._machine_extension_operations import MachineExtensionOperations +from ._operation_operations import OperationOperations + +__all__ = [ + 'MachineOperations', + 'MachineExtensionOperations', + 'OperationOperations', +] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extension_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extension_operations.py new file mode 100644 index 00000000000..1694298a089 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extension_operations.py @@ -0,0 +1,635 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MachineExtensionOperations(object): + """MachineExtensionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~connected_machine.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + location, # type: str + tags=None, # type: Optional[Dict[str, str]] + force_update_tag=None, # type: Optional[str] + publisher=None, # type: Optional[str] + type=None, # type: Optional[str] + type_handler_version=None, # type: Optional[str] + auto_upgrade_minor_version=None, # type: Optional[bool] + settings=None, # type: Optional[object] + protected_settings=None, # type: Optional[object] + status=None, # type: Optional["models.MachineExtensionInstanceViewStatus"] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.MachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MachineExtension"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _extension_parameters = models.MachineExtension(tags=tags, location=location, force_update_tag=force_update_tag, publisher=publisher, type_properties_type=type, type_handler_version_properties_type_handler_version=type_handler_version, auto_upgrade_minor_version=auto_upgrade_minor_version, settings=settings, protected_settings=protected_settings, status=status) + api_version = "2020-08-02" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_extension_parameters, 'MachineExtension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + location, # type: str + tags=None, # type: Optional[Dict[str, str]] + force_update_tag=None, # type: Optional[str] + publisher=None, # type: Optional[str] + type=None, # type: Optional[str] + type_handler_version=None, # type: Optional[str] + auto_upgrade_minor_version=None, # type: Optional[bool] + settings=None, # type: Optional[object] + protected_settings=None, # type: Optional[object] + status=None, # type: Optional["models.MachineExtensionInstanceViewStatus"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.MachineExtension"] + """The operation to create or update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine where the extension should be created or updated. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param location: The geo-location where the resource lives. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :param status: Instance view status. + :type status: ~connected_machine.models.MachineExtensionInstanceViewStatus + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~connected_machine.models.MachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + location=location, + tags=tags, + force_update_tag=force_update_tag, + publisher=publisher, + type=type, + type_handler_version=type_handler_version, + auto_upgrade_minor_version=auto_upgrade_minor_version, + settings=settings, + protected_settings=protected_settings, + status=status, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + tags=None, # type: Optional[Dict[str, str]] + force_update_tag=None, # type: Optional[str] + publisher=None, # type: Optional[str] + type=None, # type: Optional[str] + type_handler_version=None, # type: Optional[str] + auto_upgrade_minor_version=None, # type: Optional[bool] + settings=None, # type: Optional[object] + protected_settings=None, # type: Optional[object] + **kwargs # type: Any + ): + # type: (...) -> Optional["models.MachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MachineExtension"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _extension_parameters = models.MachineExtensionUpdate(tags=tags, force_update_tag=force_update_tag, publisher=publisher, type=type, type_handler_version=type_handler_version, auto_upgrade_minor_version=auto_upgrade_minor_version, settings=settings, protected_settings=protected_settings) + api_version = "2020-08-02" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_extension_parameters, 'MachineExtensionUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + tags=None, # type: Optional[Dict[str, str]] + force_update_tag=None, # type: Optional[str] + publisher=None, # type: Optional[str] + type=None, # type: Optional[str] + type_handler_version=None, # type: Optional[str] + auto_upgrade_minor_version=None, # type: Optional[bool] + settings=None, # type: Optional[object] + protected_settings=None, # type: Optional[object] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.MachineExtension"] + """The operation to create or update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine where the extension should be created or updated. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: 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. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~connected_machine.models.MachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + tags=tags, + force_update_tag=force_update_tag, + publisher=publisher, + type=type, + type_handler_version=type_handler_version, + auto_upgrade_minor_version=auto_upgrade_minor_version, + settings=settings, + protected_settings=protected_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine where the extension should be deleted. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.MachineExtension" + """The operation to get the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine containing the extension. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MachineExtension, or the result of cls(response) + :rtype: ~connected_machine.models.MachineExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.MachineExtensionsListResult"] + """The operation to get all extensions of a non-Azure machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine containing the extension. + :type name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MachineExtensionsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~connected_machine.models.MachineExtensionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtensionsListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MachineExtensionsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_operations.py new file mode 100644 index 00000000000..9964da86e36 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_operations.py @@ -0,0 +1,297 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MachineOperations(object): + """MachineOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~connected_machine.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """The operation to remove a hybrid machine identity in Azure. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the hybrid machine. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + expand=None, # type: Optional[Union[str, "models.InstanceViewTypes"]] + **kwargs # type: Any + ): + # type: (...) -> "models.Machine" + """Retrieves information about the model view or the instance view of a hybrid machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the hybrid machine. + :type name: str + :param expand: The expand expression to apply on the operation. + :type expand: str or ~connected_machine.models.InstanceViewTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Machine, or the result of cls(response) + :rtype: ~connected_machine.models.Machine + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Machine"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Machine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.MachineListResult"] + """Lists all the hybrid machines in the specified resource group. Use the nextLink property in the + response to get the next page of hybrid machines. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MachineListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~connected_machine.models.MachineListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MachineListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.MachineListResult"] + """Lists all the hybrid machines in the specified subscription. Use the nextLink property in the + response to get the next page of hybrid machines. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MachineListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~connected_machine.models.MachineListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MachineListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operation_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operation_operations.py new file mode 100644 index 00000000000..81080b1c7be --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operation_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~connected_machine.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] + """Gets a list of hybrid compute operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~connected_machine.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-08-02" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.HybridCompute/operations'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/py.typed b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/__init__.py deleted file mode 100644 index 4fd29ce26c7..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/__init__.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse, ErrorResponseException - from ._models_py3 import Machine - from ._models_py3 import MachineExtension - from ._models_py3 import MachineExtensionInstanceView - from ._models_py3 import MachineExtensionInstanceViewStatus - from ._models_py3 import MachineExtensionUpdate - from ._models_py3 import MachineReconnect - from ._models_py3 import MachineUpdate - from ._models_py3 import OperationValue - from ._models_py3 import OSProfile - from ._models_py3 import Resource - from ._models_py3 import UpdateResource -except (SyntaxError, ImportError): - from ._models import ErrorDetail - from ._models import ErrorResponse, ErrorResponseException - from ._models import Machine - from ._models import MachineExtension - from ._models import MachineExtensionInstanceView - from ._models import MachineExtensionInstanceViewStatus - from ._models import MachineExtensionUpdate - from ._models import MachineReconnect - from ._models import MachineUpdate - from ._models import OperationValue - from ._models import OSProfile - from ._models import Resource - from ._models import UpdateResource -from ._paged_models import MachineExtensionPaged -from ._paged_models import MachinePaged -from ._paged_models import OperationValuePaged -from ._hybrid_compute_management_client_enums import ( - StatusTypes, - StatusLevelTypes, - InstanceViewTypes, -) - -__all__ = [ - 'ErrorDetail', - 'ErrorResponse', 'ErrorResponseException', - 'Machine', - 'MachineExtension', - 'MachineExtensionInstanceView', - 'MachineExtensionInstanceViewStatus', - 'MachineExtensionUpdate', - 'MachineReconnect', - 'MachineUpdate', - 'OperationValue', - 'OSProfile', - 'Resource', - 'UpdateResource', - 'MachinePaged', - 'MachineExtensionPaged', - 'OperationValuePaged', - 'StatusTypes', - 'StatusLevelTypes', - 'InstanceViewTypes', -] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_models.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_models.py deleted file mode 100644 index 97ecf06f915..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_models.py +++ /dev/null @@ -1,630 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class ErrorDetail(Model): - """Error details. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. The error's code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param target: Indicates which property in the request is responsible for - the error. - :type target: str - :param details: Additional error details. - :type details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - } - - def __init__(self, **kwargs): - super(ErrorDetail, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ErrorResponse(Model): - """Error response. - - Contains details when the response code indicates an error. - - All required parameters must be populated in order to send to Azure. - - :param error: Required. The error details. - :type error: ~azure.mgmt.hybridcompute.models.ErrorDetail - """ - - _validation = { - 'error': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) - - -class Resource(Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.type1 = kwargs.get('type1', None) - self.principal_id = None - self.tenant_id = None - - -class Machine(Resource): - """Describes a hybrid machine. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str - :param os_profile: Specifies the operating system settings for the hybrid - machine. - :type os_profile: ~azure.mgmt.hybridcompute.models.OSProfile - :ivar provisioning_state: The provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar status: The status of the hybrid machine agent. Possible values - include: 'Connected', 'Disconnected', 'Error' - :vartype status: str or ~azure.mgmt.hybridcompute.models.StatusTypes - :ivar last_status_change: The time of the last status change. - :vartype last_status_change: datetime - :ivar error_details: Details about the error state. - :vartype error_details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] - :ivar agent_version: The hybrid machine agent full version. - :vartype agent_version: str - :ivar vm_id: Specifies the hybrid machine unique ID. - :vartype vm_id: str - :ivar display_name: Specifies the hybrid machine display name. - :vartype display_name: str - :ivar machine_fqdn: Specifies the hybrid machine FQDN. - :vartype machine_fqdn: str - :param physical_location: Resource's Physical Location - :type physical_location: str - :param client_public_key: Public Key that the client provides to be used - during initial resource onboarding - :type client_public_key: str - :ivar os_name: The Operating System running on the hybrid machine. - :vartype os_name: str - :ivar os_version: The version of Operating System running on the hybrid - machine. - :vartype os_version: str - :param extensions: Machine Extensions information - :type extensions: - list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status': {'readonly': True}, - 'last_status_change': {'readonly': True}, - 'error_details': {'readonly': True}, - 'agent_version': {'readonly': True}, - 'vm_id': {'readonly': True}, - 'display_name': {'readonly': True}, - 'machine_fqdn': {'readonly': True}, - 'os_name': {'readonly': True}, - 'os_version': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'StatusTypes'}, - 'last_status_change': {'key': 'properties.lastStatusChange', 'type': 'iso-8601'}, - 'error_details': {'key': 'properties.errorDetails', 'type': '[ErrorDetail]'}, - 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, - 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'machine_fqdn': {'key': 'properties.machineFqdn', 'type': 'str'}, - 'physical_location': {'key': 'properties.physicalLocation', 'type': 'str'}, - 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, - 'os_name': {'key': 'properties.osName', 'type': 'str'}, - 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, - 'extensions': {'key': 'properties.extensions', 'type': '[MachineExtensionInstanceView]'}, - } - - def __init__(self, **kwargs): - super(Machine, self).__init__(**kwargs) - self.os_profile = kwargs.get('os_profile', None) - self.provisioning_state = None - self.status = None - self.last_status_change = None - self.error_details = None - self.agent_version = None - self.vm_id = None - self.display_name = None - self.machine_fqdn = None - self.physical_location = kwargs.get('physical_location', None) - self.client_public_key = kwargs.get('client_public_key', None) - self.os_name = None - self.os_version = None - self.extensions = kwargs.get('extensions', None) - - -class MachineExtension(Resource): - """Describes a Machine Extension. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str - :param force_update_tag: How the extension handler should be forced to - update even if the extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param machine_extension_type: Specifies the type of the extension; an - example is "CustomScriptExtension". - :type machine_extension_type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param auto_upgrade_minor_version: 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. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either - protectedSettings or protectedSettingsFromKeyVault or no protected - settings at all. - :type protected_settings: object - :ivar provisioning_state: The provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param instance_view: The machine extension instance view. - :type instance_view: - ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'properties.publisher', 'type': 'str'}, - 'machine_extension_type': {'key': 'properties.type', 'type': 'str'}, - 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'properties.settings', 'type': 'object'}, - 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'instance_view': {'key': 'properties.instanceView', 'type': 'MachineExtensionInstanceView'}, - } - - def __init__(self, **kwargs): - super(MachineExtension, self).__init__(**kwargs) - self.force_update_tag = kwargs.get('force_update_tag', None) - self.publisher = kwargs.get('publisher', None) - self.machine_extension_type = kwargs.get('machine_extension_type', None) - self.type_handler_version = kwargs.get('type_handler_version', None) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) - self.settings = kwargs.get('settings', None) - self.protected_settings = kwargs.get('protected_settings', None) - self.provisioning_state = None - self.instance_view = kwargs.get('instance_view', None) - - -class MachineExtensionInstanceView(Model): - """Describes the Machine Extension Instance View. - - :param name: The machine extension name. - :type name: str - :param type: Specifies the type of the extension; an example is - "CustomScriptExtension". - :type type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param status: Instance view status. - :type status: - ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceViewStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, - } - - def __init__(self, **kwargs): - super(MachineExtensionInstanceView, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.type_handler_version = kwargs.get('type_handler_version', None) - self.status = kwargs.get('status', None) - - -class MachineExtensionInstanceViewStatus(Model): - """Instance view status. - - :param code: The status code. - :type code: str - :param level: The level code. Possible values include: 'Info', 'Warning', - 'Error' - :type level: str or ~azure.mgmt.hybridcompute.models.StatusLevelTypes - :param display_status: The short localizable label for the status. - :type display_status: str - :param message: The detailed status message, including for alerts and - error messages. - :type message: str - :param time: The time of the status. - :type time: datetime - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'StatusLevelTypes'}, - 'display_status': {'key': 'displayStatus', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(MachineExtensionInstanceViewStatus, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.level = kwargs.get('level', None) - self.display_status = kwargs.get('display_status', None) - self.message = kwargs.get('message', None) - self.time = kwargs.get('time', None) - - -class UpdateResource(Model): - """The Update Resource model definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(UpdateResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class MachineExtensionUpdate(UpdateResource): - """Describes a Machine Extension Update. - - :param tags: Resource tags - :type tags: dict[str, str] - :param force_update_tag: How the extension handler should be forced to - update even if the extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param type: Specifies the type of the extension; an example is - "CustomScriptExtension". - :type type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param auto_upgrade_minor_version: 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. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either - protectedSettings or protectedSettingsFromKeyVault or no protected - settings at all. - :type protected_settings: object - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'properties.publisher', 'type': 'str'}, - 'type': {'key': 'properties.type', 'type': 'str'}, - 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'properties.settings', 'type': 'object'}, - 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(MachineExtensionUpdate, self).__init__(**kwargs) - self.force_update_tag = kwargs.get('force_update_tag', None) - self.publisher = kwargs.get('publisher', None) - self.type = kwargs.get('type', None) - self.type_handler_version = kwargs.get('type_handler_version', None) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) - self.settings = kwargs.get('settings', None) - self.protected_settings = kwargs.get('protected_settings', None) - - -class MachineReconnect(Model): - """Describes a hybrid machine reconnect. - - :param vm_id: Specifies the hybrid machine unique ID. - :type vm_id: str - :param client_public_key: Public Key that the client provides to be used - during initial resource onboarding. - :type client_public_key: str - """ - - _attribute_map = { - 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, - 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MachineReconnect, self).__init__(**kwargs) - self.vm_id = kwargs.get('vm_id', None) - self.client_public_key = kwargs.get('client_public_key', None) - - -class MachineUpdate(UpdateResource): - """Describes a hybrid machine Update. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param tags: Resource tags - :type tags: dict[str, str] - :param type: The identity type. - :type type: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str - :param physical_location: Resource's Physical Location - :type physical_location: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - 'physical_location': {'key': 'properties.physicalLocation', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MachineUpdate, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.principal_id = None - self.tenant_id = None - self.physical_location = kwargs.get('physical_location', None) - - -class OperationValue(Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OSProfile(Model): - """Specifies the operating system settings for the hybrid machine. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar computer_name: Specifies the host OS name of the hybrid machine. - :vartype computer_name: str - """ - - _validation = { - 'computer_name': {'readonly': True}, - } - - _attribute_map = { - 'computer_name': {'key': 'computerName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OSProfile, self).__init__(**kwargs) - self.computer_name = None diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_models_py3.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_models_py3.py deleted file mode 100644 index 7be311eb5df..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_models_py3.py +++ /dev/null @@ -1,630 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class ErrorDetail(Model): - """Error details. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. The error's code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param target: Indicates which property in the request is responsible for - the error. - :type target: str - :param details: Additional error details. - :type details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - } - - def __init__(self, *, code: str, message: str, target: str=None, details=None, **kwargs) -> None: - super(ErrorDetail, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - - -class ErrorResponse(Model): - """Error response. - - Contains details when the response code indicates an error. - - All required parameters must be populated in order to send to Azure. - - :param error: Required. The error details. - :type error: ~azure.mgmt.hybridcompute.models.ErrorDetail - """ - - _validation = { - 'error': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__(self, *, error, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) - - -class Resource(Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, type1: str=None, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.type1 = type1 - self.principal_id = None - self.tenant_id = None - - -class Machine(Resource): - """Describes a hybrid machine. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str - :param os_profile: Specifies the operating system settings for the hybrid - machine. - :type os_profile: ~azure.mgmt.hybridcompute.models.OSProfile - :ivar provisioning_state: The provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :ivar status: The status of the hybrid machine agent. Possible values - include: 'Connected', 'Disconnected', 'Error' - :vartype status: str or ~azure.mgmt.hybridcompute.models.StatusTypes - :ivar last_status_change: The time of the last status change. - :vartype last_status_change: datetime - :ivar error_details: Details about the error state. - :vartype error_details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] - :ivar agent_version: The hybrid machine agent full version. - :vartype agent_version: str - :ivar vm_id: Specifies the hybrid machine unique ID. - :vartype vm_id: str - :ivar display_name: Specifies the hybrid machine display name. - :vartype display_name: str - :ivar machine_fqdn: Specifies the hybrid machine FQDN. - :vartype machine_fqdn: str - :param physical_location: Resource's Physical Location - :type physical_location: str - :param client_public_key: Public Key that the client provides to be used - during initial resource onboarding - :type client_public_key: str - :ivar os_name: The Operating System running on the hybrid machine. - :vartype os_name: str - :ivar os_version: The version of Operating System running on the hybrid - machine. - :vartype os_version: str - :param extensions: Machine Extensions information - :type extensions: - list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status': {'readonly': True}, - 'last_status_change': {'readonly': True}, - 'error_details': {'readonly': True}, - 'agent_version': {'readonly': True}, - 'vm_id': {'readonly': True}, - 'display_name': {'readonly': True}, - 'machine_fqdn': {'readonly': True}, - 'os_name': {'readonly': True}, - 'os_version': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'StatusTypes'}, - 'last_status_change': {'key': 'properties.lastStatusChange', 'type': 'iso-8601'}, - 'error_details': {'key': 'properties.errorDetails', 'type': '[ErrorDetail]'}, - 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, - 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'machine_fqdn': {'key': 'properties.machineFqdn', 'type': 'str'}, - 'physical_location': {'key': 'properties.physicalLocation', 'type': 'str'}, - 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, - 'os_name': {'key': 'properties.osName', 'type': 'str'}, - 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, - 'extensions': {'key': 'properties.extensions', 'type': '[MachineExtensionInstanceView]'}, - } - - def __init__(self, *, location: str, tags=None, type1: str=None, os_profile=None, physical_location: str=None, client_public_key: str=None, extensions=None, **kwargs) -> None: - super(Machine, self).__init__(location=location, tags=tags, type1=type1, **kwargs) - self.os_profile = os_profile - self.provisioning_state = None - self.status = None - self.last_status_change = None - self.error_details = None - self.agent_version = None - self.vm_id = None - self.display_name = None - self.machine_fqdn = None - self.physical_location = physical_location - self.client_public_key = client_public_key - self.os_name = None - self.os_version = None - self.extensions = extensions - - -class MachineExtension(Resource): - """Describes a Machine Extension. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str - :param force_update_tag: How the extension handler should be forced to - update even if the extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param machine_extension_type: Specifies the type of the extension; an - example is "CustomScriptExtension". - :type machine_extension_type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param auto_upgrade_minor_version: 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. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either - protectedSettings or protectedSettingsFromKeyVault or no protected - settings at all. - :type protected_settings: object - :ivar provisioning_state: The provisioning state, which only appears in - the response. - :vartype provisioning_state: str - :param instance_view: The machine extension instance view. - :type instance_view: - ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'properties.publisher', 'type': 'str'}, - 'machine_extension_type': {'key': 'properties.type', 'type': 'str'}, - 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'properties.settings', 'type': 'object'}, - 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'instance_view': {'key': 'properties.instanceView', 'type': 'MachineExtensionInstanceView'}, - } - - def __init__(self, *, location: str, tags=None, type1: str=None, force_update_tag: str=None, publisher: str=None, machine_extension_type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, instance_view=None, **kwargs) -> None: - super(MachineExtension, self).__init__(location=location, tags=tags, type1=type1, **kwargs) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.machine_extension_type = machine_extension_type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings - self.provisioning_state = None - self.instance_view = instance_view - - -class MachineExtensionInstanceView(Model): - """Describes the Machine Extension Instance View. - - :param name: The machine extension name. - :type name: str - :param type: Specifies the type of the extension; an example is - "CustomScriptExtension". - :type type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param status: Instance view status. - :type status: - ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceViewStatus - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, - } - - def __init__(self, *, name: str=None, type: str=None, type_handler_version: str=None, status=None, **kwargs) -> None: - super(MachineExtensionInstanceView, self).__init__(**kwargs) - self.name = name - self.type = type - self.type_handler_version = type_handler_version - self.status = status - - -class MachineExtensionInstanceViewStatus(Model): - """Instance view status. - - :param code: The status code. - :type code: str - :param level: The level code. Possible values include: 'Info', 'Warning', - 'Error' - :type level: str or ~azure.mgmt.hybridcompute.models.StatusLevelTypes - :param display_status: The short localizable label for the status. - :type display_status: str - :param message: The detailed status message, including for alerts and - error messages. - :type message: str - :param time: The time of the status. - :type time: datetime - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'StatusLevelTypes'}, - 'display_status': {'key': 'displayStatus', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - } - - def __init__(self, *, code: str=None, level=None, display_status: str=None, message: str=None, time=None, **kwargs) -> None: - super(MachineExtensionInstanceViewStatus, self).__init__(**kwargs) - self.code = code - self.level = level - self.display_status = display_status - self.message = message - self.time = time - - -class UpdateResource(Model): - """The Update Resource model definition. - - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(UpdateResource, self).__init__(**kwargs) - self.tags = tags - - -class MachineExtensionUpdate(UpdateResource): - """Describes a Machine Extension Update. - - :param tags: Resource tags - :type tags: dict[str, str] - :param force_update_tag: How the extension handler should be forced to - update even if the extension configuration has not changed. - :type force_update_tag: str - :param publisher: The name of the extension handler publisher. - :type publisher: str - :param type: Specifies the type of the extension; an example is - "CustomScriptExtension". - :type type: str - :param type_handler_version: Specifies the version of the script handler. - :type type_handler_version: str - :param auto_upgrade_minor_version: 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. - :type auto_upgrade_minor_version: bool - :param settings: Json formatted public settings for the extension. - :type settings: object - :param protected_settings: The extension can contain either - protectedSettings or protectedSettingsFromKeyVault or no protected - settings at all. - :type protected_settings: object - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, - 'publisher': {'key': 'properties.publisher', 'type': 'str'}, - 'type': {'key': 'properties.type', 'type': 'str'}, - 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'settings': {'key': 'properties.settings', 'type': 'object'}, - 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, - } - - def __init__(self, *, tags=None, force_update_tag: str=None, publisher: str=None, type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, **kwargs) -> None: - super(MachineExtensionUpdate, self).__init__(tags=tags, **kwargs) - self.force_update_tag = force_update_tag - self.publisher = publisher - self.type = type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings - - -class MachineReconnect(Model): - """Describes a hybrid machine reconnect. - - :param vm_id: Specifies the hybrid machine unique ID. - :type vm_id: str - :param client_public_key: Public Key that the client provides to be used - during initial resource onboarding. - :type client_public_key: str - """ - - _attribute_map = { - 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, - 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, - } - - def __init__(self, *, vm_id: str=None, client_public_key: str=None, **kwargs) -> None: - super(MachineReconnect, self).__init__(**kwargs) - self.vm_id = vm_id - self.client_public_key = client_public_key - - -class MachineUpdate(UpdateResource): - """Describes a hybrid machine Update. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param tags: Resource tags - :type tags: dict[str, str] - :param type: The identity type. - :type type: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str - :param physical_location: Resource's Physical Location - :type physical_location: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - 'physical_location': {'key': 'properties.physicalLocation', 'type': 'str'}, - } - - def __init__(self, *, tags=None, type: str=None, physical_location: str=None, **kwargs) -> None: - super(MachineUpdate, self).__init__(tags=tags, **kwargs) - self.type = type - self.principal_id = None - self.tenant_id = None - self.physical_location = physical_location - - -class OperationValue(Model): - """Describes the properties of a Compute Operation value. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar origin: The origin of the compute operation. - :vartype origin: str - :ivar name: The name of the compute operation. - :vartype name: str - :ivar operation: The display name of the compute operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'operation': {'key': 'display.operation', 'type': 'str'}, - 'resource': {'key': 'display.resource', 'type': 'str'}, - 'description': {'key': 'display.description', 'type': 'str'}, - 'provider': {'key': 'display.provider', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(OperationValue, self).__init__(**kwargs) - self.origin = None - self.name = None - self.operation = None - self.resource = None - self.description = None - self.provider = None - - -class OSProfile(Model): - """Specifies the operating system settings for the hybrid machine. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar computer_name: Specifies the host OS name of the hybrid machine. - :vartype computer_name: str - """ - - _validation = { - 'computer_name': {'readonly': True}, - } - - _attribute_map = { - 'computer_name': {'key': 'computerName', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(OSProfile, self).__init__(**kwargs) - self.computer_name = None diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_paged_models.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_paged_models.py deleted file mode 100644 index a24959c9dfe..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/models/_paged_models.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class MachinePaged(Paged): - """ - A paging container for iterating over a list of :class:`Machine ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Machine]'} - } - - def __init__(self, *args, **kwargs): - - super(MachinePaged, self).__init__(*args, **kwargs) -class MachineExtensionPaged(Paged): - """ - A paging container for iterating over a list of :class:`MachineExtension ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[MachineExtension]'} - } - - def __init__(self, *args, **kwargs): - - super(MachineExtensionPaged, self).__init__(*args, **kwargs) -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/_machine_extensions_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/_machine_extensions_operations.py deleted file mode 100644 index b6d8f89764c..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/_machine_extensions_operations.py +++ /dev/null @@ -1,480 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class MachineExtensionsOperations(object): - """MachineExtensionsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-08-02-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-08-02-preview" - - self.config = config - - - def _create_or_update_initial( - self, resource_group_name, name, extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'name': self._serialize.url("name", name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(extension_parameters, 'MachineExtension') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('MachineExtension', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, name, extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """The operation to create or update the extension. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param name: The name of the machine where the extension should be - created or updated. - :type name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :param extension_parameters: Parameters supplied to the Create Machine - Extension operation. - :type extension_parameters: - ~azure.mgmt.hybridcompute.models.MachineExtension - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns MachineExtension or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hybridcompute.models.MachineExtension] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hybridcompute.models.MachineExtension]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - name=name, - extension_name=extension_name, - extension_parameters=extension_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('MachineExtension', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} - - - def _update_initial( - self, resource_group_name, name, extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'name': self._serialize.url("name", name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(extension_parameters, 'MachineExtensionUpdate') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('MachineExtension', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, name, extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """The operation to create or update the extension. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param name: The name of the machine where the extension should be - created or updated. - :type name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :param extension_parameters: Parameters supplied to the Create Machine - Extension operation. - :type extension_parameters: - ~azure.mgmt.hybridcompute.models.MachineExtensionUpdate - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns MachineExtension or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hybridcompute.models.MachineExtension] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hybridcompute.models.MachineExtension]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - name=name, - extension_name=extension_name, - extension_parameters=extension_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('MachineExtension', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} - - - def _delete_initial( - self, resource_group_name, name, extension_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'name': self._serialize.url("name", name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, name, extension_name, custom_headers=None, raw=False, polling=True, **operation_config): - """The operation to delete the extension. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param name: The name of the machine where the extension should be - deleted. - :type name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - name=name, - extension_name=extension_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} - - def get( - self, resource_group_name, name, extension_name, custom_headers=None, raw=False, **operation_config): - """The operation to get the extension. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param name: The name of the machine containing the extension. - :type name: str - :param extension_name: The name of the machine extension. - :type extension_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: MachineExtension or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.hybridcompute.models.MachineExtension or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'name': self._serialize.url("name", name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('MachineExtension', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} - - def list( - self, resource_group_name, name, expand=None, custom_headers=None, raw=False, **operation_config): - """The operation to get all extensions of a non-Azure machine. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param name: The name of the machine containing the extension. - :type name: str - :param expand: The expand expression to apply on the operation. - :type expand: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of MachineExtension - :rtype: - ~azure.mgmt.hybridcompute.models.MachineExtensionPaged[~azure.mgmt.hybridcompute.models.MachineExtension] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'name': self._serialize.url("name", name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.MachineExtensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions'} diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/_machines_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/_machines_operations.py deleted file mode 100644 index ef687d7c63b..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/_machines_operations.py +++ /dev/null @@ -1,502 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class MachinesOperations(object): - """MachinesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-08-02-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-08-02-preview" - - self.config = config - - def create_or_update( - self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): - """The operation to create or update a hybrid machine resource identity in - Azure. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param name: The name of the hybrid machine. - :type name: str - :param parameters: Parameters supplied to the Create hybrid machine - operation. - :type parameters: ~azure.mgmt.hybridcompute.models.Machine - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Machine or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.hybridcompute.models.Machine or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'name': self._serialize.url("name", name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'Machine') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Machine', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} - - def update( - self, resource_group_name, name, parameters, custom_headers=None, raw=False, **operation_config): - """The operation to update a hybrid machine. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param name: The name of the hybrid machine. - :type name: str - :param parameters: Parameters supplied to the Update hybrid machine - operation. - :type parameters: ~azure.mgmt.hybridcompute.models.MachineUpdate - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Machine or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.hybridcompute.models.Machine or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'name': self._serialize.url("name", name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'MachineUpdate') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Machine', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} - - def delete( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): - """The operation to remove a hybrid machine identity in Azure. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param name: The name of the hybrid machine. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'name': self._serialize.url("name", name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} - - def get( - self, resource_group_name, name, expand=None, custom_headers=None, raw=False, **operation_config): - """Retrieves information about the model view or the instance view of a - hybrid machine. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param name: The name of the hybrid machine. - :type name: str - :param expand: The expand expression to apply on the operation. - Possible values include: 'instanceView' - :type expand: str or - ~azure.mgmt.hybridcompute.models.InstanceViewTypes - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Machine or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.hybridcompute.models.Machine or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'name': self._serialize.url("name", name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'InstanceViewTypes') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Machine', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} - - def reconnect( - self, resource_group_name, name, vm_id=None, client_public_key=None, custom_headers=None, raw=False, **operation_config): - """The operation to reconnect a hybrid machine resource to its identity in - Azure. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param name: The name of the hybrid machine. - :type name: str - :param vm_id: Specifies the hybrid machine unique ID. - :type vm_id: str - :param client_public_key: Public Key that the client provides to be - used during initial resource onboarding. - :type client_public_key: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Machine or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.hybridcompute.models.Machine or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.MachineReconnect(vm_id=vm_id, client_public_key=client_public_key) - - # Construct URL - url = self.reconnect.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'name': self._serialize.url("name", name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'MachineReconnect') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Machine', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - reconnect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/reconnect'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the hybrid machines in the specified resource group. Use the - nextLink property in the response to get the next page of hybrid - machines. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Machine - :rtype: - ~azure.mgmt.hybridcompute.models.MachinePaged[~azure.mgmt.hybridcompute.models.Machine] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.MachinePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines'} - - def list_by_subscription( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the hybrid machines in the specified subscription. Use the - nextLink property in the response to get the next page of hybrid - machines. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Machine - :rtype: - ~azure.mgmt.hybridcompute.models.MachinePaged[~azure.mgmt.hybridcompute.models.Machine] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.MachinePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'} diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/_operations.py deleted file mode 100644 index 89f5bc9d9de..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/operations/_operations.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class Operations(object): - """Operations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-08-02-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-08-02-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets a list of hybrid compute operations. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.hybridcompute.models.OperationValuePaged[~azure.mgmt.hybridcompute.models.OperationValue] - :raises: - :class:`ErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/providers/Microsoft.HybridCompute/operations'} diff --git a/src/connectedmachine/report.md b/src/connectedmachine/report.md new file mode 100644 index 00000000000..4f007b54f3a --- /dev/null +++ b/src/connectedmachine/report.md @@ -0,0 +1,183 @@ +# Azure CLI Module Creation Report + +### connectedmachine machine delete + +delete a connectedmachine machine. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|connectedmachine machine|Machines| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|delete|Delete| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the hybrid machine.|machine_name|name| + +### connectedmachine machine list + +list a connectedmachine machine. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|connectedmachine machine|Machines| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list|ListByResourceGroup| +|list|ListBySubscription| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName| + +### connectedmachine machine show + +show a connectedmachine machine. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|connectedmachine machine|Machines| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|show|Get| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the hybrid machine.|machine_name|name| + +### connectedmachine machine-extension create + +create a connectedmachine machine-extension. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|connectedmachine machine-extension|MachineExtensions| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|create|CreateOrUpdate#Create| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the machine where the extension should be created or updated.|machine_name|name| +|**--name**|string|The name of the machine extension.|name|extensionName| +|**--location**|string|The geo-location where the resource lives|location|location| +|**--tags**|dictionary|Resource tags.|tags|tags| +|**--force-update-tag**|string|How the extension handler should be forced to update even if the extension configuration has not changed.|force_update_tag|forceUpdateTag| +|**--publisher**|string|The name of the extension handler publisher.|publisher|publisher| +|**--type**|string|Specifies the type of the extension; an example is "CustomScriptExtension".|type|type| +|**--type-handler-version**|string|Specifies the version of the script handler.|type_handler_version|typeHandlerVersion| +|**--auto-upgrade-minor-version**|boolean|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.|auto_upgrade_minor_version|autoUpgradeMinorVersion| +|**--settings**|any|Json formatted public settings for the extension.|settings|settings| +|**--protected-settings**|any|The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.|protected_settings|protectedSettings| + +### connectedmachine machine-extension delete + +delete a connectedmachine machine-extension. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|connectedmachine machine-extension|MachineExtensions| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|delete|Delete| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the machine where the extension should be deleted.|machine_name|name| +|**--name**|string|The name of the machine extension.|name|extensionName| + +### connectedmachine machine-extension list + +list a connectedmachine machine-extension. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|connectedmachine machine-extension|MachineExtensions| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|list|List| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the machine containing the extension.|machine_name|name| +|**--expand**|string|The expand expression to apply on the operation.|expand|$expand| + +### connectedmachine machine-extension show + +show a connectedmachine machine-extension. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|connectedmachine machine-extension|MachineExtensions| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|show|Get| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the machine containing the extension.|machine_name|name| +|**--name**|string|The name of the machine extension.|name|extensionName| + +### connectedmachine machine-extension update + +update a connectedmachine machine-extension. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|connectedmachine machine-extension|MachineExtensions| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|update|Update| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the machine where the extension should be created or updated.|machine_name|name| +|**--name**|string|The name of the machine extension.|name|extensionName| +|**--tags**|dictionary|Resource tags|tags|tags| +|**--force-update-tag**|string|How the extension handler should be forced to update even if the extension configuration has not changed.|force_update_tag|forceUpdateTag| +|**--publisher**|string|The name of the extension handler publisher.|publisher|publisher| +|**--type**|string|Specifies the type of the extension; an example is "CustomScriptExtension".|type|type| +|**--type-handler-version**|string|Specifies the version of the script handler.|type_handler_version|typeHandlerVersion| +|**--auto-upgrade-minor-version**|boolean|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.|auto_upgrade_minor_version|autoUpgradeMinorVersion| +|**--settings**|any|Json formatted public settings for the extension.|settings|settings| +|**--protected-settings**|any|The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.|protected_settings|protectedSettings| diff --git a/src/connectedmachine/setup.cfg b/src/connectedmachine/setup.cfg index 3c6e79cf31d..2fdd96e5d39 100644 --- a/src/connectedmachine/setup.cfg +++ b/src/connectedmachine/setup.cfg @@ -1,2 +1 @@ -[bdist_wheel] -universal=1 +#setup.cfg \ No newline at end of file diff --git a/src/connectedmachine/setup.py b/src/connectedmachine/setup.py index c0607c6157b..c6cc3f56f62 100644 --- a/src/connectedmachine/setup.py +++ b/src/connectedmachine/setup.py @@ -8,15 +8,13 @@ from codecs import open from setuptools import setup, find_packages -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") -# TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.1.1' +VERSION = '0.1.0' +try: + from azext_connectedmachine.manual.version import VERSION +except ImportError: + pass # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -25,18 +23,20 @@ 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ] DEPENDENCIES = [] +try: + from .manual.dependency import DEPENDENCIES +except ImportError: + pass -with open('README.rst', 'r', encoding='utf-8') as f: +with open('README.md', 'r', encoding='utf-8') as f: README = f.read() with open('HISTORY.rst', 'r', encoding='utf-8') as f: HISTORY = f.read() @@ -44,12 +44,10 @@ setup( name='connectedmachine', version=VERSION, - description='Microsoft Azure Command-Line Tools Connectedmachine Extension', - # TODO: Update author and email, if applicable + description='Microsoft Azure Command-Line Tools ConnectedMachine Extension', author='Microsoft Corporation', author_email='azpycli@microsoft.com', - # TODO: consider pointing directly to your source code instead of the generic repo - url='https://github.com/Azure/azure-cli-extensions', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/connectedmachine', long_description=README + '\n\n' + HISTORY, license='MIT', classifiers=CLASSIFIERS,