diff --git a/src/connectedmachine/HISTORY.rst b/src/connectedmachine/HISTORY.rst index 5ea5175b1c8..1c139576ba0 100644 --- a/src/connectedmachine/HISTORY.rst +++ b/src/connectedmachine/HISTORY.rst @@ -3,19 +3,6 @@ Release History =============== -0.3.0 -+++++ -* Renamed machine-extension subgroup to extension -* Moved all commands under the machine subgroup to the extension level - -0.2.0 -+++++ -* machineextensions support - -0.1.1 -+++++ -* Remove the limitation of max compatible cli core version - 0.1.0 ++++++ * Initial release. diff --git a/src/connectedmachine/azext_connectedmachine/azext_metadata.json b/src/connectedmachine/azext_connectedmachine/azext_metadata.json index 4f48fa652a5..cfc30c747c7 100644 --- a/src/connectedmachine/azext_connectedmachine/azext_metadata.json +++ b/src/connectedmachine/azext_connectedmachine/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isExperimental": true, - "azext.minCliCoreVersion": "2.11.0" + "azext.minCliCoreVersion": "2.15.0" } \ No newline at end of file diff --git a/src/connectedmachine/azext_connectedmachine/generated/_client_factory.py b/src/connectedmachine/azext_connectedmachine/generated/_client_factory.py index e9940cc3c93..cb6e02b1d6e 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/_client_factory.py +++ b/src/connectedmachine/azext_connectedmachine/generated/_client_factory.py @@ -11,14 +11,26 @@ def cf_connectedmachine_cl(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client - from ..vendored_sdks.connectedmachine import ConnectedMachine + from azext_connectedmachine.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 + return cf_connectedmachine_cl(cli_ctx).machines def cf_machine_extension(cli_ctx, *_): - return cf_connectedmachine_cl(cli_ctx).machine_extension + return cf_connectedmachine_cl(cli_ctx).machine_extensions + + +def cf_private_link_scope(cli_ctx, *_): + return cf_connectedmachine_cl(cli_ctx).private_link_scopes + + +def cf_private_link_resource(cli_ctx, *_): + return cf_connectedmachine_cl(cli_ctx).private_link_resources + + +def cf_private_endpoint_connection(cli_ctx, *_): + return cf_connectedmachine_cl(cli_ctx).private_endpoint_connections diff --git a/src/connectedmachine/azext_connectedmachine/generated/_help.py b/src/connectedmachine/azext_connectedmachine/generated/_help.py index 590d6aae2d9..9b356ef5fb9 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/_help.py +++ b/src/connectedmachine/azext_connectedmachine/generated/_help.py @@ -14,16 +14,21 @@ helps['connectedmachine'] = """ type: group - short-summary: connectedmachine + short-summary: Manage machine with connectedmachine """ helps['connectedmachine list'] = """ type: command - short-summary: "Lists all the hybrid machines in the specified subscription." + short-summary: "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. And Lists all the hybrid machines in the specified subscription. Use \ +the nextLink property in the response to get the next page of hybrid machines." examples: - name: List Machines by resource group text: |- az connectedmachine list --resource-group "myResourceGroup" + - name: List Machines by resource group + text: |- + az connectedmachine list """ helps['connectedmachine show'] = """ @@ -46,14 +51,14 @@ helps['connectedmachine extension'] = """ type: group - short-summary: connectedmachine extension + short-summary: Manage machine extension with connectedmachine """ helps['connectedmachine extension list'] = """ type: command - short-summary: "The operation to get all extensions of a non-Azure machine" + short-summary: "The operation to get all extensions of a non-Azure machine." examples: - - name: Get all Machine Extensions + - name: GET all Machine Extensions text: |- az connectedmachine extension list --machine-name "myMachine" --resource-group "myResourceGroup" """ @@ -62,33 +67,44 @@ type: command short-summary: "The operation to get the extension." examples: - - name: Get Machine Extension + - name: GET Machine Extension text: |- - az connectedmachine extension show --machine-name "myMachine" --name "CustomScriptExtension" \ + az connectedmachine extension show --n "CustomScriptExtension" --machine-name "myMachine" \ --resource-group "myResourceGroup" """ helps['connectedmachine extension create'] = """ type: command - short-summary: "The operation to create or update the extension." + short-summary: "The operation to Create the extension." + parameters: + - name: --status + short-summary: "Instance view status." + long-summary: | + Usage: --status code=XX level=XX display-status=XX message=XX time=XX + + code: The status code. + level: The level code. + display-status: The short localizable label for the status. + message: The detailed status message, including for alerts and error messages. + time: The time of the status. examples: - - name: Create a Machine Extension (PUT) + - name: Create or Update a Machine Extension text: |- - az connectedmachine extension create --machine-name "myMachine" --name "CustomScriptExtension" --location \ -"eastus2euap" --type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings "{\\"commandToExecute\\":\\"pow\ -ershell.exe -c \\\\\\"Get-Process | Where-Object { $_.CPU -gt 10000 }\\\\\\"\\"}" --type-handler-version "1.10" \ ---resource-group "myResourceGroup" + az connectedmachine extension create --n "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" --machine-name \ +"myMachine" --resource-group "myResourceGroup" """ helps['connectedmachine extension update'] = """ type: command - short-summary: "The operation to update the extension." + short-summary: "The operation to create or update the extension." examples: - - name: Update a Machine Extension (PATCH) + - name: Create or Update a Machine Extension text: |- - az connectedmachine 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 \ + az connectedmachine extension update --n "CustomScriptExtension" --type "CustomScriptExtension" \ +--publisher "Microsoft.Compute" --settings "{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | \ +Where-Object { $_.CPU -lt 100 }\\\\\\"\\"}" --type-handler-version "1.10" --machine-name "myMachine" --resource-group \ "myResourceGroup" """ @@ -98,7 +114,7 @@ examples: - name: Delete a Machine Extension text: |- - az connectedmachine extension delete --machine-name "myMachine" --name "MMA" --resource-group \ + az connectedmachine extension delete --n "MMA" --machine-name "myMachine" --resource-group \ "myResourceGroup" """ @@ -108,14 +124,247 @@ examples: - name: Pause executing next line of CLI script until the connectedmachine extension is successfully created. text: |- - az connectedmachine extension wait --machine-name "myMachine" --name "CustomScriptExtension" \ + az connectedmachine extension wait --n "CustomScriptExtension" --machine-name "myMachine" \ --resource-group "myResourceGroup" --created - name: Pause executing next line of CLI script until the connectedmachine extension is successfully updated. text: |- - az connectedmachine extension wait --machine-name "myMachine" --name "CustomScriptExtension" \ + az connectedmachine extension wait --n "CustomScriptExtension" --machine-name "myMachine" \ --resource-group "myResourceGroup" --updated - name: Pause executing next line of CLI script until the connectedmachine extension is successfully deleted. text: |- - az connectedmachine extension wait --machine-name "myMachine" --name "CustomScriptExtension" \ + az connectedmachine extension wait --n "CustomScriptExtension" --machine-name "myMachine" \ --resource-group "myResourceGroup" --deleted """ + +helps['connectedmachine'] = """ + type: group + short-summary: Manage with connectedmachine +""" + +helps['connectedmachine upgrade-extension'] = """ + type: command + short-summary: "The operation to Upgrade Machine Extensions." + examples: + - name: Upgrade Machine Extensions + text: |- + az connectedmachine upgrade-extension --extension-targets "{\\"Microsoft.Azure.Monitoring\\":{\\"targetV\ +ersion\\":\\"2.0\\"},\\"Microsoft.Compute.CustomScriptExtension\\":{\\"targetVersion\\":\\"1.10\\"}}" --machine-name \ +"myMachine" --resource-group "myResourceGroup" +""" + +helps['connectedmachine private-link-scope'] = """ + type: group + short-summary: Manage private link scope with connectedmachine +""" + +helps['connectedmachine private-link-scope list'] = """ + type: command + short-summary: "Gets a list of Azure Arc PrivateLinkScopes within a resource group. And Gets a list of all Azure \ +Arc PrivateLinkScopes within a subscription." + examples: + - name: PrivateLinkScopeListByResourceGroup + text: |- + az connectedmachine private-link-scope list --resource-group "my-resource-group" + - name: PrivateLinkScopesList.json + text: |- + az connectedmachine private-link-scope list +""" + +helps['connectedmachine private-link-scope show'] = """ + type: command + short-summary: "Returns a Azure Arc PrivateLinkScope." + examples: + - name: PrivateLinkScopeGet + text: |- + az connectedmachine private-link-scope show --resource-group "my-resource-group" --scope-name \ +"my-privatelinkscope" +""" + +helps['connectedmachine private-link-scope create'] = """ + type: command + short-summary: "Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for \ +InstrumentationKey nor AppId in the Put operation." + examples: + - name: PrivateLinkScopeCreate + text: |- + az connectedmachine private-link-scope create --location "westus" --resource-group "my-resource-group" \ +--scope-name "my-privatelinkscope" +""" + +helps['connectedmachine private-link-scope update'] = """ + type: command + short-summary: "Update (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for \ +InstrumentationKey nor AppId in the Put operation." + examples: + - name: PrivateLinkScopeUpdate + text: |- + az connectedmachine private-link-scope update --location "westus" --tags Tag1="Value1" --resource-group \ +"my-resource-group" --scope-name "my-privatelinkscope" +""" + +helps['connectedmachine private-link-scope delete'] = """ + type: command + short-summary: "Deletes a Azure Arc PrivateLinkScope." + examples: + - name: PrivateLinkScopesDelete + text: |- + az connectedmachine private-link-scope delete --resource-group "my-resource-group" --scope-name \ +"my-privatelinkscope" +""" + +helps['connectedmachine private-link-scope show-validation-detail'] = """ + type: command + short-summary: "Returns a Azure Arc PrivateLinkScope's validation details." + examples: + - name: PrivateLinkScopeGet + text: |- + az connectedmachine private-link-scope show-validation-detail --location "wus2" --private-link-scope-id \ +"f5dc51d3-92ed-4d7e-947a-775ea79b4919" +""" + +helps['connectedmachine private-link-scope show-validation-detail-for-machine'] = """ + type: command + short-summary: "Returns a Azure Arc PrivateLinkScope's validation details for a given machine." + examples: + - name: PrivateLinkScopeGet + text: |- + az connectedmachine private-link-scope show-validation-detail-for-machine --machine-name "machineName" \ +--resource-group "my-resource-group" +""" + +helps['connectedmachine private-link-scope update-tag'] = """ + type: command + short-summary: "Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate \ +method." + examples: + - name: PrivateLinkScopeUpdateTagsOnly + text: |- + az connectedmachine private-link-scope update-tag --tags Tag1="Value1" Tag2="Value2" --resource-group \ +"my-resource-group" --scope-name "my-privatelinkscope" +""" + +helps['connectedmachine private-link-scope wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the connectedmachine private-link-scope is \ +met. + examples: + - name: Pause executing next line of CLI script until the connectedmachine private-link-scope is successfully \ +deleted. + text: |- + az connectedmachine private-link-scope wait --resource-group "my-resource-group" --scope-name \ +"my-privatelinkscope" --deleted +""" + +helps['connectedmachine private-link-resource'] = """ + type: group + short-summary: Manage private link resource with connectedmachine +""" + +helps['connectedmachine private-link-resource list'] = """ + type: command + short-summary: "Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope." + examples: + - name: Gets private endpoint connection. + text: |- + az connectedmachine private-link-resource list --resource-group "myResourceGroup" --scope-name \ +"myPrivateLinkScope" +""" + +helps['connectedmachine private-link-resource show'] = """ + type: command + short-summary: "Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope." + examples: + - name: Gets private endpoint connection. + text: |- + az connectedmachine private-link-resource show --group-name "hybridcompute" --resource-group \ +"myResourceGroup" --scope-name "myPrivateLinkScope" +""" + +helps['connectedmachine private-endpoint-connection'] = """ + type: group + short-summary: Manage private endpoint connection with connectedmachine +""" + +helps['connectedmachine private-endpoint-connection list'] = """ + type: command + short-summary: "Gets all private endpoint connections on a private link scope." + examples: + - name: Gets list of private endpoint connections on a private link scope. + text: |- + az connectedmachine private-endpoint-connection list --resource-group "myResourceGroup" --scope-name \ +"myPrivateLinkScope" +""" + +helps['connectedmachine private-endpoint-connection show'] = """ + type: command + short-summary: "Gets a private endpoint connection." + examples: + - name: Gets private endpoint connection. + text: |- + az connectedmachine private-endpoint-connection show --name "private-endpoint-connection-name" \ +--resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" +""" + +helps['connectedmachine private-endpoint-connection create'] = """ + type: command + short-summary: "Approve or reject a private endpoint connection with a given name." + parameters: + - name: --private-link-service-connection-state + short-summary: "Connection state of the private endpoint connection." + long-summary: | + Usage: --private-link-service-connection-state status=XX description=XX + + status: Required. The private link service connection status. + description: Required. The private link service connection description. + examples: + - name: Approve or reject a private endpoint connection with a given name. + text: |- + az connectedmachine private-endpoint-connection create --private-link-service-connection-state \ +description="Approved by johndoe@contoso.com" status="Approved" --name "private-endpoint-connection-name" \ +--resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" +""" + +helps['connectedmachine private-endpoint-connection update'] = """ + type: command + short-summary: "Approve or reject a private endpoint connection with a given name." + parameters: + - name: --private-link-service-connection-state + short-summary: "Connection state of the private endpoint connection." + long-summary: | + Usage: --private-link-service-connection-state status=XX description=XX + + status: Required. The private link service connection status. + description: Required. The private link service connection description. +""" + +helps['connectedmachine private-endpoint-connection delete'] = """ + type: command + short-summary: "Deletes a private endpoint connection with a given name." + examples: + - name: Deletes a private endpoint connection with a given name. + text: |- + az connectedmachine private-endpoint-connection delete --name "private-endpoint-connection-name" \ +--resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" +""" + +helps['connectedmachine private-endpoint-connection wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the connectedmachine \ +private-endpoint-connection is met. + examples: + - name: Pause executing next line of CLI script until the connectedmachine private-endpoint-connection is \ +successfully created. + text: |- + az connectedmachine private-endpoint-connection wait --name "private-endpoint-connection-name" \ +--resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" --created + - name: Pause executing next line of CLI script until the connectedmachine private-endpoint-connection is \ +successfully updated. + text: |- + az connectedmachine private-endpoint-connection wait --name "private-endpoint-connection-name" \ +--resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" --updated + - name: Pause executing next line of CLI script until the connectedmachine private-endpoint-connection is \ +successfully deleted. + text: |- + az connectedmachine private-endpoint-connection wait --name "private-endpoint-connection-name" \ +--resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" --deleted +""" diff --git a/src/connectedmachine/azext_connectedmachine/generated/_params.py b/src/connectedmachine/azext_connectedmachine/generated/_params.py index 98c10acf5eb..b507ed787bc 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/_params.py +++ b/src/connectedmachine/azext_connectedmachine/generated/_params.py @@ -13,6 +13,7 @@ from azure.cli.core.commands.parameters import ( tags_type, get_three_state_flag, + get_enum_type, resource_group_name_type, get_location_type ) @@ -20,6 +21,10 @@ get_default_location_from_resource_group, validate_file_or_dict ) +from azext_connectedmachine.action import ( + AddStatus, + AddPrivateLinkServiceConnectionState +) def load_arguments(self, _): @@ -55,7 +60,7 @@ def load_arguments(self, _): c.argument('name', options_list=['-n', '--extension-name', '--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), + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, validator=get_default_location_from_resource_group) c.argument('force_update_tag', type=str, help='How the extension handler should be forced to update even if ' 'the extension configuration has not changed.') @@ -72,6 +77,13 @@ def load_arguments(self, _): 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.') + c.argument('properties_instance_view_name', type=str, help='The machine extension name.', arg_group='Instance ' + 'View') + c.argument('machine_extension_instance_view_type', type=str, help='Specifies the type of the extension; an ' + 'example is "CustomScriptExtension".', arg_group='Instance View') + c.argument('machine_extension_instance_view_type_handler_version_type_handler_version', type=str, + help='Specifies the version of the script handler.', arg_group='Instance View') + c.argument('status', action=AddStatus, nargs='+', help='Instance view status.', arg_group='Instance View') with self.argument_context('connectedmachine extension update') as c: c.argument('resource_group_name', resource_group_name_type) @@ -108,3 +120,125 @@ def load_arguments(self, _): c.argument('machine_name', type=str, help='The name of the machine containing the extension.', id_part='name') c.argument('name', options_list=['-n', '--extension-name', '--name'], type=str, help='The name of the machine ' 'extension.', id_part='child_name_1') + + with self.argument_context('connectedmachine upgrade-extension') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('machine_name', type=str, help='The name of the hybrid machine.', id_part='name') + c.argument('extension_targets', type=validate_file_or_dict, help='Describes the Extension Target Properties. ' + 'Expected value: json-string/@json-file.') + + with self.argument_context('connectedmachine private-link-scope list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('connectedmachine private-link-scope show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + id_part='name') + + with self.argument_context('connectedmachine private-link-scope create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('public_network_access', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Indicates whether ' + 'machines associated with the private link scope can also use public Azure Arc service endpoints.') + + with self.argument_context('connectedmachine private-link-scope update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + id_part='name') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('public_network_access', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Indicates whether ' + 'machines associated with the private link scope can also use public Azure Arc service endpoints.') + c.ignore('parameters') + + with self.argument_context('connectedmachine private-link-scope delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + id_part='name') + + with self.argument_context('connectedmachine private-link-scope show-validation-detail') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), id_part='name') + c.argument('private_link_scope_id', type=str, help='The id (Guid) of the Azure Arc PrivateLinkScope resource.', + id_part='child_name_1') + + with self.argument_context('connectedmachine private-link-scope show-validation-detail-for-machine') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('machine_name', type=str, help='The name of the target machine to get the private link scope ' + 'validation details for.', id_part='name') + + with self.argument_context('connectedmachine private-link-scope update-tag') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + id_part='name') + c.argument('tags', tags_type) + + with self.argument_context('connectedmachine private-link-scope wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + id_part='name') + + with self.argument_context('connectedmachine private-link-resource list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.') + + with self.argument_context('connectedmachine private-link-resource show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + id_part='name') + c.argument('group_name', type=str, help='The name of the private link resource.', id_part='child_name_1') + + with self.argument_context('connectedmachine private-endpoint-connection list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.') + + with self.argument_context('connectedmachine private-endpoint-connection show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + id_part='name') + c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' + 'e'], type=str, help='The name of the private ' + 'endpoint connection.', id_part='child_name_1') + + with self.argument_context('connectedmachine private-endpoint-connection create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.') + c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' + 'e'], type=str, help='The name of the private ' + 'endpoint connection.') + c.argument('private_link_service_connection_state', action=AddPrivateLinkServiceConnectionState, nargs='+', + help='Connection state of the private endpoint connection.') + c.argument('id_', options_list=['--id'], type=str, help='Resource id of the private endpoint.', + arg_group='Private Endpoint') + + with self.argument_context('connectedmachine private-endpoint-connection update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + id_part='name') + c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' + 'e'], type=str, help='The name of the private ' + 'endpoint connection.', id_part='child_name_1') + c.argument('private_link_service_connection_state', action=AddPrivateLinkServiceConnectionState, nargs='+', + help='Connection state of the private endpoint connection.') + c.argument('id_', options_list=['--id'], type=str, help='Resource id of the private endpoint.', + arg_group='Private Endpoint') + c.ignore('parameters') + + with self.argument_context('connectedmachine private-endpoint-connection delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + id_part='name') + c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' + 'e'], type=str, help='The name of the private ' + 'endpoint connection.', id_part='child_name_1') + + with self.argument_context('connectedmachine private-endpoint-connection wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope_name', type=str, help='The name of the Azure Arc PrivateLinkScope resource.', + id_part='name') + c.argument('private_endpoint_connection_name', options_list=['--name', '-n', '--private-endpoint-connection-nam' + 'e'], type=str, help='The name of the private ' + 'endpoint connection.', id_part='child_name_1') diff --git a/src/connectedmachine/azext_connectedmachine/generated/action.py b/src/connectedmachine/azext_connectedmachine/generated/action.py index b49bfaeeefe..221bb63a62b 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/action.py +++ b/src/connectedmachine/azext_connectedmachine/generated/action.py @@ -8,3 +8,67 @@ # regenerated. # -------------------------------------------------------------------------- # pylint: disable=protected-access + +import argparse +from collections import defaultdict +from knack.util import CLIError + + +class AddStatus(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.status = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'code': + d['code'] = v[0] + elif kl == 'level': + d['level'] = v[0] + elif kl == 'display-status': + d['display_status'] = v[0] + elif kl == 'message': + d['message'] = v[0] + elif kl == 'time': + d['time'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter status. All possible keys are: code, ' + 'level, display-status, message, time'.format(k)) + return d + + +class AddPrivateLinkServiceConnectionState(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.private_link_service_connection_state = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'status': + d['status'] = v[0] + elif kl == 'description': + d['description'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter private_link_service_connection_state. ' + 'All possible keys are: status, description'.format(k)) + return d diff --git a/src/connectedmachine/azext_connectedmachine/generated/commands.py b/src/connectedmachine/azext_connectedmachine/generated/commands.py index 12d8b3956d7..c64c82e5deb 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/commands.py +++ b/src/connectedmachine/azext_connectedmachine/generated/commands.py @@ -17,24 +17,81 @@ 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.{}', + operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._machines_operations#Machines' + 'Operations.{}', client_factory=cf_machine) - with self.command_group('connectedmachine', connectedmachine_machine, client_factory=cf_machine) as g: + with self.command_group('connectedmachine', connectedmachine_machine, client_factory=cf_machine, + is_experimental=True) as g: g.custom_command('list', 'connectedmachine_list') g.custom_show_command('show', 'connectedmachine_show') g.custom_command('delete', 'connectedmachine_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.{}', + operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._machine_extensions_operation' + 's#MachineExtensionsOperations.{}', client_factory=cf_machine_extension) with self.command_group('connectedmachine extension', connectedmachine_machine_extension, - client_factory=cf_machine_extension, is_experimental=True) as g: + client_factory=cf_machine_extension) as g: g.custom_command('list', 'connectedmachine_extension_list') g.custom_show_command('show', 'connectedmachine_extension_show') g.custom_command('create', 'connectedmachine_extension_create', supports_no_wait=True) g.custom_command('update', 'connectedmachine_extension_update', supports_no_wait=True) g.custom_command('delete', 'connectedmachine_extension_delete', supports_no_wait=True, confirmation=True) g.custom_wait_command('wait', 'connectedmachine_extension_show') + + from azext_connectedmachine.generated._client_factory import cf_connectedmachine + connectedmachine_ = CliCommandType( + operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._model_operations#ConnectedMa' + 'chineOperationsMixin.{}', + client_factory=cf_connectedmachine) + with self.command_group('connectedmachine', connectedmachine_, client_factory=cf_connectedmachine, + is_experimental=True) as g: + g.custom_command('upgrade-extension', 'connectedmachine_upgrade_extension') + + from azext_connectedmachine.generated._client_factory import cf_private_link_scope + connectedmachine_private_link_scope = CliCommandType( + operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._private_link_scopes_operatio' + 'ns#PrivateLinkScopesOperations.{}', + client_factory=cf_private_link_scope) + with self.command_group('connectedmachine private-link-scope', connectedmachine_private_link_scope, + client_factory=cf_private_link_scope) as g: + g.custom_command('list', 'connectedmachine_private_link_scope_list') + g.custom_show_command('show', 'connectedmachine_private_link_scope_show') + g.custom_command('create', 'connectedmachine_private_link_scope_create') + g.generic_update_command('update', custom_func_name='connectedmachine_private_link_scope_update') + g.custom_command('delete', 'connectedmachine_private_link_scope_delete', supports_no_wait=True, + confirmation=True) + g.custom_command('show-validation-detail', 'connectedmachine_private_link_scope_show_validation_detail') + g.custom_command('show-validation-detail-for-machine', 'connectedmachine_private_link_scope_show_validation_det' + 'ail_for_machine') + g.custom_command('update-tag', 'connectedmachine_private_link_scope_update_tag') + g.custom_wait_command('wait', 'connectedmachine_private_link_scope_show') + + from azext_connectedmachine.generated._client_factory import cf_private_link_resource + connectedmachine_private_link_resource = CliCommandType( + operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._private_link_resources_opera' + 'tions#PrivateLinkResourcesOperations.{}', + client_factory=cf_private_link_resource) + with self.command_group('connectedmachine private-link-resource', connectedmachine_private_link_resource, + client_factory=cf_private_link_resource) as g: + g.custom_command('list', 'connectedmachine_private_link_resource_list') + g.custom_show_command('show', 'connectedmachine_private_link_resource_show') + + from azext_connectedmachine.generated._client_factory import cf_private_endpoint_connection + connectedmachine_private_endpoint_connection = CliCommandType( + operations_tmpl='azext_connectedmachine.vendored_sdks.connectedmachine.operations._private_endpoint_connections' + '_operations#PrivateEndpointConnectionsOperations.{}', + client_factory=cf_private_endpoint_connection) + with self.command_group('connectedmachine private-endpoint-connection', + connectedmachine_private_endpoint_connection, + client_factory=cf_private_endpoint_connection) as g: + g.custom_command('list', 'connectedmachine_private_endpoint_connection_list') + g.custom_show_command('show', 'connectedmachine_private_endpoint_connection_show') + g.custom_command('create', 'connectedmachine_private_endpoint_connection_create', supports_no_wait=True) + g.generic_update_command('update', setter_name='begin_create_or_update', + custom_func_name='connectedmachine_private_endpoint_connection_update', + supports_no_wait=True) + g.custom_command('delete', 'connectedmachine_private_endpoint_connection_delete', supports_no_wait=True, + confirmation=True) + g.custom_wait_command('wait', 'connectedmachine_private_endpoint_connection_show') diff --git a/src/connectedmachine/azext_connectedmachine/generated/custom.py b/src/connectedmachine/azext_connectedmachine/generated/custom.py index d388253eeb9..0aa531eb37b 100644 --- a/src/connectedmachine/azext_connectedmachine/generated/custom.py +++ b/src/connectedmachine/azext_connectedmachine/generated/custom.py @@ -7,7 +7,9 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- +# pylint: disable=line-too-long # pylint: disable=too-many-lines +# pylint: disable=unused-argument from azure.cli.core.util import sdk_no_wait @@ -23,7 +25,7 @@ def connectedmachine_show(client, resource_group_name, machine_name): return client.get(resource_group_name=resource_group_name, - name=machine_name, + machine_name=machine_name, expand="instanceView") @@ -31,7 +33,7 @@ def connectedmachine_delete(client, resource_group_name, machine_name): return client.delete(resource_group_name=resource_group_name, - name=machine_name) + machine_name=machine_name) def connectedmachine_extension_list(client, @@ -39,7 +41,7 @@ def connectedmachine_extension_list(client, machine_name, expand=None): return client.list(resource_group_name=resource_group_name, - name=machine_name, + machine_name=machine_name, expand=expand) @@ -48,7 +50,7 @@ def connectedmachine_extension_show(client, machine_name, name): return client.get(resource_group_name=resource_group_name, - name=machine_name, + machine_name=machine_name, extension_name=name) @@ -57,6 +59,7 @@ def connectedmachine_extension_create(client, machine_name, name, location, + properties_instance_view_name, tags=None, force_update_tag=None, publisher=None, @@ -65,22 +68,34 @@ def connectedmachine_extension_create(client, auto_upgrade_minor_version=None, settings=None, protected_settings=None, + machine_extension_instance_view_type=None, + machine_extension_instance_view_type_handler_version_type_handler_version=None, + status=None, no_wait=False): + extension_parameters = {} + extension_parameters['tags'] = tags + extension_parameters['location'] = location + extension_parameters['properties'] = {} + extension_parameters['properties']['force_update_tag'] = force_update_tag + extension_parameters['properties']['publisher'] = publisher + extension_parameters['properties']['type'] = type_ + extension_parameters['properties']['type_handler_version'] = type_handler_version + extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor_version + extension_parameters['properties']['settings'] = settings + extension_parameters['properties']['protected_settings'] = protected_settings + extension_parameters['properties']['instance_view'] = {} + extension_parameters['properties']['instance_view']['name'] = properties_instance_view_name + extension_parameters['properties']['instance_view']['properties'] = {} + extension_parameters['properties']['instance_view']['properties']['type'] = machine_extension_instance_view_type + extension_parameters['properties']['instance_view']['properties']['type_handler_version'] = machine_extension_instance_view_type_handler_version_type_handler_version + extension_parameters['properties']['instance_view']['properties']['instance_view'] = {} + extension_parameters['properties']['instance_view']['properties']['instance_view']['status'] = status return sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name=resource_group_name, - name=machine_name, + machine_name=machine_name, extension_name=name, - tags=tags, - location=location, - force_update_tag=force_update_tag, - publisher=publisher, - type_properties_type=type_, - type_handler_version=type_handler_version, - auto_upgrade_minor_version=auto_upgrade_minor_version, - settings=settings, - protected_settings=protected_settings, - status=None) + extension_parameters=extension_parameters) def connectedmachine_extension_update(client, @@ -96,19 +111,22 @@ def connectedmachine_extension_update(client, settings=None, protected_settings=None, no_wait=False): + extension_parameters = {} + extension_parameters['tags'] = tags + extension_parameters['properties'] = {} + extension_parameters['properties']['force_update_tag'] = force_update_tag + extension_parameters['properties']['publisher'] = publisher + extension_parameters['properties']['type'] = type_ + extension_parameters['properties']['type_handler_version'] = type_handler_version + extension_parameters['properties']['auto_upgrade_minor_version'] = auto_upgrade_minor_version + extension_parameters['properties']['settings'] = settings + extension_parameters['properties']['protected_settings'] = protected_settings return sdk_no_wait(no_wait, client.begin_update, resource_group_name=resource_group_name, - name=machine_name, + machine_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) + extension_parameters=extension_parameters) def connectedmachine_extension_delete(client, @@ -119,5 +137,177 @@ def connectedmachine_extension_delete(client, return sdk_no_wait(no_wait, client.begin_delete, resource_group_name=resource_group_name, - name=machine_name, + machine_name=machine_name, extension_name=name) + + +def connectedmachine_upgrade_extension(client, + resource_group_name, + machine_name, + extension_targets=None): + extension_upgrade_parameters = {} + extension_upgrade_parameters['extension_targets'] = extension_targets + return client.begin_upgrade_extensions(resource_group_name=resource_group_name, + machine_name=machine_name, + extension_upgrade_parameters=extension_upgrade_parameters) + + +def connectedmachine_private_link_scope_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list() + + +def connectedmachine_private_link_scope_show(client, + resource_group_name, + scope_name): + return client.get(resource_group_name=resource_group_name, + scope_name=scope_name) + + +def connectedmachine_private_link_scope_create(client, + resource_group_name, + scope_name, + location, + tags=None, + public_network_access=None): + if public_network_access is None: + public_network_access = "Disabled" + parameters = {} + parameters['location'] = location + parameters['tags'] = tags + parameters['properties'] = {} + parameters['properties']['public_network_access'] = "Disabled" if public_network_access is None else public_network_access + return client.create_or_update(resource_group_name=resource_group_name, + scope_name=scope_name, + parameters=parameters) + + +def connectedmachine_private_link_scope_update(instance, + resource_group_name, + scope_name, + location, + tags=None, + public_network_access=None): + if public_network_access is None: + public_network_access = "Disabled" + if location is not None: + instance.location = location + if tags is not None: + instance.tags = tags + if "Disabled" is not None:, instance.properties.public_network_access = "Disabled" if public_network_access is None else public_network_access + return instance + + +def connectedmachine_private_link_scope_delete(client, + resource_group_name, + scope_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + scope_name=scope_name) + + +def connectedmachine_private_link_scope_show_validation_detail(client, + location, + private_link_scope_id): + return client.get_validation_details(location=location, + private_link_scope_id=private_link_scope_id) + + +def connectedmachine_private_link_scope_show_validation_detail_for_machine(client, + resource_group_name, + machine_name): + return client.get_validation_details_for_machine(resource_group_name=resource_group_name, + machine_name=machine_name) + + +def connectedmachine_private_link_scope_update_tag(client, + resource_group_name, + scope_name, + tags=None): + private_link_scope_tags = {} + private_link_scope_tags['tags'] = tags + return client.update_tags(resource_group_name=resource_group_name, + scope_name=scope_name, + private_link_scope_tags=private_link_scope_tags) + + +def connectedmachine_private_link_resource_list(client, + resource_group_name, + scope_name): + return client.list_by_private_link_scope(resource_group_name=resource_group_name, + scope_name=scope_name) + + +def connectedmachine_private_link_resource_show(client, + resource_group_name, + scope_name, + group_name): + return client.get(resource_group_name=resource_group_name, + scope_name=scope_name, + group_name=group_name) + + +def connectedmachine_private_endpoint_connection_list(client, + resource_group_name, + scope_name): + return client.list_by_private_link_scope(resource_group_name=resource_group_name, + scope_name=scope_name) + + +def connectedmachine_private_endpoint_connection_show(client, + resource_group_name, + scope_name, + private_endpoint_connection_name): + return client.get(resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name) + + +def connectedmachine_private_endpoint_connection_create(client, + resource_group_name, + scope_name, + private_endpoint_connection_name, + private_link_service_connection_state=None, + id_=None, + no_wait=False): + parameters = {} + parameters['properties'] = {} + parameters['properties']['private_link_service_connection_state'] = private_link_service_connection_state + parameters['properties']['private_endpoint'] = {} + parameters['properties']['private_endpoint']['id'] = id_ + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + parameters=parameters) + + +def connectedmachine_private_endpoint_connection_update(instance, + resource_group_name, + scope_name, + private_endpoint_connection_name, + private_link_service_connection_state=None, + id_=None, + no_wait=False): + if private_link_service_connection_state is not None: + instance.properties.private_link_service_connection_state = private_link_service_connection_state + if id_ is not None: + instance.properties.private_endpoint.id = id_ + return instance + + +def connectedmachine_private_endpoint_connection_delete(client, + resource_group_name, + scope_name, + private_endpoint_connection_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name) diff --git a/src/connectedmachine/azext_connectedmachine/tests/__init__.py b/src/connectedmachine/azext_connectedmachine/tests/__init__.py index 50e0627daff..70488e93851 100644 --- a/src/connectedmachine/azext_connectedmachine/tests/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/tests/__init__.py @@ -31,8 +31,8 @@ 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] + decorated_path = inspect.getfile(origin_func).lower() + module_path = __path__[0].lower() if not decorated_path.startswith(module_path): raise Exception("Decorator can only be used in submodules!") manual_path = os.path.join( @@ -46,7 +46,6 @@ def import_manual_function(origin_func): 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): @@ -66,6 +65,9 @@ def wrapper(*args, **kwargs): ret = func_to_call(*args, **kwargs) except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, JMESPathCheckAssertionError) as e: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise 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] diff --git a/src/connectedmachine/azext_connectedmachine/tests/latest/example_steps.py b/src/connectedmachine/azext_connectedmachine/tests/latest/example_steps.py new file mode 100644 index 00000000000..1f46c9d28b9 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/example_steps.py @@ -0,0 +1,270 @@ +# -------------------------------------------------------------------------- +# 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 .. import try_manual + + +# EXAMPLE: /Machines/get/Get Machine +@try_manual +def step_show(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine show ' + '--name "{myMachine}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Machines/get/List Machines by resource group +@try_manual +def step_list(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /connectedmachine/post/Upgrade Machine Extensions +@try_manual +def step_upgrade_extension(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine upgrade-extension ' + '--extension-targets "{{\\"Microsoft.Azure.Monitoring\\":{{\\"targetVersion\\":\\"2.0\\"}},\\"Microsoft.Co' + 'mpute.CustomScriptExtension\\":{{\\"targetVersion\\":\\"1.10\\"}}}}" ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /MachineExtensions/put/Create or Update a Machine Extension +@try_manual +def step_extension_create(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine extension create ' + '--n "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" ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /MachineExtensions/get/GET all Machine Extensions +@try_manual +def step_extension_list(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine extension list ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /MachineExtensions/get/GET Machine Extension +@try_manual +def step_extension_show(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine extension show ' + '--n "CustomScriptExtension" ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /MachineExtensions/patch/Create or Update a Machine Extension +@try_manual +def step_extension_update(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine extension update ' + '--n "CustomScriptExtension" ' + '--type "CustomScriptExtension" ' + '--publisher "Microsoft.Compute" ' + '--settings "{{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object {{{{ $_.CPU ' + '-lt 100 }}}}\\\\\\"\\"}}" ' + '--type-handler-version "1.10" ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /MachineExtensions/delete/Delete a Machine Extension +@try_manual +def step_extension_delete(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine extension delete -y ' + '--n "MMA" ' + '--machine-name "{myMachine}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Machines/delete/Delete a Machine +@try_manual +def step_delete(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine delete -y ' + '--name "{myMachine}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnections/put/Approve or reject a private endpoint connection with a given name. +@try_manual +def step_private_endpoint_connection_create(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-endpoint-connection create ' + '--private-link-service-connection-state description="Approved by johndoe@contoso.com" status="Approved" ' + '--name "{myPrivateEndpointConnection}" ' + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', + checks=[]) + test.cmd('az connectedmachine private-endpoint-connection wait --created ' + '--name "{myPrivateEndpointConnection}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnections/get/Gets list of private endpoint connections on a private link scope. +@try_manual +def step_private_endpoint_connection_list(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-endpoint-connection list ' + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnections/get/Gets private endpoint connection. +@try_manual +def step_private_endpoint_connection_show(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-endpoint-connection show ' + '--name "{myPrivateEndpointConnection}" ' + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', + checks=checks) + + +# EXAMPLE: /PrivateEndpointConnections/delete/Deletes a private endpoint connection with a given name. +@try_manual +def step_private_endpoint_connection_delete(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-endpoint-connection delete -y ' + '--name "{myPrivateEndpointConnection}" ' + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', + checks=checks) + + +# EXAMPLE: /PrivateLinkResources/get/Gets private endpoint connection. +@try_manual +def step_private_link_resource_list(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-link-resource list ' + '--resource-group "{rg}" ' + '--scope-name "myPrivateLinkScope"', + checks=checks) + + +# EXAMPLE: /PrivateLinkScopes/put/PrivateLinkScopeCreate +@try_manual +def step_private_link_scope_create(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-link-scope create ' + '--location "westus" ' + '--resource-group "{rg_2}" ' + '--scope-name "my-privatelinkscope"', + checks=checks) + + +# EXAMPLE: /PrivateLinkScopes/put/PrivateLinkScopeUpdate +@try_manual +def step_private_link_scope_update(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-link-scope update ' + '--location "westus" ' + '--tags Tag1="Value1" ' + '--resource-group "{rg_2}" ' + '--scope-name "my-privatelinkscope"', + checks=checks) + + +# EXAMPLE: /PrivateLinkScopes/get/PrivateLinkScopeGet +@try_manual +def step_private_link_scope_show(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-link-scope show ' + '--resource-group "{rg_2}" ' + '--scope-name "my-privatelinkscope"', + checks=checks) + + +# EXAMPLE: /PrivateLinkScopes/get/PrivateLinkScopeListByResourceGroup +@try_manual +def step_private_link_scope_list(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-link-scope list ' + '--resource-group "{rg_2}"', + checks=checks) + + +# EXAMPLE: /PrivateLinkScopes/get/PrivateLinkScopesList.json +@try_manual +def step_private_link_scope_list2(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-link-scope list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /PrivateLinkScopes/patch/PrivateLinkScopeUpdateTagsOnly +@try_manual +def step_private_link_scope_update_tag(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-link-scope update-tag ' + '--tags Tag1="Value1" Tag2="Value2" ' + '--resource-group "{rg_2}" ' + '--scope-name "my-privatelinkscope"', + checks=checks) + + +# EXAMPLE: /PrivateLinkScopes/delete/PrivateLinkScopesDelete +@try_manual +def step_private_link_scope_delete(test, rg, rg_2, checks=None): + if checks is None: + checks = [] + test.cmd('az connectedmachine private-link-scope delete -y ' + '--resource-group "{rg_2}" ' + '--scope-name "my-privatelinkscope"', + checks=checks) + 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 26549a387cd..499de1a9e58 100644 --- a/src/connectedmachine/azext_connectedmachine/tests/latest/test_connectedmachine_scenario.py +++ b/src/connectedmachine/azext_connectedmachine/tests/latest/test_connectedmachine_scenario.py @@ -10,212 +10,106 @@ import os from azure.cli.testsdk import ScenarioTest -from .. import try_manual, raise_if, calc_coverage from azure.cli.testsdk import ResourceGroupPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from .example_steps import step_show +from .example_steps import step_list +from .example_steps import step_upgrade_extension +from .example_steps import step_extension_create +from .example_steps import step_extension_list +from .example_steps import step_extension_show +from .example_steps import step_extension_update +from .example_steps import step_extension_delete +from .example_steps import step_delete +from .example_steps import step_private_endpoint_connection_create +from .example_steps import step_private_endpoint_connection_list +from .example_steps import step_private_endpoint_connection_show +from .example_steps import step_private_endpoint_connection_delete +from .example_steps import step_private_link_resource_list +from .example_steps import step_private_link_scope_create +from .example_steps import step_private_link_scope_update +from .example_steps import step_private_link_scope_show +from .example_steps import step_private_link_scope_list +from .example_steps import step_private_link_scope_list2 +from .example_steps import step_private_link_scope_update_tag +from .example_steps import step_private_link_scope_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) -TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) -CUSTOM_SCRIPT_EXTENSION_NAME = 'customScript' -DEPENDENCY_AGENT_EXTENSION_NAME = 'dependencyAgent' - -# Constants for Machine tests -MACHINES_RESOURCE_GROUP_NAME = 'AzcmagentTest' -MACHINES_MACHINE_NAME = 'dorothy-Virtual-Machine' -MACHINES_LOCATION = 'eastus2euap' - -# Constants for Machine Extension tests -EXTENSIONS_RESOURCE_GROUP_NAME = 'AzcmagentTest' -EXTENSIONS_MACHINE_NAME = 'dorothy-Virtual-Machine' -EXTENSIONS_LOCATION = 'eastus2euap' - -@try_manual -def setup(test): - # This machine needs to already exist - test.cmd('az connectedmachine show ' - f'--name "{EXTENSIONS_MACHINE_NAME}" ' - f'--resource-group "{EXTENSIONS_RESOURCE_GROUP_NAME}"', - checks=[ - test.check('name', EXTENSIONS_MACHINE_NAME), - test.check('location', EXTENSIONS_LOCATION) - ]) +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) +# Env setup_scenario @try_manual -def cleanup(test): +def setup_scenario(test, rg, rg_2): pass -# Machine tests - - -# EXAMPLE: /Machines/get/Get Machine -@try_manual -def step__machines_get_get_machine(test): - test.cmd('az connectedmachine show ' - f'--name "{MACHINES_MACHINE_NAME}" ' - f'--resource-group "{MACHINES_RESOURCE_GROUP_NAME}"', - checks=[ - test.check('name', MACHINES_MACHINE_NAME), - test.check('location', MACHINES_LOCATION) - ]) - - -# EXAMPLE: /Machines/get/List Machines by resource group +# Env cleanup_scenario @try_manual -def step__machines_get_list_machines_by_resource_group(test): - test.cmd('az connectedmachine list ' - f'--resource-group "{MACHINES_RESOURCE_GROUP_NAME}"', - checks=[ - test.greater_than('length(@)', 400) - ]) - - -# EXAMPLE: /Machines/delete/Delete a Machine -@try_manual -def step__machines_delete_delete_a_machine(test): - list = test.cmd('az connectedmachine list ' - f'--resource-group "{MACHINES_RESOURCE_GROUP_NAME}"', - checks=[ - test.greater_than('length(@)', 400) - ]).get_output_in_json() - - nameToDelete = next(machine['name'] for machine in list if machine['name'] != MACHINES_MACHINE_NAME) - test.cmd('az connectedmachine delete -y ' - f'--name "{nameToDelete}" ' - f'--resource-group "{MACHINES_RESOURCE_GROUP_NAME}"', - checks=[]) - - -# Machine Extension tests - - -# EXAMPLE: /MachineExtensions/put/Create or Update a Machine Extension -@try_manual -def step__machineextensions_put(test): - test.cmd('az connectedmachine extension create ' - f'--machine-name "{EXTENSIONS_MACHINE_NAME}" ' - f'--name "{DEPENDENCY_AGENT_EXTENSION_NAME}" ' - f'--location "{EXTENSIONS_LOCATION}" ' - '--type "DependencyAgentLinux" ' - '--publisher "Microsoft.Azure.Monitoring.DependencyAgent" ' - f'--resource-group "{EXTENSIONS_RESOURCE_GROUP_NAME}"', - checks=[ - test.check('name', DEPENDENCY_AGENT_EXTENSION_NAME) - ]) - - -# EXAMPLE: /MachineExtensions/patch/Create or Update a Machine Extension -@try_manual -def step__machineextensions_patch(test): - # Create an extension to update - # test.cmd('az connectedmachine extension create ' - # f'--machine-name "{EXTENSIONS_MACHINE_NAME}" ' - # f'--name "{CUSTOM_SCRIPT_EXTENSION_NAME}" ' - # f'--location "{EXTENSIONS_LOCATION}" ' - # '--type "CustomScript" ' - # '--publisher "Microsoft.Azure.Extensions" ' - # r"""--settings '{{"commandToExecute":"ls"}}' """ - # '--type-handler-version "2.1" ' - # f'--resource-group "{EXTENSIONS_RESOURCE_GROUP_NAME}"', - # checks=[ - # test.check('name', CUSTOM_SCRIPT_EXTENSION_NAME), - # test.check('provisioningState', 'Succeeded'), - # test.check('settings.commandToExecute', 'ls') - # ]) - - # update the extension - test.cmd('az connectedmachine extension update ' - f'--machine-name "{EXTENSIONS_MACHINE_NAME}" ' - f'--name "{CUSTOM_SCRIPT_EXTENSION_NAME}" ' - r"""--settings '{{"commandToExecute":"ls -a"}}' """ - f'--resource-group "{EXTENSIONS_RESOURCE_GROUP_NAME}"', - checks=[ - test.check('name', CUSTOM_SCRIPT_EXTENSION_NAME), - test.check('provisioningState', 'Succeeded'), - test.check('settings.commandToExecute', 'ls -a') - ]) - - -# EXAMPLE: /MachineExtensions/get/GET Machine Extension -@try_manual -def step__machineextensions_get_get_machine_extension(test): - print('this happened') - test.cmd('az connectedmachine extension show ' - f'--machine-name "{EXTENSIONS_MACHINE_NAME}" ' - f'--name "{CUSTOM_SCRIPT_EXTENSION_NAME}" ' - f'--resource-group "{EXTENSIONS_RESOURCE_GROUP_NAME}"', - checks=[ - test.check('name', CUSTOM_SCRIPT_EXTENSION_NAME), - test.check('provisioningState', 'Succeeded') - ]) - - -# EXAMPLE: /MachineExtensions/get/GET all Machine Extensions -@try_manual -def step__machineextensions_get(test): - test.cmd('az connectedmachine extension list ' - f'--machine-name "{EXTENSIONS_MACHINE_NAME}" ' - f'--resource-group "{EXTENSIONS_RESOURCE_GROUP_NAME}"', - checks=[ - test.check('length(@)', 2) - ]) - - -# EXAMPLE: /MachineExtensions/delete/Delete a Machine Extension -@try_manual -def step__machineextensions_delete(test): - test.cmd('az connectedmachine extension delete -y ' - f'--machine-name "{EXTENSIONS_MACHINE_NAME}" ' - f'--name "{DEPENDENCY_AGENT_EXTENSION_NAME}" ' - f'--resource-group "{EXTENSIONS_RESOURCE_GROUP_NAME}"', - checks=[]) - - test.cmd('az connectedmachine extension list ' - f'--machine-name "{EXTENSIONS_MACHINE_NAME}" ' - f'--resource-group "{EXTENSIONS_RESOURCE_GROUP_NAME}"', - checks=[ - test.check('length(@)', 1) - ]) - - test.cmd('az connectedmachine extension delete -y ' - f'--machine-name "{EXTENSIONS_MACHINE_NAME}" ' - f'--name "{CUSTOM_SCRIPT_EXTENSION_NAME}" ' - f'--resource-group "{EXTENSIONS_RESOURCE_GROUP_NAME}"', - checks=[]) - - test.cmd('az connectedmachine extension list ' - f'--machine-name "{EXTENSIONS_MACHINE_NAME}" ' - f'--resource-group "{EXTENSIONS_RESOURCE_GROUP_NAME}"', - checks=[ - test.check('length(@)', 0) - ]) +def cleanup_scenario(test, rg, rg_2): + pass +# Testcase: Scenario @try_manual -def call_scenario(test): - setup(test) - # Machines - step__machines_get_get_machine(test) - step__machines_get_list_machines_by_resource_group(test) - step__machines_get_list_machines_by_resource_group(test) - step__machines_delete_delete_a_machine(test) - - # Machine Extensions - step__machineextensions_put(test) - step__machineextensions_patch(test) - step__machineextensions_get_get_machine_extension(test) - step__machineextensions_get(test) - step__machineextensions_delete(test) - - cleanup(test) - - +def call_scenario(test, rg, rg_2): + setup_scenario(test, rg, rg_2) + step_show(test, rg, rg_2, checks=[]) + step_list(test, rg, rg_2, checks=[]) + step_list(test, rg, rg_2, checks=[]) + step_upgrade_extension(test, rg, rg_2, checks=[]) + step_extension_create(test, rg, rg_2, checks=[]) + step_extension_list(test, rg, rg_2, checks=[]) + step_extension_show(test, rg, rg_2, checks=[]) + step_extension_update(test, rg, rg_2, checks=[]) + step_extension_delete(test, rg, rg_2, checks=[]) + step_delete(test, rg, rg_2, checks=[]) + step_private_endpoint_connection_create(test, rg, rg_2, checks=[ + test.check("name", "{myPrivateEndpointConnection}", case_sensitive=False), + ]) + step_private_endpoint_connection_list(test, rg, rg_2, checks=[ + test.check('length(@)', 1), + ]) + step_private_endpoint_connection_show(test, rg, rg_2, checks=[ + test.check("name", "{myPrivateEndpointConnection}", case_sensitive=False), + ]) + step_private_endpoint_connection_delete(test, rg, rg_2, checks=[]) + step_private_link_resource_list(test, rg, rg_2, checks=[]) + step_private_link_resource_list(test, rg, rg_2, checks=[]) + step_private_link_scope_create(test, rg, rg_2, checks=[]) + step_private_link_scope_update(test, rg, rg_2, checks=[]) + step_private_link_scope_show(test, rg, rg_2, checks=[]) + step_private_link_scope_show(test, rg, rg_2, checks=[]) + step_private_link_scope_show(test, rg, rg_2, checks=[]) + step_private_link_scope_list(test, rg, rg_2, checks=[]) + step_private_link_scope_list2(test, rg, rg_2, checks=[]) + step_private_link_scope_update_tag(test, rg, rg_2, checks=[]) + step_private_link_scope_delete(test, rg, rg_2, checks=[]) + cleanup_scenario(test, rg, rg_2) + + +# Test class for Scenario @try_manual -class ConnectedMachineScenarioTest(ScenarioTest): - - @AllowLargeResponse() - def test_connectedmachine(self): - call_scenario(self) +class ConnectedmachineScenarioTest(ScenarioTest): + + def __init__(self, *args, **kwargs): + super(ConnectedmachineScenarioTest, self).__init__(*args, **kwargs) + self.kwargs.update({ + 'myMachine': 'myMachine', + 'myMachine2': 'machineName', + 'myPrivateEndpointConnection': 'private-endpoint-connection-name', + }) + + + @ResourceGroupPreparer(name_prefix='clitestconnectedmachine_myResourceGroup'[:7], key='rg', parameter_name='rg') + @ResourceGroupPreparer(name_prefix='clitestconnectedmachine_my-resource-group'[:7], key='rg_2', + parameter_name='rg_2') + def test_connectedmachine_Scenario(self, rg, rg_2): + call_scenario(self, rg, rg_2) calc_coverage(__file__) raise_if() + diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py index 30e13b4570d..a369296810e 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py @@ -28,7 +28,7 @@ class ConnectedMachineConfiguration(Configuration): :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -47,9 +47,8 @@ def __init__( 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', [])) + self.api_version = "2021-06-10-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'connectedmachine/{}'.format(VERSION)) self._configure(**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 index 57cb7cd716f..a740f6f0196 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_connected_machine.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_connected_machine.py @@ -18,24 +18,34 @@ from azure.core.credentials import TokenCredential from ._configuration import ConnectedMachineConfiguration -from .operations import MachineOperations -from .operations import MachineExtensionOperations -from .operations import OperationOperations +from .operations import MachinesOperations +from .operations import MachineExtensionsOperations +from .operations import ConnectedMachineOperationsMixin +from .operations import Operations +from .operations import PrivateLinkScopesOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations from . import models -class ConnectedMachine(object): +class ConnectedMachine(ConnectedMachineOperationsMixin): """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 + :ivar machines: MachinesOperations operations + :vartype machines: connected_machine.operations.MachinesOperations + :ivar machine_extensions: MachineExtensionsOperations operations + :vartype machine_extensions: connected_machine.operations.MachineExtensionsOperations + :ivar operations: Operations operations + :vartype operations: connected_machine.operations.Operations + :ivar private_link_scopes: PrivateLinkScopesOperations operations + :vartype private_link_scopes: connected_machine.operations.PrivateLinkScopesOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: connected_machine.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: connected_machine.operations.PrivateEndpointConnectionsOperations :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. + :param subscription_id: The ID of the target subscription. :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. @@ -56,14 +66,19 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.machine = MachineOperations( + self.machines = MachinesOperations( self._client, self._config, self._serialize, self._deserialize) - self.machine_extension = MachineExtensionOperations( + self.machine_extensions = MachineExtensionsOperations( self._client, self._config, self._serialize, self._deserialize) - self.operation = OperationOperations( + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_scopes = PrivateLinkScopesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize) def close(self): diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/__init__.py index 73b411ccdcb..5a8f3eca2b2 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._connected_machine_async import ConnectedMachine +from ._connected_machine 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.py similarity index 89% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration_async.py rename to src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration.py index 7a22244ff57..248e7a48540 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration_async.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_configuration.py @@ -26,7 +26,7 @@ class ConnectedMachineConfiguration(Configuration): :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -44,9 +44,8 @@ def __init__( 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', [])) + self.api_version = "2021-06-10-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'connectedmachine/{}'.format(VERSION)) self._configure(**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.py similarity index 53% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine_async.py rename to src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine.py index e13b4017866..5eea54c2534 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine_async.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/_connected_machine.py @@ -15,25 +15,35 @@ # 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 ._configuration import ConnectedMachineConfiguration +from .operations import MachinesOperations +from .operations import MachineExtensionsOperations +from .operations import ConnectedMachineOperationsMixin +from .operations import Operations +from .operations import PrivateLinkScopesOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations from .. import models -class ConnectedMachine(object): +class ConnectedMachine(ConnectedMachineOperationsMixin): """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 + :ivar machines: MachinesOperations operations + :vartype machines: connected_machine.aio.operations.MachinesOperations + :ivar machine_extensions: MachineExtensionsOperations operations + :vartype machine_extensions: connected_machine.aio.operations.MachineExtensionsOperations + :ivar operations: Operations operations + :vartype operations: connected_machine.aio.operations.Operations + :ivar private_link_scopes: PrivateLinkScopesOperations operations + :vartype private_link_scopes: connected_machine.aio.operations.PrivateLinkScopesOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: connected_machine.aio.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: connected_machine.aio.operations.PrivateEndpointConnectionsOperations :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. + :param subscription_id: The ID of the target subscription. :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. @@ -53,14 +63,19 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.machine = MachineOperations( + self.machines = MachinesOperations( self._client, self._config, self._serialize, self._deserialize) - self.machine_extension = MachineExtensionOperations( + self.machine_extensions = MachineExtensionsOperations( self._client, self._config, self._serialize, self._deserialize) - self.operation = OperationOperations( + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_scopes = PrivateLinkScopesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize) async def close(self) -> None: diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/__init__.py new file mode 100644 index 00000000000..641a5a8b66c --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# 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 ._machines_operations import MachinesOperations +from ._machine_extensions_operations import MachineExtensionsOperations +from ._connected_machine_operations import ConnectedMachineOperationsMixin +from ._operations import Operations +from ._private_link_scopes_operations import PrivateLinkScopesOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'MachinesOperations', + 'MachineExtensionsOperations', + 'ConnectedMachineOperationsMixin', + 'Operations', + 'PrivateLinkScopesOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', +] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py new file mode 100644 index 00000000000..67684c5203e --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_connected_machine_operations.py @@ -0,0 +1,142 @@ +# 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, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, 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 ConnectedMachineOperationsMixin: + + async def _upgrade_extensions_initial( + self, + resource_group_name: str, + machine_name: str, + extension_upgrade_parameters: "models.MachineExtensionUpgrade", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._upgrade_extensions_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_upgrade_parameters, 'MachineExtensionUpgrade') + body_content_kwargs['content'] = body_content + request = self._client.post(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 [202]: + 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, {}) + + _upgrade_extensions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore + + async def begin_upgrade_extensions( + self, + resource_group_name: str, + machine_name: str, + extension_upgrade_parameters: "models.MachineExtensionUpgrade", + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to Upgrade Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. + :type machine_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + :type extension_upgrade_parameters: ~connected_machine.models.MachineExtensionUpgrade + :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._upgrade_extensions_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + extension_upgrade_parameters=extension_upgrade_parameters, + 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_upgrade_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore 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/_machine_extensions_operations.py similarity index 69% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_machine_extension_operations_async.py rename to src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machine_extensions_operations.py index c953458d302..8ff9c9cc8ff 100644 --- 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/_machine_extensions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, 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 @@ -21,8 +21,8 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class MachineExtensionOperations: - """MachineExtensionOperations async operations. +class MachineExtensionsOperations: + """MachineExtensionsOperations 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. @@ -46,35 +46,27 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _create_or_update_initial( self, resource_group_name: str, - name: str, + machine_name: str, extension_name: str, - 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: Optional[str] = None, - auto_upgrade_minor_version: Optional[bool] = None, - settings: Optional[object] = None, - protected_settings: Optional[object] = None, - status: Optional["models.MachineExtensionInstanceViewStatus"] = None, + extension_parameters: "models.MachineExtension", **kwargs ) -> Optional["models.MachineExtension"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MachineExtension"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 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_properties_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" + api_version = "2021-06-10-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -85,19 +77,19 @@ async def _create_or_update_initial( # 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' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -107,58 +99,26 @@ async def _create_or_update_initial( 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 + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore async def begin_create_or_update( self, resource_group_name: str, - name: str, + machine_name: str, extension_name: str, - 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: Optional[str] = None, - auto_upgrade_minor_version: Optional[bool] = None, - settings: Optional[object] = None, - protected_settings: Optional[object] = None, - status: Optional["models.MachineExtensionInstanceViewStatus"] = None, + extension_parameters: "models.MachineExtension", **kwargs ) -> AsyncLROPoller["models.MachineExtension"]: """The operation to create or update the extension. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the machine where the extension should be created or updated. - :type name: str + :param machine_name: The name of the machine where the extension should be created or updated. + :type machine_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_properties_type: Specifies the type of the extension; an example is - "CustomScriptExtension". - :type type_properties_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 + :param extension_parameters: Parameters supplied to the Create Machine Extension operation. + :type extension_parameters: ~connected_machine.models.MachineExtension :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 @@ -179,18 +139,9 @@ async def begin_create_or_update( if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, - name=name, + machine_name=machine_name, extension_name=extension_name, - location=location, - tags=tags, - force_update_tag=force_update_tag, - publisher=publisher, - type_properties_type=type_properties_type, - type_handler_version=type_handler_version, - auto_upgrade_minor_version=auto_upgrade_minor_version, - settings=settings, - protected_settings=protected_settings, - status=status, + extension_parameters=extension_parameters, cls=lambda x,y,z: x, **kwargs ) @@ -205,7 +156,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -217,38 +175,32 @@ def get_long_running_output(pipeline_response): ) 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 + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore async def _update_initial( self, resource_group_name: str, - name: str, + machine_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, + extension_parameters: "models.MachineExtensionUpdate", **kwargs ) -> Optional["models.MachineExtension"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MachineExtension"]] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 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" + api_version = "2021-06-10-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -259,19 +211,19 @@ async def _update_initial( # 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' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -281,51 +233,26 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore async def begin_update( self, resource_group_name: str, - name: str, + machine_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, + extension_parameters: "models.MachineExtensionUpdate", **kwargs ) -> AsyncLROPoller["models.MachineExtension"]: - """The operation to update the extension. + """The operation to create or update the extension. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the machine where the extension should be created or updated. - :type name: str + :param machine_name: The name of the machine where the extension should be created or updated. + :type machine_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 + :param extension_parameters: Parameters supplied to the Create Machine Extension operation. + :type extension_parameters: ~connected_machine.models.MachineExtensionUpdate :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 @@ -346,16 +273,9 @@ async def begin_update( if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, - name=name, + machine_name=machine_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, + extension_parameters=extension_parameters, cls=lambda x,y,z: x, **kwargs ) @@ -370,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -382,27 +309,30 @@ def get_long_running_output(pipeline_response): ) 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 + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore async def _delete_initial( self, resource_group_name: str, - name: str, + machine_name: str, extension_name: str, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" # 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -412,6 +342,7 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -419,26 +350,27 @@ async def _delete_initial( 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, 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 + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore async def begin_delete( self, resource_group_name: str, - name: str, + machine_name: str, extension_name: str, **kwargs ) -> AsyncLROPoller[None]: """The operation to delete the extension. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the machine where the extension should be deleted. - :type name: str + :param machine_name: The name of the machine where the extension should be deleted. + :type machine_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 @@ -461,7 +393,7 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - name=name, + machine_name=machine_name, extension_name=extension_name, cls=lambda x,y,z: x, **kwargs @@ -474,7 +406,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -486,21 +425,21 @@ def get_long_running_output(pipeline_response): ) 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 + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore async def get( self, resource_group_name: str, - name: str, + machine_name: str, extension_name: str, **kwargs ) -> "models.MachineExtension": """The operation to get the extension. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the machine containing the extension. - :type name: str + :param machine_name: The name of the machine containing the extension. + :type machine_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 @@ -509,17 +448,20 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" # 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -529,7 +471,7 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -537,7 +479,8 @@ async def get( 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MachineExtension', pipeline_response) @@ -545,21 +488,21 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore def list( self, resource_group_name: str, - name: str, + machine_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. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the machine containing the extension. - :type name: str + :param machine_name: The name of the machine containing the extension. + :type machine_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 @@ -568,22 +511,25 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -613,12 +559,13 @@ async def get_next(next_link=None): 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, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, 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 + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/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/_machines_operations.py similarity index 55% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_machine_operations_async.py rename to src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_machines_operations.py index 27c9c280a82..b291815a42f 100644 --- 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/_machines_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, 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 @@ -19,8 +19,8 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class MachineOperations: - """MachineOperations async operations. +class MachinesOperations: + """MachinesOperations 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. @@ -41,34 +41,171 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + async def create_or_update( + self, + resource_group_name: str, + machine_name: str, + parameters: "models.Machine", + **kwargs + ) -> "models.Machine": + """The operation to create or update a hybrid machine resource identity in Azure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. + :type machine_name: str + :param parameters: Parameters supplied to the Create hybrid machine operation. + :type parameters: ~connected_machine.models.Machine + :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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Machine') + 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]: + 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 + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + machine_name: str, + parameters: "models.MachineUpdate", + **kwargs + ) -> "models.Machine": + """The operation to update a hybrid machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. + :type machine_name: str + :param parameters: Parameters supplied to the Update hybrid machine operation. + :type parameters: ~connected_machine.models.MachineUpdate + :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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'MachineUpdate') + 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]: + 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 + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore + async def delete( self, resource_group_name: str, - name: str, + machine_name: str, **kwargs ) -> None: """The operation to remove a hybrid machine identity in Azure. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the hybrid machine. - :type name: str + :param machine_name: The name of the hybrid machine. + :type machine_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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" # 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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -78,6 +215,7 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -91,21 +229,21 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} # type: ignore + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore async def get( self, resource_group_name: str, - name: str, + machine_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. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the hybrid machine. - :type name: str + :param machine_name: The name of the hybrid machine. + :type machine_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 @@ -114,16 +252,19 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Machine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" # 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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -135,7 +276,7 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -152,16 +293,17 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # 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. + """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. + :param resource_group_name: The name of the resource group. The name is case insensitive. :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) @@ -169,21 +311,24 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') 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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -226,7 +371,8 @@ def list_by_subscription( self, **kwargs ) -> AsyncIterable["models.MachineListResult"]: - """Lists all the hybrid machines in the specified subscription. + """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) @@ -234,20 +380,23 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') 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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters 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/_operations.py similarity index 89% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/_operation_operations_async.py rename to src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_operations.py index 8c3939cae8e..eb7be25ef1f 100644 --- 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/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, 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 @@ -19,8 +19,8 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class OperationOperations: - """OperationOperations async operations. +class Operations: + """Operations 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. @@ -53,14 +53,17 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 00000000000..c4a9770a927 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,432 @@ +# 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 ClientAuthenticationError, 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 PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations 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 get( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~connected_machine.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + parameters: "models.PrivateEndpointConnection", + **kwargs + ) -> Optional["models.PrivateEndpointConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + parameters: "models.PrivateEndpointConnection", + **kwargs + ) -> AsyncLROPoller["models.PrivateEndpointConnection"]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: + :type parameters: ~connected_machine.models.PrivateEndpointConnection + :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 PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~connected_machine.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + 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, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + parameters=parameters, + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_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, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def list_by_private_link_scope( + self, + resource_group_name: str, + scope_name: str, + **kwargs + ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + """Gets all private endpoint connections on a private link scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_machine.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_private_link_scope.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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('PrivateEndpointConnectionListResult', 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_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py new file mode 100644 index 00000000000..b474778b42e --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,180 @@ +# 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 ClientAuthenticationError, 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 PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations 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_by_private_link_scope( + self, + resource_group_name: str, + scope_name: str, + **kwargs + ) -> AsyncIterable["models.PrivateLinkResourceListResult"]: + """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkResourceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_machine.models.PrivateLinkResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_private_link_scope.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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('PrivateLinkResourceListResult', 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_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources'} # type: ignore + + async def get( + self, + resource_group_name: str, + scope_name: str, + group_name: str, + **kwargs + ) -> "models.PrivateLinkResource": + """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param group_name: The name of the private link resource. + :type group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~connected_machine.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'groupName': self._serialize.url("group_name", 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py new file mode 100644 index 00000000000..b906775b085 --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations/_private_link_scopes_operations.py @@ -0,0 +1,611 @@ +# 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 ClientAuthenticationError, 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 PrivateLinkScopesOperations: + """PrivateLinkScopesOperations 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.HybridComputePrivateLinkScopeListResult"]: + """Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridComputePrivateLinkScopeListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_machine.models.HybridComputePrivateLinkScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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('HybridComputePrivateLinkScopeListResult', 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.HybridComputePrivateLinkScopeListResult"]: + """Gets a list of Azure Arc PrivateLinkScopes within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :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 HybridComputePrivateLinkScopeListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_machine.models.HybridComputePrivateLinkScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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('HybridComputePrivateLinkScopeListResult', 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/privateLinkScopes'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + scope_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + scope_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a Azure Arc PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_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, + scope_name=scope_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, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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/privateLinkScopes/{scopeName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + scope_name: str, + **kwargs + ) -> "models.HybridComputePrivateLinkScope": + """Returns a Azure Arc PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridComputePrivateLinkScope, or the result of cls(response) + :rtype: ~connected_machine.models.HybridComputePrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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('HybridComputePrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + scope_name: str, + parameters: "models.HybridComputePrivateLinkScope", + **kwargs + ) -> "models.HybridComputePrivateLinkScope": + """Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value + for InstrumentationKey nor AppId in the Put operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param parameters: Properties that need to be specified to create or update a Azure Arc for + Servers and Clusters PrivateLinkScope. + :type parameters: ~connected_machine.models.HybridComputePrivateLinkScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridComputePrivateLinkScope, or the result of cls(response) + :rtype: ~connected_machine.models.HybridComputePrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'HybridComputePrivateLinkScope') + 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, 201]: + 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 response.status_code == 200: + deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + scope_name: str, + private_link_scope_tags: "models.TagsResource", + **kwargs + ) -> "models.HybridComputePrivateLinkScope": + """Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate + method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_link_scope_tags: Updated tag information to set into the PrivateLinkScope + instance. + :type private_link_scope_tags: ~connected_machine.models.TagsResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridComputePrivateLinkScope, or the result of cls(response) + :rtype: ~connected_machine.models.HybridComputePrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_link_scope_tags, 'TagsResource') + 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]: + 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('HybridComputePrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore + + async def get_validation_details( + self, + location: str, + private_link_scope_id: str, + **kwargs + ) -> "models.PrivateLinkScopeValidationDetails": + """Returns a Azure Arc PrivateLinkScope's validation details. + + :param location: The location of the target resource. + :type location: str + :param private_link_scope_id: The id (Guid) of the Azure Arc PrivateLinkScope resource. + :type private_link_scope_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkScopeValidationDetails, or the result of cls(response) + :rtype: ~connected_machine.models.PrivateLinkScopeValidationDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # Construct URL + url = self.get_validation_details.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateLinkScopeId': self._serialize.url("private_link_scope_id", private_link_scope_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'] = self._serialize.header("accept", accept, 'str') + + 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('PrivateLinkScopeValidationDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_validation_details.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/privateLinkScopes/{privateLinkScopeId}'} # type: ignore + + async def get_validation_details_for_machine( + self, + resource_group_name: str, + machine_name: str, + **kwargs + ) -> "models.PrivateLinkScopeValidationDetails": + """Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param machine_name: The name of the target machine to get the private link scope validation + details for. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkScopeValidationDetails, or the result of cls(response) + :rtype: ~connected_machine.models.PrivateLinkScopeValidationDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # Construct URL + url = self.get_validation_details_for_machine.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str', min_length=1), + } + 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'] = self._serialize.header("accept", accept, 'str') + + 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('PrivateLinkScopeValidationDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_validation_details_for_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/privateLinkScopes/current'} # type: ignore 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 deleted file mode 100644 index ff66f70f156..00000000000 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/aio/operations_async/__init__.py +++ /dev/null @@ -1,17 +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 ._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/models/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py index d9ce4d9297c..ecac1656673 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/__init__.py @@ -7,8 +7,14 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import ConnectionDetail + from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse + from ._models_py3 import ExtensionTargetProperties + from ._models_py3 import HybridComputePrivateLinkScope + from ._models_py3 import HybridComputePrivateLinkScopeListResult + from ._models_py3 import HybridComputePrivateLinkScopeProperties from ._models_py3 import Identity from ._models_py3 import LocationData from ._models_py3 import Machine @@ -16,32 +22,46 @@ 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 MachineExtensionUpgrade 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 OsProfileLinuxConfiguration + from ._models_py3 import OsProfileWindowsConfiguration + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionDataModel + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateEndpointConnectionProperties + from ._models_py3 import PrivateEndpointProperty + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkResourceProperties + from ._models_py3 import PrivateLinkScopeValidationDetails + from ._models_py3 import PrivateLinkScopesResource + from ._models_py3 import PrivateLinkServiceConnectionStateProperty + from ._models_py3 import ProxyResource from ._models_py3 import Resource + from ._models_py3 import ResourceUpdate + from ._models_py3 import SystemData + from ._models_py3 import TagsResource from ._models_py3 import TrackedResource - from ._models_py3 import UpdateResource except (SyntaxError, ImportError): + from ._models import ConnectionDetail # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore from ._models import ErrorDetail # type: ignore from ._models import ErrorResponse # type: ignore + from ._models import ExtensionTargetProperties # type: ignore + from ._models import HybridComputePrivateLinkScope # type: ignore + from ._models import HybridComputePrivateLinkScopeListResult # type: ignore + from ._models import HybridComputePrivateLinkScopeProperties # type: ignore from ._models import Identity # type: ignore from ._models import LocationData # type: ignore from ._models import Machine # type: ignore @@ -49,39 +69,55 @@ 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 MachineExtensionUpgrade # 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 OsProfileLinuxConfiguration # type: ignore + from ._models import OsProfileWindowsConfiguration # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionDataModel # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateEndpointConnectionProperties # type: ignore + from ._models import PrivateEndpointProperty # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceListResult # type: ignore + from ._models import PrivateLinkResourceProperties # type: ignore + from ._models import PrivateLinkScopeValidationDetails # type: ignore + from ._models import PrivateLinkScopesResource # type: ignore + from ._models import PrivateLinkServiceConnectionStateProperty # type: ignore + from ._models import ProxyResource # type: ignore from ._models import Resource # type: ignore + from ._models import ResourceUpdate # type: ignore + from ._models import SystemData # type: ignore + from ._models import TagsResource # type: ignore from ._models import TrackedResource # type: ignore - from ._models import UpdateResource # type: ignore from ._connected_machine_enums import ( + CreatedByType, InstanceViewTypes, + PublicNetworkAccessType, StatusLevelTypes, StatusTypes, ) __all__ = [ + 'ConnectionDetail', + 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', + 'ExtensionTargetProperties', + 'HybridComputePrivateLinkScope', + 'HybridComputePrivateLinkScopeListResult', + 'HybridComputePrivateLinkScopeProperties', 'Identity', 'LocationData', 'Machine', @@ -89,30 +125,40 @@ 'MachineExtensionInstanceView', 'MachineExtensionInstanceViewStatus', 'MachineExtensionProperties', - 'MachineExtensionPropertiesInstanceView', - 'MachineExtensionPropertiesautogenerated', 'MachineExtensionUpdate', 'MachineExtensionUpdateProperties', - 'MachineExtensionUpdatePropertiesautogenerated', + 'MachineExtensionUpgrade', 'MachineExtensionsListResult', - 'MachineIdentity', 'MachineListResult', 'MachineProperties', - 'MachinePropertiesOsProfile', - 'MachinePropertiesautogenerated', 'MachineUpdate', - 'MachineUpdateIdentity', 'MachineUpdateProperties', - 'MachineUpdatePropertiesautogenerated', 'OperationListResult', 'OperationValue', 'OperationValueDisplay', - 'OperationValueDisplayautogenerated', 'OsProfile', + 'OsProfileLinuxConfiguration', + 'OsProfileWindowsConfiguration', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionDataModel', + 'PrivateEndpointConnectionListResult', + 'PrivateEndpointConnectionProperties', + 'PrivateEndpointProperty', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkResourceProperties', + 'PrivateLinkScopeValidationDetails', + 'PrivateLinkScopesResource', + 'PrivateLinkServiceConnectionStateProperty', + 'ProxyResource', 'Resource', + 'ResourceUpdate', + 'SystemData', + 'TagsResource', 'TrackedResource', - 'UpdateResource', + 'CreatedByType', 'InstanceViewTypes', + 'PublicNetworkAccessType', '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 index c3ccf88fe6a..dec09de8f57 100644 --- 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 @@ -26,10 +26,27 @@ def __getattr__(cls, name): raise AttributeError(name) +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + class InstanceViewTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): INSTANCE_VIEW = "instanceView" +class PublicNetworkAccessType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The network access policy to determine if Azure Arc agents can use public Azure Arc service + endpoints. Defaults to disabled (access to Azure Arc services only via private link). + """ + + ENABLED = "Enabled" #: Allows Azure Arc agents to communicate with Azure Arc services over both public (internet) and private endpoints. + DISABLED = "Disabled" #: Does not allow Azure Arc agents to communicate with Azure Arc services over public (internet) endpoints. The agents must use the private link. + class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The level code. """ diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py index bd473d93b7d..483bb7efb0b 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models.py @@ -10,24 +10,104 @@ import msrest.serialization +class ConnectionDetail(msrest.serialization.Model): + """ConnectionDetail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar private_ip_address: The private endpoint connection private ip address. + :vartype private_ip_address: str + :ivar link_identifier: The private endpoint connection link identifier. + :vartype link_identifier: str + :ivar group_id: The private endpoint connection group id. + :vartype group_id: str + :ivar member_name: The private endpoint connection member name. + :vartype member_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'link_identifier': {'readonly': True}, + 'group_id': {'readonly': True}, + 'member_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'link_identifier': {'key': 'linkIdentifier', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'member_name': {'key': 'memberName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionDetail, self).__init__(**kwargs) + self.id = None + self.private_ip_address = None + self.link_identifier = None + self.group_id = None + self.member_name = None + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ErrorDetail(msrest.serialization.Model): - """Error details. + """The error detail. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :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] + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~connected_machine.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~connected_machine.models.ErrorAdditionalInfo] """ _validation = { - 'code': {'required': True}, - 'message': {'required': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { @@ -35,6 +115,7 @@ class ErrorDetail(msrest.serialization.Model): 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__( @@ -42,67 +123,253 @@ def __init__( **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) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None class ErrorResponse(msrest.serialization.Model): - """Contains details when the response code indicates an error. + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :param error: The error object. + :type error: ~connected_machine.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ExtensionTargetProperties(msrest.serialization.Model): + """Describes the Machine Extension Target Version Properties. + + :param target_version: Properties for the specified Extension to Upgrade. + :type target_version: str + """ + + _attribute_map = { + 'target_version': {'key': 'targetVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionTargetProperties, self).__init__(**kwargs) + self.target_version = kwargs.get('target_version', None) + + +class PrivateLinkScopesResource(msrest.serialization.Model): + """An azure resource object. + + 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. - :param error: Required. The error details. - :type error: ~connected_machine.models.ErrorDetail + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] """ _validation = { - 'error': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + '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}'}, } def __init__( self, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs['error'] + super(PrivateLinkScopesResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class HybridComputePrivateLinkScope(PrivateLinkScopesResource): + """An Azure Arc PrivateLinkScope 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: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param properties: Properties that define a Azure Arc PrivateLinkScope resource. + :type properties: ~connected_machine.models.HybridComputePrivateLinkScopeProperties + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~connected_machine.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'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}'}, + 'properties': {'key': 'properties', 'type': 'HybridComputePrivateLinkScopeProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridComputePrivateLinkScope, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.system_data = None + + +class HybridComputePrivateLinkScopeListResult(msrest.serialization.Model): + """Describes the list of Azure Arc PrivateLinkScope resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. List of Azure Arc PrivateLinkScope definitions. + :type value: list[~connected_machine.models.HybridComputePrivateLinkScope] + :param next_link: The URI to get the next set of Azure Arc PrivateLinkScope definitions if too + many PrivateLinkScopes where returned in the result set. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridComputePrivateLinkScope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridComputePrivateLinkScopeListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class HybridComputePrivateLinkScopeProperties(msrest.serialization.Model): + """Properties that define a Azure Arc PrivateLinkScope resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param public_network_access: Indicates whether machines associated with the private link scope + can also use public Azure Arc service endpoints. Possible values include: "Enabled", + "Disabled". Default value: "Disabled". + :type public_network_access: str or ~connected_machine.models.PublicNetworkAccessType + :ivar provisioning_state: Current state of this PrivateLinkScope: whether or not is has been + provisioned within the resource group it is defined. Users cannot change this value but are + able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. + :vartype provisioning_state: str + :ivar private_link_scope_id: The Guid id of the private link scope. + :vartype private_link_scope_id: str + :ivar private_endpoint_connections: The collection of associated Private Endpoint Connections. + :vartype private_endpoint_connections: + list[~connected_machine.models.PrivateEndpointConnectionDataModel] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'private_link_scope_id': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + } + + _attribute_map = { + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_link_scope_id': {'key': 'privateLinkScopeId', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnectionDataModel]'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridComputePrivateLinkScopeProperties, self).__init__(**kwargs) + self.public_network_access = kwargs.get('public_network_access', "Disabled") + self.provisioning_state = None + self.private_link_scope_id = None + self.private_endpoint_connections = None class Identity(msrest.serialization.Model): - """Managed Identity. + """Identity for the resource. 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. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. + :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str + :ivar type: The identity type. Default value: "SystemAssigned". + :vartype type: str """ _validation = { 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, + 'type': {'constant': True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } + type = "SystemAssigned" + def __init__( self, **kwargs ): super(Identity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) self.principal_id = None self.tenant_id = None @@ -145,17 +412,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. 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 - + :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. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -182,19 +449,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. 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 - + :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. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -233,60 +500,24 @@ class Machine(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :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. + :ivar type: The type of the resource. E.g. "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. + :param properties: Hybrid Compute Machine properties. + :type properties: ~connected_machine.models.MachineProperties + :param identity: Identity for the resource. :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 + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~connected_machine.models.SystemData """ _validation = { @@ -294,22 +525,7 @@ class Machine(TrackedResource): '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}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -318,26 +534,9 @@ class Machine(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MachineProperties'}, '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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -345,26 +544,9 @@ def __init__( **kwargs ): super(Machine, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) 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 + self.system_data = None class MachineExtension(TrackedResource): @@ -374,50 +556,22 @@ class MachineExtension(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :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. + :ivar type: The type of the resource. E.g. "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_instance_view_name: The machine extension name. - :vartype name_instance_view_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 + :param properties: Describes Machine Extension Properties. + :type properties: ~connected_machine.models.MachineExtensionProperties + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~connected_machine.models.SystemData """ _validation = { @@ -425,10 +579,7 @@ class MachineExtension(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'name_instance_view_name': {'readonly': True}, - 'type_instance_view_type': {'readonly': True}, - 'type_handler_version_instance_view_type_handler_version': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -437,18 +588,8 @@ class MachineExtension(TrackedResource): '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_instance_view_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'}, + 'properties': {'key': 'properties', 'type': 'MachineExtensionProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -456,41 +597,23 @@ def __init__( **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_instance_view_name = None - self.type_instance_view_type = None - self.type_handler_version_instance_view_type_handler_version = None - self.status = kwargs.get('status', None) + self.properties = kwargs.get('properties', None) + self.system_data = 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 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: ~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'}, @@ -503,37 +626,27 @@ def __init__( **kwargs ): super(MachineExtensionInstanceView, self).__init__(**kwargs) - self.name = None - self.type = None - self.type_handler_version = None + 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(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 + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: "Info", "Warning", "Error". + :type level: str or ~connected_machine.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.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'}, @@ -547,11 +660,11 @@ def __init__( **kwargs ): super(MachineExtensionInstanceViewStatus, self).__init__(**kwargs) - self.code = None - self.level = None - self.display_status = None - self.message = None - self.time = None + 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 MachineExtensionProperties(msrest.serialization.Model): @@ -615,93 +728,6 @@ def __init__( self.instance_view = kwargs.get('instance_view', 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 - :param instance_view: The machine extension instance view. - :type instance_view: ~connected_machine.models.MachineExtensionInstanceView - """ - - _validation = { - 'provisioning_state': {'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'}, - 'instance_view': {'key': 'instanceView', 'type': 'MachineExtensionInstanceView'}, - } - - 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. @@ -726,7 +752,7 @@ def __init__( self.next_link = kwargs.get('next_link', None) -class UpdateResource(msrest.serialization.Model): +class ResourceUpdate(msrest.serialization.Model): """The Update Resource model definition. :param tags: A set of tags. Resource tags. @@ -741,44 +767,22 @@ def __init__( self, **kwargs ): - super(UpdateResource, self).__init__(**kwargs) + super(ResourceUpdate, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) -class MachineExtensionUpdate(UpdateResource): +class MachineExtensionUpdate(ResourceUpdate): """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 + :param properties: Describes Machine Extension Update Properties. + :type properties: ~connected_machine.models.MachineExtensionUpdateProperties """ _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'}, + 'properties': {'key': 'properties', 'type': 'MachineExtensionUpdateProperties'}, } def __init__( @@ -786,13 +790,7 @@ def __init__( **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) + self.properties = kwargs.get('properties', None) class MachineExtensionUpdateProperties(msrest.serialization.Model): @@ -842,75 +840,23 @@ def __init__( 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. +class MachineExtensionUpgrade(msrest.serialization.Model): + """Describes the Machine Extension Upgrade Properties. - :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 extension_targets: Describes the Extension Target Properties. + :type extension_targets: dict[str, ~connected_machine.models.ExtensionTargetProperties] """ - _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'}, + 'extension_targets': {'key': 'extensionTargets', 'type': '{ExtensionTargetProperties}'}, } def __init__( self, **kwargs ): - super(MachineIdentity, self).__init__(**kwargs) + super(MachineExtensionUpgrade, self).__init__(**kwargs) + self.extension_targets = kwargs.get('extension_targets', None) class MachineListResult(msrest.serialization.Model): @@ -950,8 +896,8 @@ class MachineProperties(msrest.serialization.Model): :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 + :param os_profile: Specifies the operating system settings for the hybrid machine. + :type 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", @@ -976,10 +922,12 @@ class MachineProperties(msrest.serialization.Model): :vartype os_name: str :ivar os_version: The version of Operating System running on the hybrid machine. :vartype os_version: str + :param os_type: The type of Operating System (windows/linux). + :type os_type: 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] + :param extensions: Machine Extensions information. + :type 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. @@ -988,10 +936,19 @@ class MachineProperties(msrest.serialization.Model): :vartype ad_fqdn: str :ivar dns_fqdn: Specifies the DNS fully qualified display name. :vartype dns_fqdn: str + :param private_link_scope_resource_id: The resource id of the private link scope this machine + is assigned to, if any. + :type private_link_scope_resource_id: str + :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this + machine is assigned to, if any. + :type parent_cluster_resource_id: str + :param mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. + :type mssql_discovered: str + :ivar detected_properties: Detected properties from the machine. + :vartype detected_properties: dict[str, str] """ _validation = { - 'os_profile': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'status': {'readonly': True}, 'last_status_change': {'readonly': True}, @@ -1002,11 +959,11 @@ class MachineProperties(msrest.serialization.Model): '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}, + 'detected_properties': {'readonly': True}, } _attribute_map = { @@ -1023,12 +980,17 @@ class MachineProperties(msrest.serialization.Model): 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, 'os_name': {'key': 'osName', 'type': 'str'}, 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'os_type': {'key': 'osType', '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'}, + 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, + 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, + 'mssql_discovered': {'key': 'mssqlDiscovered', 'type': 'str'}, + 'detected_properties': {'key': 'detectedProperties', 'type': '{str}'}, } def __init__( @@ -1037,7 +999,7 @@ def __init__( ): super(MachineProperties, self).__init__(**kwargs) self.location_data = kwargs.get('location_data', None) - self.os_profile = None + self.os_profile = kwargs.get('os_profile', None) self.provisioning_state = None self.status = None self.last_status_change = None @@ -1049,107 +1011,175 @@ def __init__( self.client_public_key = kwargs.get('client_public_key', None) self.os_name = None self.os_version = None + self.os_type = kwargs.get('os_type', None) self.vm_uuid = None - self.extensions = None + self.extensions = kwargs.get('extensions', None) self.os_sku = None self.domain_name = None self.ad_fqdn = None self.dns_fqdn = None + self.private_link_scope_resource_id = kwargs.get('private_link_scope_resource_id', None) + self.parent_cluster_resource_id = kwargs.get('parent_cluster_resource_id', None) + self.mssql_discovered = kwargs.get('mssql_discovered', None) + self.detected_properties = None -class MachinePropertiesautogenerated(MachineProperties): - """Hybrid Compute Machine properties. +class MachineUpdate(ResourceUpdate): + """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 identity: Identity for the resource. + :type identity: ~connected_machine.models.Identity + :param properties: Hybrid Compute Machine properties. + :type properties: ~connected_machine.models.MachineUpdateProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'properties': {'key': 'properties', 'type': 'MachineUpdateProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineUpdate, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.properties = kwargs.get('properties', None) + + +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 - :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 + :param os_profile: Specifies the operating system settings for the hybrid machine. + :type os_profile: ~connected_machine.models.OsProfile + :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this + machine is assigned to, if any. + :type parent_cluster_resource_id: str + :param private_link_scope_resource_id: The resource id of the private link scope this machine + is assigned to, if any. + :type private_link_scope_resource_id: str + """ + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, + 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, + 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineUpdateProperties, self).__init__(**kwargs) + self.location_data = kwargs.get('location_data', None) + self.os_profile = kwargs.get('os_profile', None) + self.parent_cluster_resource_id = kwargs.get('parent_cluster_resource_id', None) + self.private_link_scope_resource_id = kwargs.get('private_link_scope_resource_id', None) + + +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 = { - '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}, + 'value': {'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'}, + '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 + :param display: Display properties. + :type display: ~connected_machine.models.OperationValueDisplay + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationValueDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.display = kwargs.get('display', 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(MachinePropertiesautogenerated, self).__init__(**kwargs) + super(OperationValueDisplay, self).__init__(**kwargs) + self.operation = None + self.resource = None + self.description = None + self.provider = None class OsProfile(msrest.serialization.Model): @@ -1159,6 +1189,10 @@ class OsProfile(msrest.serialization.Model): :ivar computer_name: Specifies the host OS name of the hybrid machine. :vartype computer_name: str + :param windows_configuration: Specifies the windows configuration for update management. + :type windows_configuration: ~connected_machine.models.OsProfileWindowsConfiguration + :param linux_configuration: Specifies the linux configuration for update management. + :type linux_configuration: ~connected_machine.models.OsProfileLinuxConfiguration """ _validation = { @@ -1167,6 +1201,8 @@ class OsProfile(msrest.serialization.Model): _attribute_map = { 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'OsProfileWindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'OsProfileLinuxConfiguration'}, } def __init__( @@ -1175,287 +1211,483 @@ def __init__( ): super(OsProfile, self).__init__(**kwargs) self.computer_name = None + self.windows_configuration = kwargs.get('windows_configuration', None) + self.linux_configuration = kwargs.get('linux_configuration', None) -class MachinePropertiesOsProfile(OsProfile): - """Specifies the operating system settings for the hybrid machine. +class OsProfileLinuxConfiguration(msrest.serialization.Model): + """Specifies the linux configuration for update management. + + :param assessment_mode: Specifies the assessment mode. + :type assessment_mode: str + """ + + _attribute_map = { + 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OsProfileLinuxConfiguration, self).__init__(**kwargs) + self.assessment_mode = kwargs.get('assessment_mode', None) + + +class OsProfileWindowsConfiguration(msrest.serialization.Model): + """Specifies the windows configuration for update management. + + :param assessment_mode: Specifies the assessment mode. + :type assessment_mode: str + """ + + _attribute_map = { + 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OsProfileWindowsConfiguration, self).__init__(**kwargs) + self.assessment_mode = kwargs.get('assessment_mode', None) + + +class PrivateEndpointConnection(Resource): + """A private endpoint connection. 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 + :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. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param properties: Resource properties. + :type properties: ~connected_machine.models.PrivateEndpointConnectionProperties + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~connected_machine.models.SystemData """ _validation = { - 'computer_name': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { - 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( self, **kwargs ): - super(MachinePropertiesOsProfile, self).__init__(**kwargs) + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.system_data = None -class MachineUpdate(UpdateResource): - """Describes a hybrid machine Update. +class PrivateEndpointConnectionDataModel(msrest.serialization.Model): + """The Data Model for a Private Endpoint Connection associated with a Private Link Scope. 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 + :ivar id: The ARM Resource Id of the Private Endpoint. + :vartype id: str + :ivar name: The Name of the Private Endpoint. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param properties: The Private Endpoint Connection properties. + :type properties: ~connected_machine.models.PrivateEndpointConnectionProperties """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'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'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, } 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 + super(PrivateEndpointConnectionDataModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) -class MachineUpdateIdentity(Identity): - """Hybrid Compute Machine Managed Identity. +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """A list of private endpoint connections. 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 + :ivar value: Array of results. + :vartype value: list[~connected_machine.models.PrivateEndpointConnection] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(MachineUpdateIdentity, self).__init__(**kwargs) + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None -class MachineUpdateProperties(msrest.serialization.Model): - """Describes the ARM updatable properties of a hybrid machine. +class PrivateEndpointConnectionProperties(msrest.serialization.Model): + """Properties of a private endpoint connection. - :param location_data: Metadata pertaining to the geographic location of the resource. - :type location_data: ~connected_machine.models.LocationData + Variables are only populated by the server, and will be ignored when sending a request. + + :param private_endpoint: Private endpoint which the connection belongs to. + :type private_endpoint: ~connected_machine.models.PrivateEndpointProperty + :param private_link_service_connection_state: Connection state of the private endpoint + connection. + :type private_link_service_connection_state: + ~connected_machine.models.PrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the private endpoint connection. + :vartype provisioning_state: str """ + _validation = { + 'provisioning_state': {'readonly': True}, + } + _attribute_map = { - 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointProperty'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } def __init__( self, **kwargs ): - super(MachineUpdateProperties, self).__init__(**kwargs) - self.location_data = kwargs.get('location_data', None) + super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None -class MachineUpdatePropertiesautogenerated(MachineUpdateProperties): - """Hybrid Compute Machine properties. +class PrivateEndpointProperty(msrest.serialization.Model): + """Private endpoint which the connection belongs to. - :param location_data: Metadata pertaining to the geographic location of the resource. - :type location_data: ~connected_machine.models.LocationData + :param id: Resource id of the private endpoint. + :type id: str """ _attribute_map = { - 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, **kwargs ): - super(MachineUpdatePropertiesautogenerated, self).__init__(**kwargs) + super(PrivateEndpointProperty, self).__init__(**kwargs) + self.id = kwargs.get('id', None) -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. +class PrivateLinkResource(Resource): + """A private link resource. 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] + :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. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param properties: Resource properties. + :type properties: ~connected_machine.models.PrivateLinkResourceProperties + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~connected_machine.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.system_data = None + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~connected_machine.models.PrivateLinkResource] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str """ _validation = { 'value': {'readonly': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(OperationListResult, self).__init__(**kwargs) + super(PrivateLinkResourceListResult, self).__init__(**kwargs) self.value = None + self.next_link = None -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. +class PrivateLinkResourceProperties(msrest.serialization.Model): + """Properties of a private link resource. 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 + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :ivar required_zone_names: Required DNS zone names of the the private link resource. + :vartype required_zone_names: list[str] """ _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'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'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', '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 + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None -class OperationValueDisplay(msrest.serialization.Model): - """Describes the properties of a Hybrid Compute Operation Value Display. +class PrivateLinkScopeValidationDetails(msrest.serialization.Model): + """PrivateLinkScopeValidationDetails. 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 + :ivar id: Azure resource Id. + :vartype id: str + :param public_network_access: Indicates whether machines associated with the private link scope + can also use public Azure Arc service endpoints. Possible values include: "Enabled", + "Disabled". Default value: "Disabled". + :type public_network_access: str or ~connected_machine.models.PublicNetworkAccessType + :param connection_details: List of Private Endpoint Connection details. + :type connection_details: list[~connected_machine.models.ConnectionDetail] """ _validation = { - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, + 'id': {'readonly': True}, } _attribute_map = { - 'operation': {'key': 'operation', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'connection_details': {'key': 'connectionDetails', 'type': '[ConnectionDetail]'}, } def __init__( self, **kwargs ): - super(OperationValueDisplay, self).__init__(**kwargs) - self.operation = None - self.resource = None - self.description = None - self.provider = None + super(PrivateLinkScopeValidationDetails, self).__init__(**kwargs) + self.id = None + self.public_network_access = kwargs.get('public_network_access', "Disabled") + self.connection_details = kwargs.get('connection_details', None) -class OperationValueDisplayautogenerated(OperationValueDisplay): - """Display properties. +class PrivateLinkServiceConnectionStateProperty(msrest.serialization.Model): + """State of the private endpoint connection. 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 + All required parameters must be populated in order to send to Azure. + + :param status: Required. The private link service connection status. + :type status: str + :param description: Required. The private link service connection description. + :type description: str + :ivar actions_required: The actions required for private link service connection. + :vartype actions_required: str """ _validation = { - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, + 'status': {'required': True}, + 'description': {'required': True}, + 'actions_required': {'readonly': True}, } _attribute_map = { - 'operation': {'key': 'operation', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__( self, **kwargs ): - super(OperationValueDisplayautogenerated, self).__init__(**kwargs) + super(PrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) + self.status = kwargs['status'] + self.description = kwargs['description'] + self.actions_required = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + 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. E.g. "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(ProxyResource, self).__init__(**kwargs) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~connected_machine.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~connected_machine.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TagsResource(msrest.serialization.Model): + """A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. + + :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(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) 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 index bb94fd14a3c..5b26cd7616b 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/models/_models_py3.py @@ -6,30 +6,113 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Dict, List, Optional +import datetime +from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization +from ._connected_machine_enums import * + + +class ConnectionDetail(msrest.serialization.Model): + """ConnectionDetail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar private_ip_address: The private endpoint connection private ip address. + :vartype private_ip_address: str + :ivar link_identifier: The private endpoint connection link identifier. + :vartype link_identifier: str + :ivar group_id: The private endpoint connection group id. + :vartype group_id: str + :ivar member_name: The private endpoint connection member name. + :vartype member_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'link_identifier': {'readonly': True}, + 'group_id': {'readonly': True}, + 'member_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'link_identifier': {'key': 'linkIdentifier', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'member_name': {'key': 'memberName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionDetail, self).__init__(**kwargs) + self.id = None + self.private_ip_address = None + self.link_identifier = None + self.group_id = None + self.member_name = None + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + class ErrorDetail(msrest.serialization.Model): - """Error details. + """The error detail. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :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] + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~connected_machine.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~connected_machine.models.ErrorAdditionalInfo] """ _validation = { - 'code': {'required': True}, - 'message': {'required': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { @@ -37,83 +120,277 @@ class ErrorDetail(msrest.serialization.Model): 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } 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 + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None class ErrorResponse(msrest.serialization.Model): - """Contains details when the response code indicates an error. + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :param error: The error object. + :type error: ~connected_machine.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ExtensionTargetProperties(msrest.serialization.Model): + """Describes the Machine Extension Target Version Properties. + + :param target_version: Properties for the specified Extension to Upgrade. + :type target_version: str + """ + + _attribute_map = { + 'target_version': {'key': 'targetVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + target_version: Optional[str] = None, + **kwargs + ): + super(ExtensionTargetProperties, self).__init__(**kwargs) + self.target_version = target_version + + +class PrivateLinkScopesResource(msrest.serialization.Model): + """An azure resource object. + + 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. - :param error: Required. The error details. - :type error: ~connected_machine.models.ErrorDetail + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] """ _validation = { - 'error': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + '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}'}, } def __init__( self, *, - error: "ErrorDetail", + location: str, + tags: Optional[Dict[str, str]] = None, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = error + super(PrivateLinkScopesResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class HybridComputePrivateLinkScope(PrivateLinkScopesResource): + """An Azure Arc PrivateLinkScope 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: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param properties: Properties that define a Azure Arc PrivateLinkScope resource. + :type properties: ~connected_machine.models.HybridComputePrivateLinkScopeProperties + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~connected_machine.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'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}'}, + 'properties': {'key': 'properties', 'type': 'HybridComputePrivateLinkScopeProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["HybridComputePrivateLinkScopeProperties"] = None, + **kwargs + ): + super(HybridComputePrivateLinkScope, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties + self.system_data = None + + +class HybridComputePrivateLinkScopeListResult(msrest.serialization.Model): + """Describes the list of Azure Arc PrivateLinkScope resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. List of Azure Arc PrivateLinkScope definitions. + :type value: list[~connected_machine.models.HybridComputePrivateLinkScope] + :param next_link: The URI to get the next set of Azure Arc PrivateLinkScope definitions if too + many PrivateLinkScopes where returned in the result set. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridComputePrivateLinkScope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["HybridComputePrivateLinkScope"], + next_link: Optional[str] = None, + **kwargs + ): + super(HybridComputePrivateLinkScopeListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class HybridComputePrivateLinkScopeProperties(msrest.serialization.Model): + """Properties that define a Azure Arc PrivateLinkScope resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param public_network_access: Indicates whether machines associated with the private link scope + can also use public Azure Arc service endpoints. Possible values include: "Enabled", + "Disabled". Default value: "Disabled". + :type public_network_access: str or ~connected_machine.models.PublicNetworkAccessType + :ivar provisioning_state: Current state of this PrivateLinkScope: whether or not is has been + provisioned within the resource group it is defined. Users cannot change this value but are + able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. + :vartype provisioning_state: str + :ivar private_link_scope_id: The Guid id of the private link scope. + :vartype private_link_scope_id: str + :ivar private_endpoint_connections: The collection of associated Private Endpoint Connections. + :vartype private_endpoint_connections: + list[~connected_machine.models.PrivateEndpointConnectionDataModel] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'private_link_scope_id': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + } + + _attribute_map = { + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_link_scope_id': {'key': 'privateLinkScopeId', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnectionDataModel]'}, + } + + def __init__( + self, + *, + public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = "Disabled", + **kwargs + ): + super(HybridComputePrivateLinkScopeProperties, self).__init__(**kwargs) + self.public_network_access = public_network_access + self.provisioning_state = None + self.private_link_scope_id = None + self.private_endpoint_connections = None class Identity(msrest.serialization.Model): - """Managed Identity. + """Identity for the resource. 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. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. + :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str + :ivar type: The identity type. Default value: "SystemAssigned". + :vartype type: str """ _validation = { 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, + 'type': {'constant': True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } + type = "SystemAssigned" + def __init__( self, - *, - type: Optional[str] = None, **kwargs ): super(Identity, self).__init__(**kwargs) - self.type = type self.principal_id = None self.tenant_id = None @@ -161,17 +438,17 @@ def __init__( class Resource(msrest.serialization.Model): - """Resource. + """Common fields that are returned in the response for all Azure Resource Manager resources. 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 - + :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. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -198,19 +475,19 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. 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 - + :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. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] @@ -252,60 +529,24 @@ class Machine(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :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. + :ivar type: The type of the resource. E.g. "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. + :param properties: Hybrid Compute Machine properties. + :type properties: ~connected_machine.models.MachineProperties + :param identity: Identity for the resource. :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 + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~connected_machine.models.SystemData """ _validation = { @@ -313,22 +554,7 @@ class Machine(TrackedResource): '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}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -337,26 +563,9 @@ class Machine(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MachineProperties'}, '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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -364,33 +573,14 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, + properties: Optional["MachineProperties"] = 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.properties = properties 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 + self.system_data = None class MachineExtension(TrackedResource): @@ -400,50 +590,22 @@ class MachineExtension(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :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. + :ivar type: The type of the resource. E.g. "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_instance_view_name: The machine extension name. - :vartype name_instance_view_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 + :param properties: Describes Machine Extension Properties. + :type properties: ~connected_machine.models.MachineExtensionProperties + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~connected_machine.models.SystemData """ _validation = { @@ -451,10 +613,7 @@ class MachineExtension(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'name_instance_view_name': {'readonly': True}, - 'type_instance_view_type': {'readonly': True}, - 'type_handler_version_instance_view_type_handler_version': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -463,18 +622,8 @@ class MachineExtension(TrackedResource): '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_instance_view_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'}, + 'properties': {'key': 'properties', 'type': 'MachineExtensionProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( @@ -482,52 +631,27 @@ def __init__( *, 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, + properties: Optional["MachineExtensionProperties"] = 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_instance_view_name = None - self.type_instance_view_type = None - self.type_handler_version_instance_view_type_handler_version = None - self.status = status + self.properties = properties + self.system_data = 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 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: ~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'}, @@ -538,41 +662,34 @@ class MachineExtensionInstanceView(msrest.serialization.Model): def __init__( self, *, + name: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, status: Optional["MachineExtensionInstanceViewStatus"] = None, **kwargs ): super(MachineExtensionInstanceView, self).__init__(**kwargs) - self.name = None - self.type = None - self.type_handler_version = None + self.name = name + self.type = type + self.type_handler_version = type_handler_version 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 + :param code: The status code. + :type code: str + :param level: The level code. Possible values include: "Info", "Warning", "Error". + :type level: str or ~connected_machine.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.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'}, @@ -583,14 +700,20 @@ class MachineExtensionInstanceViewStatus(msrest.serialization.Model): def __init__( self, + *, + code: Optional[str] = None, + level: Optional[Union[str, "StatusLevelTypes"]] = None, + display_status: Optional[str] = None, + message: Optional[str] = None, + time: Optional[datetime.datetime] = None, **kwargs ): super(MachineExtensionInstanceViewStatus, self).__init__(**kwargs) - self.code = None - self.level = None - self.display_status = None - self.message = None - self.time = None + self.code = code + self.level = level + self.display_status = display_status + self.message = message + self.time = time class MachineExtensionProperties(msrest.serialization.Model): @@ -663,104 +786,6 @@ def __init__( self.instance_view = instance_view -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 - :param instance_view: The machine extension instance view. - :type instance_view: ~connected_machine.models.MachineExtensionInstanceView - """ - - _validation = { - 'provisioning_state': {'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'}, - 'instance_view': {'key': 'instanceView', 'type': 'MachineExtensionInstanceView'}, - } - - 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, - instance_view: Optional["MachineExtensionInstanceView"] = 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, instance_view=instance_view, **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. @@ -788,7 +813,7 @@ def __init__( self.next_link = next_link -class UpdateResource(msrest.serialization.Model): +class ResourceUpdate(msrest.serialization.Model): """The Update Resource model definition. :param tags: A set of tags. Resource tags. @@ -805,67 +830,33 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): - super(UpdateResource, self).__init__(**kwargs) + super(ResourceUpdate, self).__init__(**kwargs) self.tags = tags -class MachineExtensionUpdate(UpdateResource): +class MachineExtensionUpdate(ResourceUpdate): """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 + :param properties: Describes Machine Extension Update Properties. + :type properties: ~connected_machine.models.MachineExtensionUpdateProperties """ _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'}, + 'properties': {'key': 'properties', 'type': 'MachineExtensionUpdateProperties'}, } 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, + properties: Optional["MachineExtensionUpdateProperties"] = 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 + self.properties = properties class MachineExtensionUpdateProperties(msrest.serialization.Model): @@ -923,101 +914,41 @@ def __init__( self.protected_settings = protected_settings -class MachineExtensionUpdatePropertiesautogenerated(MachineExtensionUpdateProperties): - """Describes Machine Extension Update Properties. +class MachineExtensionUpgrade(msrest.serialization.Model): + """Describes the Machine Extension Upgrade 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 + :param extension_targets: Describes the Extension Target Properties. + :type extension_targets: dict[str, ~connected_machine.models.ExtensionTargetProperties] """ _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'}, + 'extension_targets': {'key': 'extensionTargets', 'type': '{ExtensionTargetProperties}'}, } 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, + extension_targets: Optional[Dict[str, "ExtensionTargetProperties"]] = 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) + super(MachineExtensionUpgrade, self).__init__(**kwargs) + self.extension_targets = extension_targets -class MachineIdentity(Identity): - """MachineIdentity. +class MachineListResult(msrest.serialization.Model): + """The List hybrid machine operation response. - 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. - :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 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 = { - '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}, + 'value': {'required': True}, } _attribute_map = { @@ -1044,8 +975,8 @@ class MachineProperties(msrest.serialization.Model): :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 + :param os_profile: Specifies the operating system settings for the hybrid machine. + :type 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", @@ -1070,10 +1001,12 @@ class MachineProperties(msrest.serialization.Model): :vartype os_name: str :ivar os_version: The version of Operating System running on the hybrid machine. :vartype os_version: str + :param os_type: The type of Operating System (windows/linux). + :type os_type: 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] + :param extensions: Machine Extensions information. + :type 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. @@ -1082,10 +1015,19 @@ class MachineProperties(msrest.serialization.Model): :vartype ad_fqdn: str :ivar dns_fqdn: Specifies the DNS fully qualified display name. :vartype dns_fqdn: str + :param private_link_scope_resource_id: The resource id of the private link scope this machine + is assigned to, if any. + :type private_link_scope_resource_id: str + :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this + machine is assigned to, if any. + :type parent_cluster_resource_id: str + :param mssql_discovered: Specifies whether any MS SQL instance is discovered on the machine. + :type mssql_discovered: str + :ivar detected_properties: Detected properties from the machine. + :vartype detected_properties: dict[str, str] """ _validation = { - 'os_profile': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'status': {'readonly': True}, 'last_status_change': {'readonly': True}, @@ -1096,11 +1038,11 @@ class MachineProperties(msrest.serialization.Model): '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}, + 'detected_properties': {'readonly': True}, } _attribute_map = { @@ -1117,25 +1059,36 @@ class MachineProperties(msrest.serialization.Model): 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, 'os_name': {'key': 'osName', 'type': 'str'}, 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'os_type': {'key': 'osType', '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'}, + 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, + 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, + 'mssql_discovered': {'key': 'mssqlDiscovered', 'type': 'str'}, + 'detected_properties': {'key': 'detectedProperties', 'type': '{str}'}, } def __init__( self, *, location_data: Optional["LocationData"] = None, + os_profile: Optional["OsProfile"] = None, vm_id: Optional[str] = None, client_public_key: Optional[str] = None, + os_type: Optional[str] = None, + extensions: Optional[List["MachineExtensionInstanceView"]] = None, + private_link_scope_resource_id: Optional[str] = None, + parent_cluster_resource_id: Optional[str] = None, + mssql_discovered: Optional[str] = None, **kwargs ): super(MachineProperties, self).__init__(**kwargs) self.location_data = location_data - self.os_profile = None + self.os_profile = os_profile self.provisioning_state = None self.status = None self.last_status_change = None @@ -1147,111 +1100,186 @@ def __init__( self.client_public_key = client_public_key self.os_name = None self.os_version = None + self.os_type = os_type self.vm_uuid = None - self.extensions = None + self.extensions = extensions self.os_sku = None self.domain_name = None self.ad_fqdn = None self.dns_fqdn = None + self.private_link_scope_resource_id = private_link_scope_resource_id + self.parent_cluster_resource_id = parent_cluster_resource_id + self.mssql_discovered = mssql_discovered + self.detected_properties = None -class MachinePropertiesautogenerated(MachineProperties): - """Hybrid Compute Machine properties. +class MachineUpdate(ResourceUpdate): + """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 identity: Identity for the resource. + :type identity: ~connected_machine.models.Identity + :param properties: Hybrid Compute Machine properties. + :type properties: ~connected_machine.models.MachineUpdateProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'properties': {'key': 'properties', 'type': 'MachineUpdateProperties'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["Identity"] = None, + properties: Optional["MachineUpdateProperties"] = None, + **kwargs + ): + super(MachineUpdate, self).__init__(tags=tags, **kwargs) + self.identity = identity + self.properties = properties + + +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 - :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 + :param os_profile: Specifies the operating system settings for the hybrid machine. + :type os_profile: ~connected_machine.models.OsProfile + :param parent_cluster_resource_id: The resource id of the parent cluster (Azure HCI) this + machine is assigned to, if any. + :type parent_cluster_resource_id: str + :param private_link_scope_resource_id: The resource id of the private link scope this machine + is assigned to, if any. + :type private_link_scope_resource_id: 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'}, + 'parent_cluster_resource_id': {'key': 'parentClusterResourceId', 'type': 'str'}, + 'private_link_scope_resource_id': {'key': 'privateLinkScopeResourceId', 'type': 'str'}, } def __init__( self, *, location_data: Optional["LocationData"] = None, - vm_id: Optional[str] = None, - client_public_key: Optional[str] = None, + os_profile: Optional["OsProfile"] = None, + parent_cluster_resource_id: Optional[str] = None, + private_link_scope_resource_id: Optional[str] = None, **kwargs ): - super(MachinePropertiesautogenerated, self).__init__(location_data=location_data, vm_id=vm_id, client_public_key=client_public_key, **kwargs) + super(MachineUpdateProperties, self).__init__(**kwargs) + self.location_data = location_data + self.os_profile = os_profile + self.parent_cluster_resource_id = parent_cluster_resource_id + self.private_link_scope_resource_id = private_link_scope_resource_id + + +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 + :param display: Display properties. + :type display: ~connected_machine.models.OperationValueDisplay + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationValueDisplay'}, + } + + def __init__( + self, + *, + display: Optional["OperationValueDisplay"] = None, + **kwargs + ): + super(OperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.display = display + + +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 OsProfile(msrest.serialization.Model): @@ -1261,6 +1289,10 @@ class OsProfile(msrest.serialization.Model): :ivar computer_name: Specifies the host OS name of the hybrid machine. :vartype computer_name: str + :param windows_configuration: Specifies the windows configuration for update management. + :type windows_configuration: ~connected_machine.models.OsProfileWindowsConfiguration + :param linux_configuration: Specifies the linux configuration for update management. + :type linux_configuration: ~connected_machine.models.OsProfileLinuxConfiguration """ _validation = { @@ -1269,305 +1301,526 @@ class OsProfile(msrest.serialization.Model): _attribute_map = { 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'windows_configuration': {'key': 'windowsConfiguration', 'type': 'OsProfileWindowsConfiguration'}, + 'linux_configuration': {'key': 'linuxConfiguration', 'type': 'OsProfileLinuxConfiguration'}, } def __init__( self, + *, + windows_configuration: Optional["OsProfileWindowsConfiguration"] = None, + linux_configuration: Optional["OsProfileLinuxConfiguration"] = None, **kwargs ): super(OsProfile, self).__init__(**kwargs) self.computer_name = None + self.windows_configuration = windows_configuration + self.linux_configuration = linux_configuration -class MachinePropertiesOsProfile(OsProfile): - """Specifies the operating system settings for the hybrid machine. +class OsProfileLinuxConfiguration(msrest.serialization.Model): + """Specifies the linux configuration for update management. + + :param assessment_mode: Specifies the assessment mode. + :type assessment_mode: str + """ + + _attribute_map = { + 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, + } + + def __init__( + self, + *, + assessment_mode: Optional[str] = None, + **kwargs + ): + super(OsProfileLinuxConfiguration, self).__init__(**kwargs) + self.assessment_mode = assessment_mode + + +class OsProfileWindowsConfiguration(msrest.serialization.Model): + """Specifies the windows configuration for update management. + + :param assessment_mode: Specifies the assessment mode. + :type assessment_mode: str + """ + + _attribute_map = { + 'assessment_mode': {'key': 'patchSettings.assessmentMode', 'type': 'str'}, + } + + def __init__( + self, + *, + assessment_mode: Optional[str] = None, + **kwargs + ): + super(OsProfileWindowsConfiguration, self).__init__(**kwargs) + self.assessment_mode = assessment_mode + + +class PrivateEndpointConnection(Resource): + """A private endpoint connection. 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 + :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. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param properties: Resource properties. + :type properties: ~connected_machine.models.PrivateEndpointConnectionProperties + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~connected_machine.models.SystemData """ _validation = { - 'computer_name': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { - 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( self, + *, + properties: Optional["PrivateEndpointConnectionProperties"] = None, **kwargs ): - super(MachinePropertiesOsProfile, self).__init__(**kwargs) + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.properties = properties + self.system_data = None -class MachineUpdate(UpdateResource): - """Describes a hybrid machine Update. +class PrivateEndpointConnectionDataModel(msrest.serialization.Model): + """The Data Model for a Private Endpoint Connection associated with a Private Link Scope. 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 + :ivar id: The ARM Resource Id of the Private Endpoint. + :vartype id: str + :ivar name: The Name of the Private Endpoint. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param properties: The Private Endpoint Connection properties. + :type properties: ~connected_machine.models.PrivateEndpointConnectionProperties """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'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'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, } def __init__( self, *, - tags: Optional[Dict[str, str]] = None, - location_data: Optional["LocationData"] = None, - type: Optional[str] = None, + properties: Optional["PrivateEndpointConnectionProperties"] = 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 + super(PrivateEndpointConnectionDataModel, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties -class MachineUpdateIdentity(Identity): - """Hybrid Compute Machine Managed Identity. +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """A list of private endpoint connections. 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 + :ivar value: Array of results. + :vartype value: list[~connected_machine.models.PrivateEndpointConnection] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PrivateEndpointConnectionProperties(msrest.serialization.Model): + """Properties of a private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param private_endpoint: Private endpoint which the connection belongs to. + :type private_endpoint: ~connected_machine.models.PrivateEndpointProperty + :param private_link_service_connection_state: Connection state of the private endpoint + connection. + :type private_link_service_connection_state: + ~connected_machine.models.PrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the private endpoint connection. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointProperty'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } def __init__( self, *, - type: Optional[str] = None, + private_endpoint: Optional["PrivateEndpointProperty"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionStateProperty"] = None, **kwargs ): - super(MachineUpdateIdentity, self).__init__(type=type, **kwargs) + super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None -class MachineUpdateProperties(msrest.serialization.Model): - """Describes the ARM updatable properties of a hybrid machine. +class PrivateEndpointProperty(msrest.serialization.Model): + """Private endpoint which the connection belongs to. - :param location_data: Metadata pertaining to the geographic location of the resource. - :type location_data: ~connected_machine.models.LocationData + :param id: Resource id of the private endpoint. + :type id: str """ _attribute_map = { - 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, *, - location_data: Optional["LocationData"] = None, + id: Optional[str] = None, **kwargs ): - super(MachineUpdateProperties, self).__init__(**kwargs) - self.location_data = location_data + super(PrivateEndpointProperty, self).__init__(**kwargs) + self.id = id -class MachineUpdatePropertiesautogenerated(MachineUpdateProperties): - """Hybrid Compute Machine properties. +class PrivateLinkResource(Resource): + """A private link resource. - :param location_data: Metadata pertaining to the geographic location of the resource. - :type location_data: ~connected_machine.models.LocationData + 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. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param properties: Resource properties. + :type properties: ~connected_machine.models.PrivateLinkResourceProperties + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~connected_machine.models.SystemData """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + _attribute_map = { - 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( self, *, - location_data: Optional["LocationData"] = None, + properties: Optional["PrivateLinkResourceProperties"] = None, **kwargs ): - super(MachineUpdatePropertiesautogenerated, self).__init__(location_data=location_data, **kwargs) + super(PrivateLinkResource, self).__init__(**kwargs) + self.properties = properties + self.system_data = None -class OperationListResult(msrest.serialization.Model): - """The List Compute Operation operation response. +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. 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] + :ivar value: Array of results. + :vartype value: list[~connected_machine.models.PrivateLinkResource] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str """ _validation = { 'value': {'readonly': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationValue]'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(OperationListResult, self).__init__(**kwargs) + super(PrivateLinkResourceListResult, self).__init__(**kwargs) self.value = None + self.next_link = None -class OperationValue(msrest.serialization.Model): - """Describes the properties of a Compute Operation value. +class PrivateLinkResourceProperties(msrest.serialization.Model): + """Properties of a private link resource. 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 + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :ivar required_zone_names: Required DNS zone names of the the private link resource. + :vartype required_zone_names: list[str] """ _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'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'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', '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 + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None -class OperationValueDisplay(msrest.serialization.Model): - """Describes the properties of a Hybrid Compute Operation Value Display. +class PrivateLinkScopeValidationDetails(msrest.serialization.Model): + """PrivateLinkScopeValidationDetails. 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 + :ivar id: Azure resource Id. + :vartype id: str + :param public_network_access: Indicates whether machines associated with the private link scope + can also use public Azure Arc service endpoints. Possible values include: "Enabled", + "Disabled". Default value: "Disabled". + :type public_network_access: str or ~connected_machine.models.PublicNetworkAccessType + :param connection_details: List of Private Endpoint Connection details. + :type connection_details: list[~connected_machine.models.ConnectionDetail] """ _validation = { - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, + 'id': {'readonly': True}, } _attribute_map = { - 'operation': {'key': 'operation', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'connection_details': {'key': 'connectionDetails', 'type': '[ConnectionDetail]'}, } def __init__( self, + *, + public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = "Disabled", + connection_details: Optional[List["ConnectionDetail"]] = None, **kwargs ): - super(OperationValueDisplay, self).__init__(**kwargs) - self.operation = None - self.resource = None - self.description = None - self.provider = None + super(PrivateLinkScopeValidationDetails, self).__init__(**kwargs) + self.id = None + self.public_network_access = public_network_access + self.connection_details = connection_details -class OperationValueDisplayautogenerated(OperationValueDisplay): - """Display properties. +class PrivateLinkServiceConnectionStateProperty(msrest.serialization.Model): + """State of the private endpoint connection. 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 + All required parameters must be populated in order to send to Azure. + + :param status: Required. The private link service connection status. + :type status: str + :param description: Required. The private link service connection description. + :type description: str + :ivar actions_required: The actions required for private link service connection. + :vartype actions_required: str """ _validation = { - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, + 'status': {'required': True}, + 'description': {'required': True}, + 'actions_required': {'readonly': True}, } _attribute_map = { - 'operation': {'key': 'operation', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, - 'provider': {'key': 'provider', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: str, + description: str, + **kwargs + ): + super(PrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + 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. E.g. "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(ProxyResource, self).__init__(**kwargs) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~connected_machine.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~connected_machine.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } def __init__( self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, **kwargs ): - super(OperationValueDisplayautogenerated, self).__init__(**kwargs) + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TagsResource(msrest.serialization.Model): + """A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. + + :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(TagsResource, self).__init__(**kwargs) + self.tags = tags diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py index 7a5d284a13f..641a5a8b66c 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/__init__.py @@ -6,12 +6,20 @@ # 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 +from ._machines_operations import MachinesOperations +from ._machine_extensions_operations import MachineExtensionsOperations +from ._connected_machine_operations import ConnectedMachineOperationsMixin +from ._operations import Operations +from ._private_link_scopes_operations import PrivateLinkScopesOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations __all__ = [ - 'MachineOperations', - 'MachineExtensionOperations', - 'OperationOperations', + 'MachinesOperations', + 'MachineExtensionsOperations', + 'ConnectedMachineOperationsMixin', + 'Operations', + 'PrivateLinkScopesOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', ] diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py new file mode 100644 index 00000000000..b2ce759835f --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_connected_machine_operations.py @@ -0,0 +1,148 @@ +# 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 ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ConnectedMachineOperationsMixin(object): + + def _upgrade_extensions_initial( + self, + resource_group_name, # type: str + machine_name, # type: str + extension_upgrade_parameters, # type: "models.MachineExtensionUpgrade" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._upgrade_extensions_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_upgrade_parameters, 'MachineExtensionUpgrade') + body_content_kwargs['content'] = body_content + request = self._client.post(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 [202]: + 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, {}) + + _upgrade_extensions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore + + def begin_upgrade_extensions( + self, + resource_group_name, # type: str + machine_name, # type: str + extension_upgrade_parameters, # type: "models.MachineExtensionUpgrade" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to Upgrade Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. + :type machine_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + :type extension_upgrade_parameters: ~connected_machine.models.MachineExtensionUpgrade + :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._upgrade_extensions_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + extension_upgrade_parameters=extension_upgrade_parameters, + 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_upgrade_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions'} # type: ignore 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_extensions_operations.py similarity index 68% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extension_operations.py rename to src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py index 9de22f643e9..77b77d6226d 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extension_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_extensions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, 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 @@ -25,8 +25,8 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -class MachineExtensionOperations(object): - """MachineExtensionOperations operations. +class MachineExtensionsOperations(object): + """MachineExtensionsOperations 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. @@ -50,36 +50,28 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, # type: str - name, # type: str + machine_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_properties_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"] + extension_parameters, # type: "models.MachineExtension" **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 = { + 401: ClientAuthenticationError, 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_properties_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" + api_version = "2021-06-10-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -90,19 +82,19 @@ def _create_or_update_initial( # 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' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -112,59 +104,27 @@ def _create_or_update_initial( 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 + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore def begin_create_or_update( self, resource_group_name, # type: str - name, # type: str + machine_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_properties_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"] + extension_parameters, # type: "models.MachineExtension" **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. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the machine where the extension should be created or updated. - :type name: str + :param machine_name: The name of the machine where the extension should be created or updated. + :type machine_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_properties_type: Specifies the type of the extension; an example is - "CustomScriptExtension". - :type type_properties_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 + :param extension_parameters: Parameters supplied to the Create Machine Extension operation. + :type extension_parameters: ~connected_machine.models.MachineExtension :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 @@ -185,18 +145,9 @@ def begin_create_or_update( if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, - name=name, + machine_name=machine_name, extension_name=extension_name, - location=location, - tags=tags, - force_update_tag=force_update_tag, - publisher=publisher, - type_properties_type=type_properties_type, - type_handler_version=type_handler_version, - auto_upgrade_minor_version=auto_upgrade_minor_version, - settings=settings, - protected_settings=protected_settings, - status=status, + extension_parameters=extension_parameters, cls=lambda x,y,z: x, **kwargs ) @@ -211,7 +162,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -223,39 +181,33 @@ def get_long_running_output(pipeline_response): ) 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 + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore def _update_initial( self, resource_group_name, # type: str - name, # type: str + machine_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] + extension_parameters, # type: "models.MachineExtensionUpdate" **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 = { + 401: ClientAuthenticationError, 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" + api_version = "2021-06-10-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -266,19 +218,19 @@ def _update_initial( # 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' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -288,52 +240,27 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore def begin_update( self, resource_group_name, # type: str - name, # type: str + machine_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] + extension_parameters, # type: "models.MachineExtensionUpdate" **kwargs # type: Any ): # type: (...) -> LROPoller["models.MachineExtension"] - """The operation to update the extension. + """The operation to create or update the extension. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the machine where the extension should be created or updated. - :type name: str + :param machine_name: The name of the machine where the extension should be created or updated. + :type machine_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 + :param extension_parameters: Parameters supplied to the Create Machine Extension operation. + :type extension_parameters: ~connected_machine.models.MachineExtensionUpdate :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 @@ -354,16 +281,9 @@ def begin_update( if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, - name=name, + machine_name=machine_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, + extension_parameters=extension_parameters, cls=lambda x,y,z: x, **kwargs ) @@ -378,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -390,28 +317,31 @@ def get_long_running_output(pipeline_response): ) 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 + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore def _delete_initial( self, resource_group_name, # type: str - name, # type: str + machine_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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" # 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -421,6 +351,7 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -428,27 +359,28 @@ def _delete_initial( 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, 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 + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore def begin_delete( self, resource_group_name, # type: str - name, # type: str + machine_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. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the machine where the extension should be deleted. - :type name: str + :param machine_name: The name of the machine where the extension should be deleted. + :type machine_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 @@ -471,7 +403,7 @@ def begin_delete( if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, - name=name, + machine_name=machine_name, extension_name=extension_name, cls=lambda x,y,z: x, **kwargs @@ -484,7 +416,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -496,22 +435,22 @@ def get_long_running_output(pipeline_response): ) 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 + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore def get( self, resource_group_name, # type: str - name, # type: str + machine_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. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the machine containing the extension. - :type name: str + :param machine_name: The name of the machine containing the extension. + :type machine_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 @@ -520,17 +459,20 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtension"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" # 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -540,7 +482,7 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -548,7 +490,8 @@ def get( 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MachineExtension', pipeline_response) @@ -556,22 +499,22 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'} # type: ignore def list( self, resource_group_name, # type: str - name, # type: str + machine_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. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the machine containing the extension. - :type name: str + :param machine_name: The name of the machine containing the extension. + :type machine_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 @@ -580,22 +523,25 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineExtensionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -625,12 +571,13 @@ def get_next(next_link=None): 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, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, 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 + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/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/_machines_operations.py similarity index 55% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_operations.py rename to src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machines_operations.py index eabd3562611..d52d9c1c7b2 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machine_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_machines_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, 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 @@ -23,8 +23,8 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -class MachineOperations(object): - """MachineOperations operations. +class MachinesOperations(object): + """MachinesOperations 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. @@ -45,35 +45,174 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + def create_or_update( + self, + resource_group_name, # type: str + machine_name, # type: str + parameters, # type: "models.Machine" + **kwargs # type: Any + ): + # type: (...) -> "models.Machine" + """The operation to create or update a hybrid machine resource identity in Azure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. + :type machine_name: str + :param parameters: Parameters supplied to the Create hybrid machine operation. + :type parameters: ~connected_machine.models.Machine + :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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Machine') + 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]: + 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 + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + machine_name, # type: str + parameters, # type: "models.MachineUpdate" + **kwargs # type: Any + ): + # type: (...) -> "models.Machine" + """The operation to update a hybrid machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. + :type machine_name: str + :param parameters: Parameters supplied to the Update hybrid machine operation. + :type parameters: ~connected_machine.models.MachineUpdate + :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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'MachineUpdate') + 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]: + 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 + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore + def delete( self, resource_group_name, # type: str - name, # type: str + machine_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. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the hybrid machine. - :type name: str + :param machine_name: The name of the hybrid machine. + :type machine_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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" # 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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -83,6 +222,7 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -96,22 +236,22 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} # type: ignore + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore def get( self, resource_group_name, # type: str - name, # type: str + machine_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. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param name: The name of the hybrid machine. - :type name: str + :param machine_name: The name of the hybrid machine. + :type machine_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 @@ -120,16 +260,19 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Machine"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" # 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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -141,7 +284,7 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -158,7 +301,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'} # type: ignore def list_by_resource_group( self, @@ -166,9 +309,10 @@ def list_by_resource_group( **kwargs # type: Any ): # type: (...) -> Iterable["models.MachineListResult"] - """Lists all the hybrid machines in the specified resource group. + """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. + :param resource_group_name: The name of the resource group. The name is case insensitive. :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) @@ -176,21 +320,24 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') 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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -234,7 +381,8 @@ def list_by_subscription( **kwargs # type: Any ): # type: (...) -> Iterable["models.MachineListResult"] - """Lists all the hybrid machines in the specified subscription. + """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) @@ -242,20 +390,23 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MachineListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') 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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operation_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py similarity index 89% rename from src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operation_operations.py rename to src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py index 81080b1c7be..f3bfcef08e4 100644 --- a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operation_operations.py +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, 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 @@ -23,8 +23,8 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -class OperationOperations(object): - """OperationOperations operations. +class Operations(object): + """Operations 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. @@ -58,14 +58,17 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-02" + api_version = "2021-06-10-preview" + accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py new file mode 100644 index 00000000000..b9bf818d4bc --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,442 @@ +# 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 ClientAuthenticationError, 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 PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations 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 get( + self, + resource_group_name, # type: str + scope_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~connected_machine.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + scope_name, # type: str + private_endpoint_connection_name, # type: str + parameters, # type: "models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> Optional["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + scope_name, # type: str + private_endpoint_connection_name, # type: str + parameters, # type: "models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.PrivateEndpointConnection"] + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: + :type parameters: ~connected_machine.models.PrivateEndpointConnection + :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 PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~connected_machine.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + 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, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + parameters=parameters, + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + scope_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + scope_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_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, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def list_by_private_link_scope( + self, + resource_group_name, # type: str + scope_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + """Gets all private endpoint connections on a private link scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~connected_machine.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_private_link_scope.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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('PrivateEndpointConnectionListResult', 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_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py new file mode 100644 index 00000000000..8bc4b5ff49e --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_resources_operations.py @@ -0,0 +1,186 @@ +# 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 ClientAuthenticationError, 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 PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations 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_by_private_link_scope( + self, + resource_group_name, # type: str + scope_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.PrivateLinkResourceListResult"] + """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~connected_machine.models.PrivateLinkResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_private_link_scope.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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('PrivateLinkResourceListResult', 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_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources'} # type: ignore + + def get( + self, + resource_group_name, # type: str + scope_name, # type: str + group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateLinkResource" + """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param group_name: The name of the private link resource. + :type group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~connected_machine.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'groupName': self._serialize.url("group_name", 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'} # type: ignore diff --git a/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py new file mode 100644 index 00000000000..c0e63eaeeee --- /dev/null +++ b/src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/operations/_private_link_scopes_operations.py @@ -0,0 +1,624 @@ +# 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 ClientAuthenticationError, 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 PrivateLinkScopesOperations(object): + """PrivateLinkScopesOperations 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.HybridComputePrivateLinkScopeListResult"] + """Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridComputePrivateLinkScopeListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~connected_machine.models.HybridComputePrivateLinkScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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('HybridComputePrivateLinkScopeListResult', 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.HybridComputePrivateLinkScopeListResult"] + """Gets a list of Azure Arc PrivateLinkScopes within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :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 HybridComputePrivateLinkScopeListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~connected_machine.models.HybridComputePrivateLinkScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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('HybridComputePrivateLinkScopeListResult', 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/privateLinkScopes'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + scope_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + scope_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a Azure Arc PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_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, + scope_name=scope_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, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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/privateLinkScopes/{scopeName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + scope_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.HybridComputePrivateLinkScope" + """Returns a Azure Arc PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridComputePrivateLinkScope, or the result of cls(response) + :rtype: ~connected_machine.models.HybridComputePrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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('HybridComputePrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + scope_name, # type: str + parameters, # type: "models.HybridComputePrivateLinkScope" + **kwargs # type: Any + ): + # type: (...) -> "models.HybridComputePrivateLinkScope" + """Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value + for InstrumentationKey nor AppId in the Put operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param parameters: Properties that need to be specified to create or update a Azure Arc for + Servers and Clusters PrivateLinkScope. + :type parameters: ~connected_machine.models.HybridComputePrivateLinkScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridComputePrivateLinkScope, or the result of cls(response) + :rtype: ~connected_machine.models.HybridComputePrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'HybridComputePrivateLinkScope') + 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, 201]: + 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 response.status_code == 200: + deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('HybridComputePrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + scope_name, # type: str + private_link_scope_tags, # type: "models.TagsResource" + **kwargs # type: Any + ): + # type: (...) -> "models.HybridComputePrivateLinkScope" + """Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate + method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_link_scope_tags: Updated tag information to set into the PrivateLinkScope + instance. + :type private_link_scope_tags: ~connected_machine.models.TagsResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridComputePrivateLinkScope, or the result of cls(response) + :rtype: ~connected_machine.models.HybridComputePrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridComputePrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_link_scope_tags, 'TagsResource') + 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]: + 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('HybridComputePrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} # type: ignore + + def get_validation_details( + self, + location, # type: str + private_link_scope_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateLinkScopeValidationDetails" + """Returns a Azure Arc PrivateLinkScope's validation details. + + :param location: The location of the target resource. + :type location: str + :param private_link_scope_id: The id (Guid) of the Azure Arc PrivateLinkScope resource. + :type private_link_scope_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkScopeValidationDetails, or the result of cls(response) + :rtype: ~connected_machine.models.PrivateLinkScopeValidationDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # Construct URL + url = self.get_validation_details.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateLinkScopeId': self._serialize.url("private_link_scope_id", private_link_scope_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'] = self._serialize.header("accept", accept, 'str') + + 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('PrivateLinkScopeValidationDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_validation_details.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/privateLinkScopes/{privateLinkScopeId}'} # type: ignore + + def get_validation_details_for_machine( + self, + resource_group_name, # type: str + machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateLinkScopeValidationDetails" + """Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param machine_name: The name of the target machine to get the private link scope validation + details for. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkScopeValidationDetails, or the result of cls(response) + :rtype: ~connected_machine.models.PrivateLinkScopeValidationDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkScopeValidationDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-10-preview" + accept = "application/json" + + # Construct URL + url = self.get_validation_details_for_machine.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'machineName': self._serialize.url("machine_name", machine_name, 'str', min_length=1), + } + 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'] = self._serialize.header("accept", accept, 'str') + + 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('PrivateLinkScopeValidationDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_validation_details_for_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/privateLinkScopes/current'} # type: ignore diff --git a/src/connectedmachine/report.md b/src/connectedmachine/report.md index ef6bf5d4780..896d2306391 100644 --- a/src/connectedmachine/report.md +++ b/src/connectedmachine/report.md @@ -11,6 +11,10 @@ |---------|------------|--------| |az connectedmachine|Machines|[commands](#CommandsInMachines)| |az connectedmachine extension|MachineExtensions|[commands](#CommandsInMachineExtensions)| +|az connectedmachine||[commands](#CommandsIn)| +|az connectedmachine private-link-scope|PrivateLinkScopes|[commands](#CommandsInPrivateLinkScopes)| +|az connectedmachine private-link-resource|PrivateLinkResources|[commands](#CommandsInPrivateLinkResources)| +|az connectedmachine private-endpoint-connection|PrivateEndpointConnections|[commands](#CommandsInPrivateEndpointConnections)| ## COMMANDS ### Commands in `az connectedmachine` group @@ -21,6 +25,11 @@ |[az connectedmachine show](#MachinesGet)|Get|[Parameters](#ParametersMachinesGet)|[Example](#ExamplesMachinesGet)| |[az connectedmachine delete](#MachinesDelete)|Delete|[Parameters](#ParametersMachinesDelete)|[Example](#ExamplesMachinesDelete)| +### Commands in `az connectedmachine` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az connectedmachine upgrade-extension](#UpgradeExtensions)|UpgradeExtensions|[Parameters](#ParametersUpgradeExtensions)|[Example](#ExamplesUpgradeExtensions)| + ### Commands in `az connectedmachine extension` group |CLI Command|Operation Swagger name|Parameters|Examples| |---------|------------|--------|-----------| @@ -30,6 +39,34 @@ |[az connectedmachine extension update](#MachineExtensionsUpdate)|Update|[Parameters](#ParametersMachineExtensionsUpdate)|[Example](#ExamplesMachineExtensionsUpdate)| |[az connectedmachine extension delete](#MachineExtensionsDelete)|Delete|[Parameters](#ParametersMachineExtensionsDelete)|[Example](#ExamplesMachineExtensionsDelete)| +### Commands in `az connectedmachine private-endpoint-connection` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az connectedmachine private-endpoint-connection list](#PrivateEndpointConnectionsListByPrivateLinkScope)|ListByPrivateLinkScope|[Parameters](#ParametersPrivateEndpointConnectionsListByPrivateLinkScope)|[Example](#ExamplesPrivateEndpointConnectionsListByPrivateLinkScope)| +|[az connectedmachine private-endpoint-connection show](#PrivateEndpointConnectionsGet)|Get|[Parameters](#ParametersPrivateEndpointConnectionsGet)|[Example](#ExamplesPrivateEndpointConnectionsGet)| +|[az connectedmachine private-endpoint-connection create](#PrivateEndpointConnectionsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersPrivateEndpointConnectionsCreateOrUpdate#Create)|[Example](#ExamplesPrivateEndpointConnectionsCreateOrUpdate#Create)| +|[az connectedmachine private-endpoint-connection update](#PrivateEndpointConnectionsCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersPrivateEndpointConnectionsCreateOrUpdate#Update)|Not Found| +|[az connectedmachine private-endpoint-connection delete](#PrivateEndpointConnectionsDelete)|Delete|[Parameters](#ParametersPrivateEndpointConnectionsDelete)|[Example](#ExamplesPrivateEndpointConnectionsDelete)| + +### Commands in `az connectedmachine private-link-resource` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az connectedmachine private-link-resource list](#PrivateLinkResourcesListByPrivateLinkScope)|ListByPrivateLinkScope|[Parameters](#ParametersPrivateLinkResourcesListByPrivateLinkScope)|[Example](#ExamplesPrivateLinkResourcesListByPrivateLinkScope)| +|[az connectedmachine private-link-resource show](#PrivateLinkResourcesGet)|Get|[Parameters](#ParametersPrivateLinkResourcesGet)|[Example](#ExamplesPrivateLinkResourcesGet)| + +### Commands in `az connectedmachine private-link-scope` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az connectedmachine private-link-scope list](#PrivateLinkScopesListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersPrivateLinkScopesListByResourceGroup)|[Example](#ExamplesPrivateLinkScopesListByResourceGroup)| +|[az connectedmachine private-link-scope list](#PrivateLinkScopesList)|List|[Parameters](#ParametersPrivateLinkScopesList)|[Example](#ExamplesPrivateLinkScopesList)| +|[az connectedmachine private-link-scope show](#PrivateLinkScopesGet)|Get|[Parameters](#ParametersPrivateLinkScopesGet)|[Example](#ExamplesPrivateLinkScopesGet)| +|[az connectedmachine private-link-scope create](#PrivateLinkScopesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersPrivateLinkScopesCreateOrUpdate#Create)|[Example](#ExamplesPrivateLinkScopesCreateOrUpdate#Create)| +|[az connectedmachine private-link-scope update](#PrivateLinkScopesCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersPrivateLinkScopesCreateOrUpdate#Update)|[Example](#ExamplesPrivateLinkScopesCreateOrUpdate#Update)| +|[az connectedmachine private-link-scope delete](#PrivateLinkScopesDelete)|Delete|[Parameters](#ParametersPrivateLinkScopesDelete)|[Example](#ExamplesPrivateLinkScopesDelete)| +|[az connectedmachine private-link-scope show-validation-detail](#PrivateLinkScopesGetValidationDetails)|GetValidationDetails|[Parameters](#ParametersPrivateLinkScopesGetValidationDetails)|[Example](#ExamplesPrivateLinkScopesGetValidationDetails)| +|[az connectedmachine private-link-scope show-validation-detail-for-machine](#PrivateLinkScopesGetValidationDetailsForMachine)|GetValidationDetailsForMachine|[Parameters](#ParametersPrivateLinkScopesGetValidationDetailsForMachine)|[Example](#ExamplesPrivateLinkScopesGetValidationDetailsForMachine)| +|[az connectedmachine private-link-scope update-tag](#PrivateLinkScopesUpdateTags)|UpdateTags|[Parameters](#ParametersPrivateLinkScopesUpdateTags)|[Example](#ExamplesPrivateLinkScopesUpdateTags)| + ## COMMAND DETAILS @@ -43,7 +80,7 @@ az connectedmachine list --resource-group "myResourceGroup" ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| #### Command `az connectedmachine list` @@ -63,8 +100,8 @@ az connectedmachine show --name "myMachine" --resource-group "myResourceGroup" ##### 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| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the hybrid machine.|machine_name|machineName| #### Command `az connectedmachine delete` @@ -75,8 +112,24 @@ az connectedmachine delete --name "myMachine" --resource-group "myResourceGroup" ##### 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| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the hybrid machine.|machine_name|machineName| + +### group `az connectedmachine` +#### Command `az connectedmachine upgrade-extension` + +##### Example +``` +az connectedmachine upgrade-extension --extension-targets "{\\"Microsoft.Azure.Monitoring\\":{\\"targetVersion\\":\\"2.\ +0\\"},\\"Microsoft.Compute.CustomScriptExtension\\":{\\"targetVersion\\":\\"1.10\\"}}" --machine-name "myMachine" \ +--resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the hybrid machine.|machine_name|machineName| +|**--extension-targets**|dictionary|Describes the Extension Target Properties.|extension_targets|extensionTargets| ### group `az connectedmachine extension` #### Command `az connectedmachine extension list` @@ -88,38 +141,38 @@ az connectedmachine extension list --machine-name "myMachine" --resource-group " ##### 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| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the machine containing the extension.|machine_name|machineName| |**--expand**|string|The expand expression to apply on the operation.|expand|$expand| #### Command `az connectedmachine extension show` ##### Example ``` -az connectedmachine extension show --machine-name "myMachine" --n "CustomScriptExtension" --resource-group \ +az connectedmachine extension show --n "CustomScriptExtension" --machine-name "myMachine" --resource-group \ "myResourceGroup" ``` ##### 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| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the machine containing the extension.|machine_name|machineName| |**--name**|string|The name of the machine extension.|name|extensionName| #### Command `az connectedmachine extension create` ##### Example ``` -az connectedmachine extension create --machine-name "myMachine" --n "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" +az connectedmachine extension create --n "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" --machine-name \ +"myMachine" --resource-group "myResourceGroup" ``` ##### 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| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the machine where the extension should be created or updated.|machine_name|machineName| |**--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| @@ -130,21 +183,25 @@ az connectedmachine extension create --machine-name "myMachine" --n "CustomScrip |**--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| +|**--properties-instance-view-name**|string|The machine extension name.|machine_name|name| +|**--machine-extension-instance-view-type**|string|Specifies the type of the extension; an example is "CustomScriptExtension".|machine_extension_instance_view_type|type| +|**--machine-extension-instance-view-type-handler-version-type-handler-version**|string|Specifies the version of the script handler.|machine_extension_instance_view_type_handler_version_type_handler_version|typeHandlerVersion| +|**--status**|object|Instance view status.|status|status| #### Command `az connectedmachine extension update` ##### Example ``` -az connectedmachine extension update --machine-name "myMachine" --n "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 \ +az connectedmachine extension update --n "CustomScriptExtension" --type "CustomScriptExtension" --publisher \ +"Microsoft.Compute" --settings "{\\"commandToExecute\\":\\"powershell.exe -c \\\\\\"Get-Process | Where-Object { \ +$_.CPU -lt 100 }\\\\\\"\\"}" --type-handler-version "1.10" --machine-name "myMachine" --resource-group \ "myResourceGroup" ``` ##### 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| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the machine where the extension should be created or updated.|machine_name|machineName| |**--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| @@ -159,11 +216,225 @@ az connectedmachine extension update --machine-name "myMachine" --n "CustomScrip ##### Example ``` -az connectedmachine extension delete --machine-name "myMachine" --n "MMA" --resource-group "myResourceGroup" +az connectedmachine extension delete --n "MMA" --machine-name "myMachine" --resource-group "myResourceGroup" ``` ##### 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| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the machine where the extension should be deleted.|machine_name|machineName| |**--name**|string|The name of the machine extension.|name|extensionName| + +### group `az connectedmachine private-endpoint-connection` +#### Command `az connectedmachine private-endpoint-connection list` + +##### Example +``` +az connectedmachine private-endpoint-connection list --resource-group "myResourceGroup" --scope-name \ +"myPrivateLinkScope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| + +#### Command `az connectedmachine private-endpoint-connection show` + +##### Example +``` +az connectedmachine private-endpoint-connection show --name "private-endpoint-connection-name" --resource-group \ +"myResourceGroup" --scope-name "myPrivateLinkScope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| +|**--private-endpoint-connection-name**|string|The name of the private endpoint connection.|private_endpoint_connection_name|privateEndpointConnectionName| + +#### Command `az connectedmachine private-endpoint-connection create` + +##### Example +``` +az connectedmachine private-endpoint-connection create --private-link-service-connection-state description="Approved \ +by johndoe@contoso.com" status="Approved" --name "private-endpoint-connection-name" --resource-group "myResourceGroup" \ +--scope-name "myPrivateLinkScope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| +|**--private-endpoint-connection-name**|string|The name of the private endpoint connection.|private_endpoint_connection_name|privateEndpointConnectionName| +|**--private-link-service-connection-state**|object|Connection state of the private endpoint connection.|private_link_service_connection_state|privateLinkServiceConnectionState| +|**--id**|string|Resource id of the private endpoint.|id|id| + +#### Command `az connectedmachine private-endpoint-connection update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| +|**--private-endpoint-connection-name**|string|The name of the private endpoint connection.|private_endpoint_connection_name|privateEndpointConnectionName| +|**--private-link-service-connection-state**|object|Connection state of the private endpoint connection.|private_link_service_connection_state|privateLinkServiceConnectionState| +|**--id**|string|Resource id of the private endpoint.|id|id| + +#### Command `az connectedmachine private-endpoint-connection delete` + +##### Example +``` +az connectedmachine private-endpoint-connection delete --name "private-endpoint-connection-name" --resource-group \ +"myResourceGroup" --scope-name "myPrivateLinkScope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| +|**--private-endpoint-connection-name**|string|The name of the private endpoint connection.|private_endpoint_connection_name|privateEndpointConnectionName| + +### group `az connectedmachine private-link-resource` +#### Command `az connectedmachine private-link-resource list` + +##### Example +``` +az connectedmachine private-link-resource list --resource-group "myResourceGroup" --scope-name "myPrivateLinkScope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| + +#### Command `az connectedmachine private-link-resource show` + +##### Example +``` +az connectedmachine private-link-resource show --group-name "hybridcompute" --resource-group "myResourceGroup" \ +--scope-name "myPrivateLinkScope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| +|**--group-name**|string|The name of the private link resource.|group_name|groupName| + +### group `az connectedmachine private-link-scope` +#### Command `az connectedmachine private-link-scope list` + +##### Example +``` +az connectedmachine private-link-scope list --resource-group "my-resource-group" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| + +#### Command `az connectedmachine private-link-scope list` + +##### Example +``` +az connectedmachine private-link-scope list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az connectedmachine private-link-scope show` + +##### Example +``` +az connectedmachine private-link-scope show --resource-group "my-resource-group" --scope-name "my-privatelinkscope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| + +#### Command `az connectedmachine private-link-scope create` + +##### Example +``` +az connectedmachine private-link-scope create --location "westus" --resource-group "my-resource-group" --scope-name \ +"my-privatelinkscope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| +|**--location**|string|Resource location|location|location| +|**--tags**|dictionary|Resource tags|tags|tags| +|**--public-network-access**|choice|Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints.|public_network_access|publicNetworkAccess| + +#### Command `az connectedmachine private-link-scope update` + +##### Example +``` +az connectedmachine private-link-scope update --location "westus" --tags Tag1="Value1" --resource-group \ +"my-resource-group" --scope-name "my-privatelinkscope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| +|**--location**|string|Resource location|location|location| +|**--tags**|dictionary|Resource tags|tags|tags| +|**--public-network-access**|choice|Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints.|public_network_access|publicNetworkAccess| + +#### Command `az connectedmachine private-link-scope delete` + +##### Example +``` +az connectedmachine private-link-scope delete --resource-group "my-resource-group" --scope-name "my-privatelinkscope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| + +#### Command `az connectedmachine private-link-scope show-validation-detail` + +##### Example +``` +az connectedmachine private-link-scope show-validation-detail --location "wus2" --private-link-scope-id \ +"f5dc51d3-92ed-4d7e-947a-775ea79b4919" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--location**|string|The location of the target resource.|location|location| +|**--private-link-scope-id**|string|The id (Guid) of the Azure Arc PrivateLinkScope resource.|private_link_scope_id|privateLinkScopeId| + +#### Command `az connectedmachine private-link-scope show-validation-detail-for-machine` + +##### Example +``` +az connectedmachine private-link-scope show-validation-detail-for-machine --machine-name "machineName" \ +--resource-group "my-resource-group" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--machine-name**|string|The name of the target machine to get the private link scope validation details for.|machine_name|machineName| + +#### Command `az connectedmachine private-link-scope update-tag` + +##### Example +``` +az connectedmachine private-link-scope update-tag --tags Tag1="Value1" Tag2="Value2" --resource-group \ +"my-resource-group" --scope-name "my-privatelinkscope" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--scope-name**|string|The name of the Azure Arc PrivateLinkScope resource.|scope_name|scopeName| +|**--tags**|dictionary|Resource tags|tags|tags| diff --git a/src/connectedmachine/setup.py b/src/connectedmachine/setup.py index e18885c0d90..e0725124d3c 100644 --- a/src/connectedmachine/setup.py +++ b/src/connectedmachine/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # HISTORY.rst entry. -VERSION = '0.3.0' +VERSION = '0.1.0' try: from azext_connectedmachine.manual.version import VERSION except ImportError: