From 99c32707af20a163b3f688a387ddde506b7573f0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 24 Oct 2024 18:02:05 +0000 Subject: [PATCH] CodeGen from PR 30656 in Azure/azure-rest-api-specs Merge 59af810c368e80eb87b9bb753e71ea8c90feae28 into e86928846c2ed989d11cba4f9096819cce9c5baa --- .../azure-mgmt-hybridcompute/_meta.json | 4 +- .../mgmt/hybridcompute/_configuration.py | 6 +- .../_hybrid_compute_management_client.py | 35 +- .../azure/mgmt/hybridcompute/_version.py | 2 +- .../mgmt/hybridcompute/aio/_configuration.py | 6 +- .../aio/_hybrid_compute_management_client.py | 37 +- .../hybridcompute/aio/operations/__init__.py | 12 + .../_extension_metadata_v2_operations.py | 205 ++ .../_extension_publisher_operations.py | 134 ++ .../operations/_extension_type_operations.py | 136 ++ .../aio/operations/_gateways_operations.py | 713 ++++++ ...id_compute_management_client_operations.py | 209 +- .../_machine_extensions_operations.py | 6 +- .../_machine_run_commands_operations.py | 552 +++++ .../aio/operations/_settings_operations.py | 448 ++++ .../mgmt/hybridcompute/models/__init__.py | 70 + ..._hybrid_compute_management_client_enums.py | 18 + .../mgmt/hybridcompute/models/_models_py3.py | 1913 +++++++++++++++-- .../mgmt/hybridcompute/operations/__init__.py | 12 + .../_extension_metadata_operations.py | 4 +- .../_extension_metadata_v2_operations.py | 265 +++ .../_extension_publisher_operations.py | 160 ++ .../operations/_extension_type_operations.py | 166 ++ .../operations/_gateways_operations.py | 895 ++++++++ ...id_compute_management_client_operations.py | 241 ++- .../_license_profiles_operations.py | 10 +- .../operations/_licenses_operations.py | 14 +- .../_machine_extensions_operations.py | 16 +- .../_machine_run_commands_operations.py | 687 ++++++ .../operations/_machines_operations.py | 12 +- .../operations/_network_profile_operations.py | 2 +- ...ity_perimeter_configurations_operations.py | 6 +- .../hybridcompute/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 8 +- .../_private_link_resources_operations.py | 4 +- .../_private_link_scopes_operations.py | 20 +- .../operations/_settings_operations.py | 601 ++++++ .../extension/extension_create_or_update.py | 2 +- .../extension/extension_delete.py | 2 +- .../extension/extension_get.py | 2 +- .../extension/extension_list.py | 2 +- .../extension/extension_metadata_get.py | 2 +- .../extension/extension_metadata_list.py | 2 +- .../extension/extension_metadata_v2_get.py | 44 + .../extension/extension_metadata_v2_list.py | 44 + .../extension/extension_publisher_list.py | 42 + .../extension/extension_setup.py | 48 + .../extension/extension_type_list.py | 43 + .../extension/extension_update.py | 2 +- .../extension/extensions_upgrade.py | 2 +- .../gateway/gateway_create_or_update.py | 43 + .../gateway/gateway_delete.py | 41 + .../generated_samples/gateway/gateway_get.py | 42 + .../gateway/gateway_list_by_resource_group.py | 42 + .../gateway/gateway_list_by_subscription.py | 40 + .../gateway/gateway_update.py | 43 + .../license/license_create_or_update.py | 2 +- .../license/license_delete.py | 2 +- .../generated_samples/license/license_get.py | 2 +- .../license/license_list_by_resource_group.py | 2 +- .../license/license_list_by_subscription.py | 2 +- .../license/license_update.py | 2 +- .../license/license_validate_license.py | 2 +- .../license_profile_create_or_update.py | 2 +- .../license_profile/license_profile_delete.py | 2 +- .../license_profile/license_profile_get.py | 2 +- .../license_profile/license_profile_list.py | 2 +- .../license_profile/license_profile_update.py | 2 +- .../machine/machine_assess_patches.py | 2 +- .../machine/machine_install_patches.py | 2 +- .../machine/machines_delete.py | 2 +- .../generated_samples/machine/machines_get.py | 2 +- ...hines_get_license_profile_instance_view.py | 2 +- .../machines_list_by_resource_group.py | 2 +- .../machine/machines_list_by_subscription.py | 2 +- .../generated_samples/network_profile_get.py | 2 +- ...rk_security_perimeter_configuration_get.py | 2 +- ...k_security_perimeter_configuration_list.py | 2 +- ...urity_perimeter_configuration_reconcile.py | 2 +- .../generated_samples/operations_list.py | 2 +- .../private_endpoint_connection_delete.py | 2 +- .../private_endpoint_connection_get.py | 2 +- .../private_endpoint_connection_list.py | 2 +- .../private_endpoint_connection_update.py | 2 +- ...te_link_scope_private_link_resource_get.py | 2 +- ...nk_scope_private_link_resource_list_get.py | 2 +- .../private_link_scopes_create.py | 2 +- .../private_link_scopes_delete.py | 2 +- .../private_link_scopes_get.py | 2 +- .../private_link_scopes_get_validation.py | 2 +- ..._link_scopes_get_validation_for_machine.py | 2 +- .../private_link_scopes_list.py | 2 +- ...vate_link_scopes_list_by_resource_group.py | 2 +- .../private_link_scopes_update.py | 2 +- .../run_commands_create_or_update.py | 56 + .../run_command/run_commands_delete.py | 42 + .../run_command/run_commands_get.py | 43 + .../run_command/run_commands_list.py | 43 + .../settings/settings_get.py | 45 + .../settings/settings_patch.py | 52 + .../settings/settings_update.py | 52 + .../test_hybrid_compute_management.py | 41 +- .../test_hybrid_compute_management_async.py | 43 +- ...anagement_extension_metadata_operations.py | 4 +- ...ent_extension_metadata_operations_async.py | 4 +- ...gement_extension_metadata_v2_operations.py | 46 + ..._extension_metadata_v2_operations_async.py | 47 + ...nagement_extension_publisher_operations.py | 30 + ...nt_extension_publisher_operations_async.py | 31 + ...te_management_extension_type_operations.py | 31 + ...agement_extension_type_operations_async.py | 32 + ..._compute_management_gateways_operations.py | 12 +- ...te_management_gateways_operations_async.py | 12 +- ..._management_license_profiles_operations.py | 10 +- ...ement_license_profiles_operations_async.py | 10 +- ..._compute_management_licenses_operations.py | 14 +- ...te_management_licenses_operations_async.py | 14 +- ...anagement_machine_extensions_operations.py | 10 +- ...ent_machine_extensions_operations_async.py | 10 +- ...agement_machine_run_commands_operations.py | 8 +- ...t_machine_run_commands_operations_async.py | 8 +- ..._compute_management_machines_operations.py | 12 +- ...te_management_machines_operations_async.py | 12 +- ...e_management_network_profile_operations.py | 2 +- ...gement_network_profile_operations_async.py | 2 +- ...ity_perimeter_configurations_operations.py | 6 +- ...rimeter_configurations_operations_async.py | 6 +- ...st_hybrid_compute_management_operations.py | 2 +- ...rid_compute_management_operations_async.py | 2 +- ...private_endpoint_connections_operations.py | 8 +- ...e_endpoint_connections_operations_async.py | 8 +- ...ement_private_link_resources_operations.py | 4 +- ...private_link_resources_operations_async.py | 4 +- ...nagement_private_link_scopes_operations.py | 16 +- ...nt_private_link_scopes_operations_async.py | 16 +- ..._compute_management_settings_operations.py | 6 +- ...te_management_settings_operations_async.py | 6 +- 137 files changed, 8640 insertions(+), 417 deletions(-) create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_v2_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_publisher_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_type_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_gateways_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_run_commands_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_settings_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_v2_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_publisher_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_type_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_gateways_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_run_commands_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_settings_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_get.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_list.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_publisher_list.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_setup.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_type_list.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_create_or_update.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_delete.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_get.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_resource_group.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_subscription.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_update.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_create_or_update.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_delete.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_get.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_list.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_get.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_patch.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_update.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations_async.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations_async.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations_async.py diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json b/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json index 7770c339077d3..576de2d6f2a8a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/_meta.json @@ -1,11 +1,11 @@ { - "commit": "c3f246bece34c122def67e59945e634490f205fe", + "commit": "d8830646770fa8a93e5df1af382856f207ec3d9e", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ "@autorest/python@6.19.0", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/hybridcompute/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-2024-07 --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/hybridcompute/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/hybridcompute/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py index 7e92a544711fd..986047247a1a6 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py @@ -28,13 +28,13 @@ class HybridComputeManagementClientConfiguration: # pylint: disable=too-many-in :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-07-10". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-09-10-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-07-10") + api_version: str = kwargs.pop("api_version", "2024-09-10-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py index c8d95eb467539..c2bee35a2bdda 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py @@ -20,10 +20,15 @@ from ._serialization import Deserializer, Serializer from .operations import ( ExtensionMetadataOperations, + ExtensionMetadataV2Operations, + ExtensionPublisherOperations, + ExtensionTypeOperations, + GatewaysOperations, HybridComputeManagementClientOperationsMixin, LicenseProfilesOperations, LicensesOperations, MachineExtensionsOperations, + MachineRunCommandsOperations, MachinesOperations, NetworkProfileOperations, NetworkSecurityPerimeterConfigurationsOperations, @@ -31,6 +36,7 @@ PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, PrivateLinkScopesOperations, + SettingsOperations, ) if TYPE_CHECKING: @@ -53,10 +59,23 @@ class HybridComputeManagementClient( :vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations :ivar extension_metadata: ExtensionMetadataOperations operations :vartype extension_metadata: azure.mgmt.hybridcompute.operations.ExtensionMetadataOperations + :ivar extension_metadata_v2: ExtensionMetadataV2Operations operations + :vartype extension_metadata_v2: + azure.mgmt.hybridcompute.operations.ExtensionMetadataV2Operations + :ivar extension_type: ExtensionTypeOperations operations + :vartype extension_type: azure.mgmt.hybridcompute.operations.ExtensionTypeOperations + :ivar extension_publisher: ExtensionPublisherOperations operations + :vartype extension_publisher: azure.mgmt.hybridcompute.operations.ExtensionPublisherOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.hybridcompute.operations.Operations :ivar network_profile: NetworkProfileOperations operations :vartype network_profile: azure.mgmt.hybridcompute.operations.NetworkProfileOperations + :ivar machine_run_commands: MachineRunCommandsOperations operations + :vartype machine_run_commands: azure.mgmt.hybridcompute.operations.MachineRunCommandsOperations + :ivar gateways: GatewaysOperations operations + :vartype gateways: azure.mgmt.hybridcompute.operations.GatewaysOperations + :ivar settings: SettingsOperations operations + :vartype settings: azure.mgmt.hybridcompute.operations.SettingsOperations :ivar private_link_scopes: PrivateLinkScopesOperations operations :vartype private_link_scopes: azure.mgmt.hybridcompute.operations.PrivateLinkScopesOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations @@ -75,8 +94,8 @@ class HybridComputeManagementClient( :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-07-10". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-09-10-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -127,8 +146,20 @@ def __init__( self.extension_metadata = ExtensionMetadataOperations( self._client, self._config, self._serialize, self._deserialize ) + self.extension_metadata_v2 = ExtensionMetadataV2Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.extension_type = ExtensionTypeOperations(self._client, self._config, self._serialize, self._deserialize) + self.extension_publisher = ExtensionPublisherOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.network_profile = NetworkProfileOperations(self._client, self._config, self._serialize, self._deserialize) + self.machine_run_commands = MachineRunCommandsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.gateways = GatewaysOperations(self._client, self._config, self._serialize, self._deserialize) + self.settings = SettingsOperations(self._client, self._config, self._serialize, self._deserialize) self.private_link_scopes = PrivateLinkScopesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py index b77ac9246082f..e5754a47ce68f 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "9.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py index 3afbfbc680b68..0fe0aa0b894c1 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py @@ -28,13 +28,13 @@ class HybridComputeManagementClientConfiguration: # pylint: disable=too-many-in :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-07-10". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-09-10-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-07-10") + api_version: str = kwargs.pop("api_version", "2024-09-10-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py index ab2176b0c7cdf..2627838724694 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_hybrid_compute_management_client.py @@ -20,10 +20,15 @@ from ._configuration import HybridComputeManagementClientConfiguration from .operations import ( ExtensionMetadataOperations, + ExtensionMetadataV2Operations, + ExtensionPublisherOperations, + ExtensionTypeOperations, + GatewaysOperations, HybridComputeManagementClientOperationsMixin, LicenseProfilesOperations, LicensesOperations, MachineExtensionsOperations, + MachineRunCommandsOperations, MachinesOperations, NetworkProfileOperations, NetworkSecurityPerimeterConfigurationsOperations, @@ -31,6 +36,7 @@ PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, PrivateLinkScopesOperations, + SettingsOperations, ) if TYPE_CHECKING: @@ -55,10 +61,25 @@ class HybridComputeManagementClient( :ivar extension_metadata: ExtensionMetadataOperations operations :vartype extension_metadata: azure.mgmt.hybridcompute.aio.operations.ExtensionMetadataOperations + :ivar extension_metadata_v2: ExtensionMetadataV2Operations operations + :vartype extension_metadata_v2: + azure.mgmt.hybridcompute.aio.operations.ExtensionMetadataV2Operations + :ivar extension_type: ExtensionTypeOperations operations + :vartype extension_type: azure.mgmt.hybridcompute.aio.operations.ExtensionTypeOperations + :ivar extension_publisher: ExtensionPublisherOperations operations + :vartype extension_publisher: + azure.mgmt.hybridcompute.aio.operations.ExtensionPublisherOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.hybridcompute.aio.operations.Operations :ivar network_profile: NetworkProfileOperations operations :vartype network_profile: azure.mgmt.hybridcompute.aio.operations.NetworkProfileOperations + :ivar machine_run_commands: MachineRunCommandsOperations operations + :vartype machine_run_commands: + azure.mgmt.hybridcompute.aio.operations.MachineRunCommandsOperations + :ivar gateways: GatewaysOperations operations + :vartype gateways: azure.mgmt.hybridcompute.aio.operations.GatewaysOperations + :ivar settings: SettingsOperations operations + :vartype settings: azure.mgmt.hybridcompute.aio.operations.SettingsOperations :ivar private_link_scopes: PrivateLinkScopesOperations operations :vartype private_link_scopes: azure.mgmt.hybridcompute.aio.operations.PrivateLinkScopesOperations @@ -78,8 +99,8 @@ class HybridComputeManagementClient( :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-07-10". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-09-10-preview". Note that overriding + this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -130,8 +151,20 @@ def __init__( self.extension_metadata = ExtensionMetadataOperations( self._client, self._config, self._serialize, self._deserialize ) + self.extension_metadata_v2 = ExtensionMetadataV2Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.extension_type = ExtensionTypeOperations(self._client, self._config, self._serialize, self._deserialize) + self.extension_publisher = ExtensionPublisherOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.network_profile = NetworkProfileOperations(self._client, self._config, self._serialize, self._deserialize) + self.machine_run_commands = MachineRunCommandsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.gateways = GatewaysOperations(self._client, self._config, self._serialize, self._deserialize) + self.settings = SettingsOperations(self._client, self._config, self._serialize, self._deserialize) self.private_link_scopes = PrivateLinkScopesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py index 83cdf6243d70a..dd6e6ab896437 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/__init__.py @@ -12,8 +12,14 @@ from ._machine_extensions_operations import MachineExtensionsOperations from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin from ._extension_metadata_operations import ExtensionMetadataOperations +from ._extension_metadata_v2_operations import ExtensionMetadataV2Operations +from ._extension_type_operations import ExtensionTypeOperations +from ._extension_publisher_operations import ExtensionPublisherOperations from ._operations import Operations from ._network_profile_operations import NetworkProfileOperations +from ._machine_run_commands_operations import MachineRunCommandsOperations +from ._gateways_operations import GatewaysOperations +from ._settings_operations import SettingsOperations from ._private_link_scopes_operations import PrivateLinkScopesOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations @@ -30,8 +36,14 @@ "MachineExtensionsOperations", "HybridComputeManagementClientOperationsMixin", "ExtensionMetadataOperations", + "ExtensionMetadataV2Operations", + "ExtensionTypeOperations", + "ExtensionPublisherOperations", "Operations", "NetworkProfileOperations", + "MachineRunCommandsOperations", + "GatewaysOperations", + "SettingsOperations", "PrivateLinkScopesOperations", "PrivateLinkResourcesOperations", "PrivateEndpointConnectionsOperations", diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_v2_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_v2_operations.py new file mode 100644 index 0000000000000..83113a084e6e6 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_metadata_v2_operations.py @@ -0,0 +1,205 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ...operations._extension_metadata_v2_operations import build_get_request, build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExtensionMetadataV2Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`extension_metadata_v2` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, location: str, publisher: str, extension_type: str, version: str, **kwargs: Any + ) -> _models.ExtensionValueV2: + """Gets an Extension Metadata based on location, publisher, extensionType and version. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :param version: The version of the Extension being received. Required. + :type version: str + :return: ExtensionValueV2 or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.ExtensionValueV2 + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionValueV2] = kwargs.pop("cls", None) + + _request = build_get_request( + location=location, + publisher=publisher, + extension_type=extension_type, + version=version, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExtensionValueV2", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, location: str, publisher: str, extension_type: str, **kwargs: Any + ) -> AsyncIterable["_models.ExtensionValueV2"]: + """Gets all Extension versions based on location, publisher, extensionType. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :return: An iterator like instance of either ExtensionValueV2 or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.ExtensionValueV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionValueListResultV2] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + publisher=publisher, + extension_type=extension_type, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionValueListResultV2", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_publisher_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_publisher_operations.py new file mode 100644 index 0000000000000..a46f45b351649 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_publisher_operations.py @@ -0,0 +1,134 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ...operations._extension_publisher_operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExtensionPublisherOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`extension_publisher` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ExtensionPublisher"]: + """Gets all Extension publishers based on the location. + + :param location: The name of Azure region. Required. + :type location: str + :return: An iterator like instance of either ExtensionPublisher or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.ExtensionPublisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionPublisherListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionPublisherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_type_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_type_operations.py new file mode 100644 index 0000000000000..4de4dd1348ac2 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_extension_type_operations.py @@ -0,0 +1,136 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ...operations._extension_type_operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExtensionTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`extension_type` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, location: str, publisher: str, **kwargs: Any) -> AsyncIterable["_models.ExtensionType"]: + """Gets all Extension types based on location and publisher. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :return: An iterator like instance of either ExtensionType or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.ExtensionType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionTypeListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + publisher=publisher, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionTypeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_gateways_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_gateways_operations.py new file mode 100644 index 0000000000000..9e226434437cd --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_gateways_operations.py @@ -0,0 +1,713 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 io import IOBase +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ...operations._gateways_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_update_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class GatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _create_or_update_initial( + self, resource_group_name: str, gateway_name: str, parameters: Union[_models.Gateway, IO[bytes]], **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Gateway") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + parameters: _models.Gateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Gateway]: + """The operation to create or update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Create gateway operation. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Gateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Gateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.Gateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Gateway]: + """The operation to create or update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Create gateway operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Gateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.Gateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, resource_group_name: str, gateway_name: str, parameters: Union[_models.Gateway, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[_models.Gateway]: + """The operation to create or update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Create gateway operation. Is either a Gateway + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Gateway or IO[bytes] + :return: An instance of AsyncLROPoller that returns either Gateway or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.Gateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Gateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Gateway", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Gateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Gateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_group_name: str, + gateway_name: str, + parameters: _models.GatewayUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Gateway: + """The operation to update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Update gateway operation. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.GatewayUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Gateway or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Gateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Gateway: + """The operation to update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Update gateway operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Gateway or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Gateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + gateway_name: str, + parameters: Union[_models.GatewayUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.Gateway: + """The operation to update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Update gateway operation. Is either a + GatewayUpdate type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.GatewayUpdate or IO[bytes] + :return: Gateway or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Gateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Gateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "GatewayUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Gateway", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _models.Gateway: + """Retrieves information about the view of a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :return: Gateway or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Gateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Gateway] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Gateway", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """The operation to delete a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Gateway"]: + """The operation to get all gateways of a non-Azure machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either Gateway or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.Gateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.GatewaysListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("GatewaysListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Gateway"]: + """The operation to get all gateways of a non-Azure machine. + + :return: An iterator like instance of either Gateway or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.Gateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.GatewaysListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("GatewaysListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py index d3af83dd2329b..0e7d0d849881d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_hybrid_compute_management_client_operations.py @@ -29,7 +29,10 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ...operations._hybrid_compute_management_client_operations import build_upgrade_extensions_request +from ...operations._hybrid_compute_management_client_operations import ( + build_setup_extensions_request, + build_upgrade_extensions_request, +) from .._vendor import HybridComputeManagementClientMixinABC if sys.version_info >= (3, 9): @@ -240,3 +243,207 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _setup_extensions_initial( + self, + resource_group_name: str, + machine_name: str, + extension_setup_body: Union[_models.MachineExtensionSetup, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(extension_setup_body, (IOBase, bytes)): + _content = extension_setup_body + else: + _json = self._serialize.body(extension_setup_body, "MachineExtensionSetup") + + _request = build_setup_extensions_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extension_setup_body: _models.MachineExtensionSetup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MachineExtensionSetup]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extension_setup_body: Parameters supplied to the Setup Extensions operation. Required. + :type extension_setup_body: ~azure.mgmt.hybridcompute.models.MachineExtensionSetup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either MachineExtensionSetup or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineExtensionSetup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extension_setup_body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MachineExtensionSetup]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extension_setup_body: Parameters supplied to the Setup Extensions operation. Required. + :type extension_setup_body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either MachineExtensionSetup or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineExtensionSetup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extension_setup_body: Union[_models.MachineExtensionSetup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MachineExtensionSetup]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extension_setup_body: Parameters supplied to the Setup Extensions operation. Is either a + MachineExtensionSetup type or a IO[bytes] type. Required. + :type extension_setup_body: ~azure.mgmt.hybridcompute.models.MachineExtensionSetup or IO[bytes] + :return: An instance of AsyncLROPoller that returns either MachineExtensionSetup or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineExtensionSetup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MachineExtensionSetup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._setup_extensions_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + extension_setup_body=extension_setup_body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MachineExtensionSetup", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MachineExtensionSetup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MachineExtensionSetup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py index a230b9a7e3246..f3b3dc65e2a94 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_extensions_operations.py @@ -365,7 +365,7 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> 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. The name is case insensitive. Required. @@ -398,7 +398,7 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> 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. The name is case insensitive. Required. @@ -429,7 +429,7 @@ async def begin_update( extension_parameters: Union[_models.MachineExtensionUpdate, IO[bytes]], **kwargs: Any ) -> 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. The name is case insensitive. Required. diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_run_commands_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_run_commands_operations.py new file mode 100644 index 0000000000000..28fedffa71000 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_machine_run_commands_operations.py @@ -0,0 +1,552 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 io import IOBase +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ...operations._machine_run_commands_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class MachineRunCommandsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`machine_run_commands` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _create_or_update_initial( + self, + resource_group_name: str, + machine_name: str, + run_command_name: str, + run_command_properties: Union[_models.MachineRunCommand, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(run_command_properties, (IOBase, bytes)): + _content = run_command_properties + else: + _json = self._serialize.body(run_command_properties, "MachineRunCommand") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + run_command_name=run_command_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + machine_name: str, + run_command_name: str, + run_command_properties: _models.MachineRunCommand, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MachineRunCommand]: + """The operation to create or update a run command. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param run_command_name: The name of the run command. Required. + :type run_command_name: str + :param run_command_properties: Parameters supplied to the Create Run Command. Required. + :type run_command_properties: ~azure.mgmt.hybridcompute.models.MachineRunCommand + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either MachineRunCommand or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + machine_name: str, + run_command_name: str, + run_command_properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MachineRunCommand]: + """The operation to create or update a run command. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param run_command_name: The name of the run command. Required. + :type run_command_name: str + :param run_command_properties: Parameters supplied to the Create Run Command. Required. + :type run_command_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either MachineRunCommand or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + machine_name: str, + run_command_name: str, + run_command_properties: Union[_models.MachineRunCommand, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MachineRunCommand]: + """The operation to create or update a run command. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param run_command_name: The name of the run command. Required. + :type run_command_name: str + :param run_command_properties: Parameters supplied to the Create Run Command. Is either a + MachineRunCommand type or a IO[bytes] type. Required. + :type run_command_properties: ~azure.mgmt.hybridcompute.models.MachineRunCommand or IO[bytes] + :return: An instance of AsyncLROPoller that returns either MachineRunCommand or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridcompute.models.MachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MachineRunCommand] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + run_command_name=run_command_name, + run_command_properties=run_command_properties, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MachineRunCommand", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MachineRunCommand].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MachineRunCommand]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, machine_name: str, run_command_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + run_command_name=run_command_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, machine_name: str, run_command_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete a run command. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param run_command_name: The name of the run command. Required. + :type run_command_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + run_command_name=run_command_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, machine_name: str, run_command_name: str, **kwargs: Any + ) -> _models.MachineRunCommand: + """The operation to get a run command. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param run_command_name: The name of the run command. Required. + :type run_command_name: str + :return: MachineRunCommand or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.MachineRunCommand + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.MachineRunCommand] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + run_command_name=run_command_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MachineRunCommand", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, machine_name: str, expand: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.MachineRunCommand"]: + """The operation to get all the run commands of a non-Azure machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param expand: The expand expression to apply on the operation. Default value is None. + :type expand: str + :return: An iterator like instance of either MachineRunCommand or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridcompute.models.MachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.MachineRunCommandsListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MachineRunCommandsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_settings_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_settings_operations.py new file mode 100644 index 0000000000000..871de0b1ec6b5 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/operations/_settings_operations.py @@ -0,0 +1,448 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ...operations._settings_operations import build_get_request, build_patch_request, build_update_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.aio.HybridComputeManagementClient`'s + :attr:`settings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + **kwargs: Any + ) -> _models.Settings: + """Returns the base Settings for the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Settings] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + base_provider=base_provider, + base_resource_type=base_resource_type, + base_resource_name=base_resource_name, + settings_resource_name=settings_resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Settings", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: _models.Settings, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Settings: + """Updates the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Settings + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Settings: + """Updates the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: Union[_models.Settings, IO[bytes]], + **kwargs: Any + ) -> _models.Settings: + """Updates the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Is either a Settings type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Settings or IO[bytes] + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Settings] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Settings") + + _request = build_update_request( + resource_group_name=resource_group_name, + base_provider=base_provider, + base_resource_type=base_resource_type, + base_resource_name=base_resource_name, + settings_resource_name=settings_resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Settings", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def patch( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: _models.Settings, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Settings: + """Update the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Settings + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def patch( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Settings: + """Update the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def patch( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: Union[_models.Settings, IO[bytes]], + **kwargs: Any + ) -> _models.Settings: + """Update the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Is either a Settings type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Settings or IO[bytes] + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Settings] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Settings") + + _request = build_patch_request( + resource_group_name=resource_group_name, + base_provider=base_provider, + base_resource_type=base_resource_type, + base_resource_name=base_resource_name, + settings_resource_name=settings_resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Settings", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py index 4ae2e9b455c5a..3c2855ceada0c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py @@ -9,21 +9,41 @@ from ._models_py3 import AccessRule from ._models_py3 import AgentConfiguration from ._models_py3 import AgentUpgrade +from ._models_py3 import AgentVersion +from ._models_py3 import AgentVersionsList from ._models_py3 import AvailablePatchCountByClassification from ._models_py3 import CloudMetadata from ._models_py3 import ConfigurationExtension from ._models_py3 import ConnectionDetail +from ._models_py3 import Disk from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorDetailAutoGenerated from ._models_py3 import ErrorResponse +from ._models_py3 import ErrorResponseAutoGenerated from ._models_py3 import EsuKey +from ._models_py3 import ExtensionPublisher +from ._models_py3 import ExtensionPublisherListResult from ._models_py3 import ExtensionTargetProperties +from ._models_py3 import ExtensionType +from ._models_py3 import ExtensionTypeListResult from ._models_py3 import ExtensionValue from ._models_py3 import ExtensionValueListResult +from ._models_py3 import ExtensionValueListResultV2 +from ._models_py3 import ExtensionValueProperties +from ._models_py3 import ExtensionValueV2 +from ._models_py3 import ExtensionValueV2Properties from ._models_py3 import ExtensionsResourceStatus +from ._models_py3 import FirmwareProfile +from ._models_py3 import Gateway +from ._models_py3 import GatewayUpdate +from ._models_py3 import GatewaysListResult +from ._models_py3 import HardwareProfile from ._models_py3 import HybridComputePrivateLinkScope from ._models_py3 import HybridComputePrivateLinkScopeListResult from ._models_py3 import HybridComputePrivateLinkScopeProperties +from ._models_py3 import HybridIdentityMetadata +from ._models_py3 import HybridIdentityMetadataList from ._models_py3 import Identity from ._models_py3 import IpAddress from ._models_py3 import KeyDetails @@ -48,13 +68,20 @@ from ._models_py3 import MachineExtensionInstanceView from ._models_py3 import MachineExtensionInstanceViewStatus from ._models_py3 import MachineExtensionProperties +from ._models_py3 import MachineExtensionSetup from ._models_py3 import MachineExtensionUpdate from ._models_py3 import MachineExtensionUpgrade from ._models_py3 import MachineExtensionsListResult from ._models_py3 import MachineInstallPatchesParameters from ._models_py3 import MachineInstallPatchesResult from ._models_py3 import MachineListResult +from ._models_py3 import MachineRunCommand +from ._models_py3 import MachineRunCommandInstanceView +from ._models_py3 import MachineRunCommandScriptSource +from ._models_py3 import MachineRunCommandUpdate +from ._models_py3 import MachineRunCommandsListResult from ._models_py3 import MachineUpdate +from ._models_py3 import NetworkConfiguration from ._models_py3 import NetworkInterface from ._models_py3 import NetworkProfile from ._models_py3 import NetworkSecurityPerimeter @@ -80,6 +107,7 @@ from ._models_py3 import PrivateLinkScopeValidationDetails from ._models_py3 import PrivateLinkScopesResource from ._models_py3 import PrivateLinkServiceConnectionStateProperty +from ._models_py3 import Processor from ._models_py3 import ProductFeature from ._models_py3 import ProductFeatureUpdate from ._models_py3 import ProvisioningIssue @@ -89,12 +117,17 @@ from ._models_py3 import ResourceAssociation from ._models_py3 import ResourceAutoGenerated from ._models_py3 import ResourceUpdate +from ._models_py3 import RunCommandInputParameter +from ._models_py3 import RunCommandManagedIdentity from ._models_py3 import ServiceStatus from ._models_py3 import ServiceStatuses +from ._models_py3 import Settings +from ._models_py3 import StorageProfile from ._models_py3 import Subnet from ._models_py3 import SystemData from ._models_py3 import TagsResource from ._models_py3 import TrackedResource +from ._models_py3 import TrackedResourceAutoGenerated from ._models_py3 import VolumeLicenseDetails from ._models_py3 import WindowsParameters @@ -107,7 +140,9 @@ from ._hybrid_compute_management_client_enums import EsuEligibility from ._hybrid_compute_management_client_enums import EsuKeyState from ._hybrid_compute_management_client_enums import EsuServerType +from ._hybrid_compute_management_client_enums import ExecutionState from ._hybrid_compute_management_client_enums import ExtensionsStatusLevelTypes +from ._hybrid_compute_management_client_enums import GatewayType from ._hybrid_compute_management_client_enums import HotpatchEnablementStatus from ._hybrid_compute_management_client_enums import InstanceViewTypes from ._hybrid_compute_management_client_enums import LastAttemptStatusEnum @@ -145,21 +180,41 @@ "AccessRule", "AgentConfiguration", "AgentUpgrade", + "AgentVersion", + "AgentVersionsList", "AvailablePatchCountByClassification", "CloudMetadata", "ConfigurationExtension", "ConnectionDetail", + "Disk", "ErrorAdditionalInfo", "ErrorDetail", + "ErrorDetailAutoGenerated", "ErrorResponse", + "ErrorResponseAutoGenerated", "EsuKey", + "ExtensionPublisher", + "ExtensionPublisherListResult", "ExtensionTargetProperties", + "ExtensionType", + "ExtensionTypeListResult", "ExtensionValue", "ExtensionValueListResult", + "ExtensionValueListResultV2", + "ExtensionValueProperties", + "ExtensionValueV2", + "ExtensionValueV2Properties", "ExtensionsResourceStatus", + "FirmwareProfile", + "Gateway", + "GatewayUpdate", + "GatewaysListResult", + "HardwareProfile", "HybridComputePrivateLinkScope", "HybridComputePrivateLinkScopeListResult", "HybridComputePrivateLinkScopeProperties", + "HybridIdentityMetadata", + "HybridIdentityMetadataList", "Identity", "IpAddress", "KeyDetails", @@ -184,13 +239,20 @@ "MachineExtensionInstanceView", "MachineExtensionInstanceViewStatus", "MachineExtensionProperties", + "MachineExtensionSetup", "MachineExtensionUpdate", "MachineExtensionUpgrade", "MachineExtensionsListResult", "MachineInstallPatchesParameters", "MachineInstallPatchesResult", "MachineListResult", + "MachineRunCommand", + "MachineRunCommandInstanceView", + "MachineRunCommandScriptSource", + "MachineRunCommandUpdate", + "MachineRunCommandsListResult", "MachineUpdate", + "NetworkConfiguration", "NetworkInterface", "NetworkProfile", "NetworkSecurityPerimeter", @@ -216,6 +278,7 @@ "PrivateLinkScopeValidationDetails", "PrivateLinkScopesResource", "PrivateLinkServiceConnectionStateProperty", + "Processor", "ProductFeature", "ProductFeatureUpdate", "ProvisioningIssue", @@ -225,12 +288,17 @@ "ResourceAssociation", "ResourceAutoGenerated", "ResourceUpdate", + "RunCommandInputParameter", + "RunCommandManagedIdentity", "ServiceStatus", "ServiceStatuses", + "Settings", + "StorageProfile", "Subnet", "SystemData", "TagsResource", "TrackedResource", + "TrackedResourceAutoGenerated", "VolumeLicenseDetails", "WindowsParameters", "AccessMode", @@ -242,7 +310,9 @@ "EsuEligibility", "EsuKeyState", "EsuServerType", + "ExecutionState", "ExtensionsStatusLevelTypes", + "GatewayType", "HotpatchEnablementStatus", "InstanceViewTypes", "LastAttemptStatusEnum", diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py index c3cc206aedef7..db932333d81b6 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py @@ -91,6 +91,18 @@ class EsuServerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATACENTER = "Datacenter" +class ExecutionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Script execution status.""" + + UNKNOWN = "Unknown" + PENDING = "Pending" + RUNNING = "Running" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + TIMED_OUT = "TimedOut" + CANCELED = "Canceled" + + class ExtensionsStatusLevelTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The level code.""" @@ -99,6 +111,12 @@ class ExtensionsStatusLevelTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): ERROR = "Error" +class GatewayType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the Gateway resource.""" + + PUBLIC = "Public" + + class HotpatchEnablementStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status of hotpatch enablement or disablement.""" diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py index ebebac7a615bd..2ff6b3f6885f0 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py @@ -121,9 +121,9 @@ class AgentUpgrade(_serialization.Model): :ivar desired_version: Specifies the version info w.r.t AgentUpgrade for the machine. :vartype desired_version: str - :ivar correlation_id: The correlation ID passed in from RSM per upgrade. + :ivar correlation_id: The correlation ID associated with an agent upgrade operation. :vartype correlation_id: str - :ivar enable_automatic_upgrade: Specifies if RSM should try to upgrade this machine. + :ivar enable_automatic_upgrade: Specifies if the machine's agent should be upgraded. :vartype enable_automatic_upgrade: bool :ivar last_attempt_desired_version: Specifies the version of the last attempt. :vartype last_attempt_desired_version: str @@ -164,9 +164,9 @@ def __init__( """ :keyword desired_version: Specifies the version info w.r.t AgentUpgrade for the machine. :paramtype desired_version: str - :keyword correlation_id: The correlation ID passed in from RSM per upgrade. + :keyword correlation_id: The correlation ID associated with an agent upgrade operation. :paramtype correlation_id: str - :keyword enable_automatic_upgrade: Specifies if RSM should try to upgrade this machine. + :keyword enable_automatic_upgrade: Specifies if the machine's agent should be upgraded. :paramtype enable_automatic_upgrade: bool """ super().__init__(**kwargs) @@ -179,6 +179,73 @@ def __init__( self.last_attempt_message = None +class AgentVersion(_serialization.Model): + """Describes properties of Agent Version. + + :ivar agent_version: Represents the agent version. + :vartype agent_version: str + :ivar download_link: Represents the download link of specific agent version. + :vartype download_link: str + :ivar os_type: Defines the os type. + :vartype os_type: str + """ + + _attribute_map = { + "agent_version": {"key": "agentVersion", "type": "str"}, + "download_link": {"key": "downloadLink", "type": "str"}, + "os_type": {"key": "osType", "type": "str"}, + } + + def __init__( + self, + *, + agent_version: Optional[str] = None, + download_link: Optional[str] = None, + os_type: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword agent_version: Represents the agent version. + :paramtype agent_version: str + :keyword download_link: Represents the download link of specific agent version. + :paramtype download_link: str + :keyword os_type: Defines the os type. + :paramtype os_type: str + """ + super().__init__(**kwargs) + self.agent_version = agent_version + self.download_link = download_link + self.os_type = os_type + + +class AgentVersionsList(_serialization.Model): + """Describes AgentVersions List. + + :ivar value: The list of available Agent Versions. + :vartype value: list[~azure.mgmt.hybridcompute.models.AgentVersion] + :ivar next_link: The URI to fetch the next 10 available Agent Versions. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[AgentVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.AgentVersion"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The list of available Agent Versions. + :paramtype value: list[~azure.mgmt.hybridcompute.models.AgentVersion] + :keyword next_link: The URI to fetch the next 10 available Agent Versions. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + class AvailablePatchCountByClassification(_serialization.Model): """Summarization of patches available for installation on the machine by classification. @@ -336,6 +403,73 @@ def __init__(self, **kwargs: Any) -> None: self.member_name = None +class Disk(_serialization.Model): + """Describes a disk on the machine. + + :ivar path: The path of the disk. + :vartype path: str + :ivar disk_type: The type of the disk. + :vartype disk_type: str + :ivar generated_id: The generated ID of the disk. + :vartype generated_id: str + :ivar id: The ID of the disk. + :vartype id: str + :ivar name: The name of the disk. + :vartype name: str + :ivar max_size_in_bytes: The size of the disk, in bytes. + :vartype max_size_in_bytes: int + :ivar used_space_in_bytes: The amount of space used on the disk, in bytes. + :vartype used_space_in_bytes: int + """ + + _attribute_map = { + "path": {"key": "path", "type": "str"}, + "disk_type": {"key": "diskType", "type": "str"}, + "generated_id": {"key": "generatedId", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "max_size_in_bytes": {"key": "maxSizeInBytes", "type": "int"}, + "used_space_in_bytes": {"key": "usedSpaceInBytes", "type": "int"}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + disk_type: Optional[str] = None, + generated_id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + max_size_in_bytes: Optional[int] = None, + used_space_in_bytes: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword path: The path of the disk. + :paramtype path: str + :keyword disk_type: The type of the disk. + :paramtype disk_type: str + :keyword generated_id: The generated ID of the disk. + :paramtype generated_id: str + :keyword id: The ID of the disk. + :paramtype id: str + :keyword name: The name of the disk. + :paramtype name: str + :keyword max_size_in_bytes: The size of the disk, in bytes. + :paramtype max_size_in_bytes: int + :keyword used_space_in_bytes: The amount of space used on the disk, in bytes. + :paramtype used_space_in_bytes: int + """ + super().__init__(**kwargs) + self.path = path + self.disk_type = disk_type + self.generated_id = generated_id + self.id = id + self.name = name + self.max_size_in_bytes = max_size_in_bytes + self.used_space_in_bytes = used_space_in_bytes + + class ErrorAdditionalInfo(_serialization.Model): """The resource management error additional info. @@ -407,6 +541,49 @@ def __init__(self, **kwargs: Any) -> None: self.additional_info = None +class ErrorDetailAutoGenerated(_serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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[~azure.mgmt.hybridcompute.models.ErrorDetailAutoGenerated] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetailAutoGenerated]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class ErrorResponse(_serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). @@ -428,6 +605,27 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A self.error = error +class ErrorResponseAutoGenerated(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.hybridcompute.models.ErrorDetailAutoGenerated + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetailAutoGenerated"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetailAutoGenerated"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.hybridcompute.models.ErrorDetailAutoGenerated + """ + super().__init__(**kwargs) + self.error = error + + class EsuKey(_serialization.Model): """ESU key. @@ -456,6 +654,68 @@ def __init__(self, *, sku: Optional[str] = None, license_status: Optional[int] = self.license_status = license_status +class ExtensionPublisher(_serialization.Model): + """Describes an Extension Publisher. + + :ivar id: The ID of the extension publisher. + :vartype id: str + :ivar name: The name of the extension publisher. + :vartype name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The ID of the extension publisher. + :paramtype id: str + :keyword name: The name of the extension publisher. + :paramtype name: str + """ + super().__init__(**kwargs) + self.id = id + self.name = name + + +class ExtensionPublisherListResult(_serialization.Model): + """The List of Extension Publishers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of extension publishers. + :vartype value: list[~azure.mgmt.hybridcompute.models.ExtensionPublisher] + :ivar next_link: The URI to fetch the next page of extension publishers. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ExtensionPublisher]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: The URI to fetch the next page of extension publishers. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + class ExtensionsResourceStatus(_serialization.Model): """Instance view status. @@ -529,6 +789,68 @@ def __init__(self, *, target_version: Optional[str] = None, **kwargs: Any) -> No self.target_version = target_version +class ExtensionType(_serialization.Model): + """Describes an Extension Type. + + :ivar id: The ID of the extension type. + :vartype id: str + :ivar name: The name of the extension type. + :vartype name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The ID of the extension type. + :paramtype id: str + :keyword name: The name of the extension type. + :paramtype name: str + """ + super().__init__(**kwargs) + self.id = id + self.name = name + + +class ExtensionTypeListResult(_serialization.Model): + """The List of Extension Types. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of extension types. + :vartype value: list[~azure.mgmt.hybridcompute.models.ExtensionType] + :ivar next_link: The URI to fetch the next page of extension types. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ExtensionType]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: The URI to fetch the next page of extension types. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + class ResourceAutoGenerated(_serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. @@ -665,53 +987,522 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class PrivateLinkScopesResource(_serialization.Model): - """An azure resource object. +class ExtensionValueListResultV2(_serialization.Model): + """The List Extension Metadata 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 server. - - :ivar id: Azure resource Id. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] + :ivar value: The list of extension metadata. + :vartype value: list[~azure.mgmt.hybridcompute.models.ExtensionValueV2] + :ivar next_link: The URI to fetch the next page of extension metadata. + :vartype next_link: str """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, + "value": {"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}"}, + "value": {"key": "value", "type": "[ExtensionValueV2]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] + :keyword next_link: The URI to fetch the next page of extension metadata. + :paramtype next_link: str """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags + self.value = None + self.next_link = next_link + + +class ExtensionValueProperties(_serialization.Model): + """Describes Extension Metadata properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar version: The version of the Extension being received. + :vartype version: str + :ivar extension_type: The type of the Extension being received. + :vartype extension_type: str + :ivar publisher: The publisher of the Extension being received. + :vartype publisher: str + """ + + _validation = { + "version": {"readonly": True}, + "extension_type": {"readonly": True}, + "publisher": {"readonly": True}, + } + + _attribute_map = { + "version": {"key": "version", "type": "str"}, + "extension_type": {"key": "extensionType", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.version = None + self.extension_type = None + self.publisher = None + + +class ExtensionValueV2(ProxyResource): # pylint: disable=too-many-instance-attributes + """Describes an Extension Metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar version: The version of the Extension being received. + :vartype version: str + :ivar extension_type: The type of the Extension being received. + :vartype extension_type: str + :ivar publisher: The publisher of the Extension being received. + :vartype publisher: str + :ivar extension_uris: A list of locations where the extension packages can be found. + :vartype extension_uris: list[str] + :ivar extension_signature_uri: Location of the signature files for the extension. + :vartype extension_signature_uri: str + :ivar operating_system: The operating system (Windows, Linux, etc.) this extension supports. + :vartype operating_system: str + :ivar architecture: Architectures (x64, arms64, etc.) that this extension supports. + :vartype architecture: list[str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "version": {"readonly": True}, + "extension_type": {"readonly": True}, + "publisher": {"readonly": True}, + "extension_uris": {"readonly": True}, + "extension_signature_uri": {"readonly": True}, + "operating_system": {"readonly": True}, + "architecture": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "version": {"key": "properties.version", "type": "str"}, + "extension_type": {"key": "properties.extensionType", "type": "str"}, + "publisher": {"key": "properties.publisher", "type": "str"}, + "extension_uris": {"key": "properties.extensionUris", "type": "[str]"}, + "extension_signature_uri": {"key": "properties.extensionSignatureUri", "type": "str"}, + "operating_system": {"key": "properties.operatingSystem", "type": "str"}, + "architecture": {"key": "properties.architecture", "type": "[str]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.version = None + self.extension_type = None + self.publisher = None + self.extension_uris = None + self.extension_signature_uri = None + self.operating_system = None + self.architecture = None + + +class ExtensionValueV2Properties(ExtensionValueProperties): + """Describes Extension Metadata properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar version: The version of the Extension being received. + :vartype version: str + :ivar extension_type: The type of the Extension being received. + :vartype extension_type: str + :ivar publisher: The publisher of the Extension being received. + :vartype publisher: str + :ivar extension_uris: A list of locations where the extension packages can be found. + :vartype extension_uris: list[str] + :ivar extension_signature_uri: Location of the signature files for the extension. + :vartype extension_signature_uri: str + :ivar operating_system: The operating system (Windows, Linux, etc.) this extension supports. + :vartype operating_system: str + :ivar architecture: Architectures (x64, arms64, etc.) that this extension supports. + :vartype architecture: list[str] + """ + + _validation = { + "version": {"readonly": True}, + "extension_type": {"readonly": True}, + "publisher": {"readonly": True}, + "extension_uris": {"readonly": True}, + "extension_signature_uri": {"readonly": True}, + "operating_system": {"readonly": True}, + "architecture": {"readonly": True}, + } + + _attribute_map = { + "version": {"key": "version", "type": "str"}, + "extension_type": {"key": "extensionType", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + "extension_uris": {"key": "extensionUris", "type": "[str]"}, + "extension_signature_uri": {"key": "extensionSignatureUri", "type": "str"}, + "operating_system": {"key": "operatingSystem", "type": "str"}, + "architecture": {"key": "architecture", "type": "[str]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.extension_uris = None + self.extension_signature_uri = None + self.operating_system = None + self.architecture = None + + +class FirmwareProfile(_serialization.Model): + """Describes the firmware of the machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar serial_number: The serial number of the firmware. + :vartype serial_number: str + :ivar type: The type of the firmware. + :vartype type: str + """ + + _validation = { + "serial_number": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "serial_number": {"key": "serialNumber", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.serial_number = None + self.type = None + + +class TrackedResourceAutoGenerated(ResourceAutoGenerated): + """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 server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + """ + super().__init__(**kwargs) + self.tags = tags + self.location = location + + +class Gateway(TrackedResourceAutoGenerated): # pylint: disable=too-many-instance-attributes + """Describes an Arc Gateway. + + 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 server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar provisioning_state: The provisioning state, which only appears in the response. Known + values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Accepted", "Canceled", + and "Deleted". + :vartype provisioning_state: str or ~azure.mgmt.hybridcompute.models.ProvisioningState + :ivar gateway_id: A unique, immutable, identifier for the Gateway. + :vartype gateway_id: str + :ivar gateway_type: The type of the Gateway resource. "Public" + :vartype gateway_type: str or ~azure.mgmt.hybridcompute.models.GatewayType + :ivar gateway_endpoint: The endpoint fqdn for the Gateway. + :vartype gateway_endpoint: str + :ivar allowed_features: Specifies the list of features that are enabled for this Gateway. + :vartype allowed_features: list[str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "gateway_id": {"readonly": True}, + "gateway_endpoint": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "gateway_id": {"key": "properties.gatewayId", "type": "str"}, + "gateway_type": {"key": "properties.gatewayType", "type": "str"}, + "gateway_endpoint": {"key": "properties.gatewayEndpoint", "type": "str"}, + "allowed_features": {"key": "properties.allowedFeatures", "type": "[str]"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + gateway_type: Optional[Union[str, "_models.GatewayType"]] = None, + allowed_features: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword gateway_type: The type of the Gateway resource. "Public" + :paramtype gateway_type: str or ~azure.mgmt.hybridcompute.models.GatewayType + :keyword allowed_features: Specifies the list of features that are enabled for this Gateway. + :paramtype allowed_features: list[str] + """ + super().__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.gateway_id = None + self.gateway_type = gateway_type + self.gateway_endpoint = None + self.allowed_features = allowed_features + + +class GatewaysListResult(_serialization.Model): + """The List license operation response. + + All required parameters must be populated in order to send to server. + + :ivar value: The list of Gateways. Required. + :vartype value: list[~azure.mgmt.hybridcompute.models.Gateway] + :ivar next_link: The URI to fetch the next page of Gateways. Call ListNext() with this URI to + fetch the next page of Gateways. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Gateway]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.Gateway"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of Gateways. Required. + :paramtype value: list[~azure.mgmt.hybridcompute.models.Gateway] + :keyword next_link: The URI to fetch the next page of Gateways. Call ListNext() with this URI + to fetch the next page of Gateways. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ResourceUpdate(_serialization.Model): + """The Update Resource model definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags + + +class GatewayUpdate(ResourceUpdate): + """Describes a License Update. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar allowed_features: Specifies the list of features that are enabled for this Gateway. + :vartype allowed_features: list[str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + "allowed_features": {"key": "properties.allowedFeatures", "type": "[str]"}, + } + + def __init__( + self, *, tags: Optional[Dict[str, str]] = None, allowed_features: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword allowed_features: Specifies the list of features that are enabled for this Gateway. + :paramtype allowed_features: list[str] + """ + super().__init__(tags=tags, **kwargs) + self.allowed_features = allowed_features + + +class HardwareProfile(_serialization.Model): + """Describes the hardware of the machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar total_physical_memory_in_bytes: The total physical memory on the machine. + :vartype total_physical_memory_in_bytes: int + :ivar number_of_cpu_sockets: The total number of CPU sockets available on the machine. + :vartype number_of_cpu_sockets: int + :ivar processors: The physical processors of the machine. + :vartype processors: list[~azure.mgmt.hybridcompute.models.Processor] + """ + + _validation = { + "total_physical_memory_in_bytes": {"readonly": True}, + "number_of_cpu_sockets": {"readonly": True}, + "processors": {"readonly": True}, + } + + _attribute_map = { + "total_physical_memory_in_bytes": {"key": "totalPhysicalMemoryInBytes", "type": "int"}, + "number_of_cpu_sockets": {"key": "numberOfCpuSockets", "type": "int"}, + "processors": {"key": "processors", "type": "[Processor]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.total_physical_memory_in_bytes = None + self.number_of_cpu_sockets = None + self.processors = None + + +class PrivateLinkScopesResource(_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 server. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :ivar location: Resource location. Required. + :vartype location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword location: Resource location. Required. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags class HybridComputePrivateLinkScope(PrivateLinkScopesResource): @@ -833,36 +1624,186 @@ class HybridComputePrivateLinkScopeProperties(_serialization.Model): """ _validation = { - "provisioning_state": {"readonly": True}, - "private_link_scope_id": {"readonly": True}, - "private_endpoint_connections": {"readonly": True}, + "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: Union[str, "_models.PublicNetworkAccessType"] = "Disabled", **kwargs: Any + ) -> None: + """ + :keyword public_network_access: Indicates whether machines associated with the private link + scope can also use public Azure Arc service endpoints. Known values are: "Enabled", "Disabled", + and "SecuredByPerimeter". + :paramtype public_network_access: str or + ~azure.mgmt.hybridcompute.models.PublicNetworkAccessType + """ + super().__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 Resource(_serialization.Model): + """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 - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.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"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class ProxyResourceAutoGenerated(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}. # pylint: disable=line-too-long + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + """ + + +class HybridIdentityMetadata(ProxyResourceAutoGenerated): + """Defines the HybridIdentityMetadata. + + 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}. # pylint: disable=line-too-long + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar vm_id: The unique identifier for the resource. + :vartype vm_id: str + :ivar public_key: The Public Key. + :vartype public_key: str + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.hybridcompute.models.Identity + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "identity": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "vm_id": {"key": "properties.vmId", "type": "str"}, + "public_key": {"key": "properties.publicKey", "type": "str"}, + "identity": {"key": "properties.identity", "type": "Identity"}, + } + + def __init__(self, *, vm_id: Optional[str] = None, public_key: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword vm_id: The unique identifier for the resource. + :paramtype vm_id: str + :keyword public_key: The Public Key. + :paramtype public_key: str + """ + super().__init__(**kwargs) + self.vm_id = vm_id + self.public_key = public_key + self.identity = None + + +class HybridIdentityMetadataList(_serialization.Model): + """List of HybridIdentityMetadata. + + All required parameters must be populated in order to send to server. + + :ivar next_link: Url to follow for getting next page of HybridIdentityMetadata. + :vartype next_link: str + :ivar value: Array of HybridIdentityMetadata. Required. + :vartype value: list[~azure.mgmt.hybridcompute.models.HybridIdentityMetadata] + """ + + _validation = { + "value": {"required": 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]", - }, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[HybridIdentityMetadata]"}, } def __init__( - self, *, public_network_access: Union[str, "_models.PublicNetworkAccessType"] = "Disabled", **kwargs: Any + self, *, value: List["_models.HybridIdentityMetadata"], next_link: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword public_network_access: Indicates whether machines associated with the private link - scope can also use public Azure Arc service endpoints. Known values are: "Enabled", "Disabled", - and "SecuredByPerimeter". - :paramtype public_network_access: str or - ~azure.mgmt.hybridcompute.models.PublicNetworkAccessType + :keyword next_link: Url to follow for getting next page of HybridIdentityMetadata. + :paramtype next_link: str + :keyword value: Array of HybridIdentityMetadata. Required. + :paramtype value: list[~azure.mgmt.hybridcompute.models.HybridIdentityMetadata] """ super().__init__(**kwargs) - self.public_network_access = public_network_access - self.provisioning_state = None - self.private_link_scope_id = None - self.private_endpoint_connections = None + self.next_link = next_link + self.value = value class Identity(_serialization.Model): @@ -999,47 +1940,6 @@ def __init__(self, **kwargs: Any) -> None: self.candidate_public_key = None -class Resource(_serialization.Model): - """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 - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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 - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.hybridcompute.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"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - class TrackedResource(Resource): """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -1749,26 +2649,6 @@ def __init__( self.next_link = next_link -class ResourceUpdate(_serialization.Model): - """The Update Resource model definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - class LicenseProfileUpdate(ResourceUpdate): """Describes a License Profile Update. @@ -2082,6 +2962,12 @@ class Machine(TrackedResource): # pylint: disable=too-many-instance-attributes :vartype agent_configuration: ~azure.mgmt.hybridcompute.models.AgentConfiguration :ivar service_statuses: Statuses of dependent services that are reported back to ARM. :vartype service_statuses: ~azure.mgmt.hybridcompute.models.ServiceStatuses + :ivar hardware_profile: Information about the machine's hardware. + :vartype hardware_profile: ~azure.mgmt.hybridcompute.models.HardwareProfile + :ivar storage_profile: Information about the machine's storage. + :vartype storage_profile: ~azure.mgmt.hybridcompute.models.StorageProfile + :ivar firmware_profile: Information about the machine's firmware. + :vartype firmware_profile: ~azure.mgmt.hybridcompute.models.FirmwareProfile :ivar cloud_metadata: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). :vartype cloud_metadata: ~azure.mgmt.hybridcompute.models.CloudMetadata :ivar agent_upgrade: The info of the machine w.r.t Agent Upgrade. @@ -2152,6 +3038,9 @@ class Machine(TrackedResource): # pylint: disable=too-many-instance-attributes "location": {"required": True}, "resources": {"readonly": True}, "agent_configuration": {"readonly": True}, + "hardware_profile": {"readonly": True}, + "storage_profile": {"readonly": True}, + "firmware_profile": {"readonly": True}, "provisioning_state": {"readonly": True}, "status": {"readonly": True}, "last_status_change": {"readonly": True}, @@ -2184,6 +3073,9 @@ class Machine(TrackedResource): # pylint: disable=too-many-instance-attributes "location_data": {"key": "properties.locationData", "type": "LocationData"}, "agent_configuration": {"key": "properties.agentConfiguration", "type": "AgentConfiguration"}, "service_statuses": {"key": "properties.serviceStatuses", "type": "ServiceStatuses"}, + "hardware_profile": {"key": "properties.hardwareProfile", "type": "HardwareProfile"}, + "storage_profile": {"key": "properties.storageProfile", "type": "StorageProfile"}, + "firmware_profile": {"key": "properties.firmwareProfile", "type": "FirmwareProfile"}, "cloud_metadata": {"key": "properties.cloudMetadata", "type": "CloudMetadata"}, "agent_upgrade": {"key": "properties.agentUpgrade", "type": "AgentUpgrade"}, "os_profile": {"key": "properties.osProfile", "type": "OSProfile"}, @@ -2283,6 +3175,9 @@ def __init__( # pylint: disable=too-many-locals self.location_data = location_data self.agent_configuration = None self.service_statuses = service_statuses + self.hardware_profile = None + self.storage_profile = None + self.firmware_profile = None self.cloud_metadata = cloud_metadata self.agent_upgrade = agent_upgrade self.os_profile = os_profile @@ -2668,6 +3563,30 @@ def __init__( self.instance_view = instance_view +class MachineExtensionSetup(_serialization.Model): + """MachineExtensionSetup. + + :ivar extension_setup_list: The list of extensions. + :vartype extension_setup_list: + list[~azure.mgmt.hybridcompute.models.MachineExtensionProperties] + """ + + _attribute_map = { + "extension_setup_list": {"key": "extensionSetupList", "type": "[MachineExtensionProperties]"}, + } + + def __init__( + self, *, extension_setup_list: Optional[List["_models.MachineExtensionProperties"]] = None, **kwargs: Any + ) -> None: + """ + :keyword extension_setup_list: The list of extensions. + :paramtype extension_setup_list: + list[~azure.mgmt.hybridcompute.models.MachineExtensionProperties] + """ + super().__init__(**kwargs) + self.extension_setup_list = extension_setup_list + + class MachineExtensionsListResult(_serialization.Model): """Describes the Machine Extensions List Result. @@ -2947,70 +3866,427 @@ class MachineInstallPatchesResult(_serialization.Model): # pylint: disable=too- } _attribute_map = { - "status": {"key": "status", "type": "str"}, - "installation_activity_id": {"key": "installationActivityId", "type": "str"}, - "reboot_status": {"key": "rebootStatus", "type": "str"}, - "maintenance_window_exceeded": {"key": "maintenanceWindowExceeded", "type": "bool"}, - "excluded_patch_count": {"key": "excludedPatchCount", "type": "int"}, - "not_selected_patch_count": {"key": "notSelectedPatchCount", "type": "int"}, - "pending_patch_count": {"key": "pendingPatchCount", "type": "int"}, - "installed_patch_count": {"key": "installedPatchCount", "type": "int"}, - "failed_patch_count": {"key": "failedPatchCount", "type": "int"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, - "last_modified_date_time": {"key": "lastModifiedDateTime", "type": "iso-8601"}, - "started_by": {"key": "startedBy", "type": "str"}, - "patch_service_used": {"key": "patchServiceUsed", "type": "str"}, - "os_type": {"key": "osType", "type": "str"}, - "error_details": {"key": "errorDetails", "type": "ErrorDetail"}, + "status": {"key": "status", "type": "str"}, + "installation_activity_id": {"key": "installationActivityId", "type": "str"}, + "reboot_status": {"key": "rebootStatus", "type": "str"}, + "maintenance_window_exceeded": {"key": "maintenanceWindowExceeded", "type": "bool"}, + "excluded_patch_count": {"key": "excludedPatchCount", "type": "int"}, + "not_selected_patch_count": {"key": "notSelectedPatchCount", "type": "int"}, + "pending_patch_count": {"key": "pendingPatchCount", "type": "int"}, + "installed_patch_count": {"key": "installedPatchCount", "type": "int"}, + "failed_patch_count": {"key": "failedPatchCount", "type": "int"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "last_modified_date_time": {"key": "lastModifiedDateTime", "type": "iso-8601"}, + "started_by": {"key": "startedBy", "type": "str"}, + "patch_service_used": {"key": "patchServiceUsed", "type": "str"}, + "os_type": {"key": "osType", "type": "str"}, + "error_details": {"key": "errorDetails", "type": "ErrorDetail"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.status = None + self.installation_activity_id = None + self.reboot_status = None + self.maintenance_window_exceeded = None + self.excluded_patch_count = None + self.not_selected_patch_count = None + self.pending_patch_count = None + self.installed_patch_count = None + self.failed_patch_count = None + self.start_date_time = None + self.last_modified_date_time = None + self.started_by = None + self.patch_service_used = None + self.os_type = None + self.error_details = None + + +class MachineListResult(_serialization.Model): + """The List hybrid machine operation response. + + All required parameters must be populated in order to send to server. + + :ivar value: The list of hybrid machines. Required. + :vartype value: list[~azure.mgmt.hybridcompute.models.Machine] + :ivar next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI to + fetch the next page of hybrid machines. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Machine]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.Machine"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of hybrid machines. Required. + :paramtype value: list[~azure.mgmt.hybridcompute.models.Machine] + :keyword next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI + to fetch the next page of hybrid machines. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class MachineRunCommand(TrackedResource): # pylint: disable=too-many-instance-attributes + """Describes a Run Command. + + 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 server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar source: The source of the run command script. + :vartype source: ~azure.mgmt.hybridcompute.models.MachineRunCommandScriptSource + :ivar parameters: The parameters used by the script. + :vartype parameters: list[~azure.mgmt.hybridcompute.models.RunCommandInputParameter] + :ivar protected_parameters: The parameters used by the script. + :vartype protected_parameters: list[~azure.mgmt.hybridcompute.models.RunCommandInputParameter] + :ivar async_execution: Optional. If set to true, provisioning will complete as soon as script + starts and will not wait for script to complete. + :vartype async_execution: bool + :ivar run_as_user: Specifies the user account on the machine when executing the run command. + :vartype run_as_user: str + :ivar run_as_password: Specifies the user account password on the machine when executing the + run command. + :vartype run_as_password: str + :ivar timeout_in_seconds: The timeout in seconds to execute the run command. + :vartype timeout_in_seconds: int + :ivar output_blob_uri: Specifies the Azure storage blob where script output stream will be + uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to + provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. + :vartype output_blob_uri: str + :ivar error_blob_uri: Specifies the Azure storage blob where script error stream will be + uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to + provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. + :vartype error_blob_uri: str + :ivar output_blob_managed_identity: User-assigned managed identity that has access to + outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure + managed identity has been given access to blob's container with 'Storage Blob Data Contributor' + role assignment. In case of user-assigned identity, make sure you add it under VM's identity. + For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + https://aka.ms/RunCommandManaged. + :vartype output_blob_managed_identity: + ~azure.mgmt.hybridcompute.models.RunCommandManagedIdentity + :ivar error_blob_managed_identity: User-assigned managed identity that has access to + errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure + managed identity has been given access to blob's container with 'Storage Blob Data Contributor' + role assignment. In case of user-assigned identity, make sure you add it under VM's identity. + For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + https://aka.ms/RunCommandManaged. + :vartype error_blob_managed_identity: + ~azure.mgmt.hybridcompute.models.RunCommandManagedIdentity + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The machine run command instance view. + :vartype instance_view: ~azure.mgmt.hybridcompute.models.MachineRunCommandInstanceView + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "instance_view": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "source": {"key": "properties.source", "type": "MachineRunCommandScriptSource"}, + "parameters": {"key": "properties.parameters", "type": "[RunCommandInputParameter]"}, + "protected_parameters": {"key": "properties.protectedParameters", "type": "[RunCommandInputParameter]"}, + "async_execution": {"key": "properties.asyncExecution", "type": "bool"}, + "run_as_user": {"key": "properties.runAsUser", "type": "str"}, + "run_as_password": {"key": "properties.runAsPassword", "type": "str"}, + "timeout_in_seconds": {"key": "properties.timeoutInSeconds", "type": "int"}, + "output_blob_uri": {"key": "properties.outputBlobUri", "type": "str"}, + "error_blob_uri": {"key": "properties.errorBlobUri", "type": "str"}, + "output_blob_managed_identity": { + "key": "properties.outputBlobManagedIdentity", + "type": "RunCommandManagedIdentity", + }, + "error_blob_managed_identity": { + "key": "properties.errorBlobManagedIdentity", + "type": "RunCommandManagedIdentity", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "instance_view": {"key": "properties.instanceView", "type": "MachineRunCommandInstanceView"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + source: Optional["_models.MachineRunCommandScriptSource"] = None, + parameters: Optional[List["_models.RunCommandInputParameter"]] = None, + protected_parameters: Optional[List["_models.RunCommandInputParameter"]] = None, + async_execution: bool = False, + run_as_user: Optional[str] = None, + run_as_password: Optional[str] = None, + timeout_in_seconds: Optional[int] = None, + output_blob_uri: Optional[str] = None, + error_blob_uri: Optional[str] = None, + output_blob_managed_identity: Optional["_models.RunCommandManagedIdentity"] = None, + error_blob_managed_identity: Optional["_models.RunCommandManagedIdentity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword source: The source of the run command script. + :paramtype source: ~azure.mgmt.hybridcompute.models.MachineRunCommandScriptSource + :keyword parameters: The parameters used by the script. + :paramtype parameters: list[~azure.mgmt.hybridcompute.models.RunCommandInputParameter] + :keyword protected_parameters: The parameters used by the script. + :paramtype protected_parameters: + list[~azure.mgmt.hybridcompute.models.RunCommandInputParameter] + :keyword async_execution: Optional. If set to true, provisioning will complete as soon as + script starts and will not wait for script to complete. + :paramtype async_execution: bool + :keyword run_as_user: Specifies the user account on the machine when executing the run command. + :paramtype run_as_user: str + :keyword run_as_password: Specifies the user account password on the machine when executing the + run command. + :paramtype run_as_password: str + :keyword timeout_in_seconds: The timeout in seconds to execute the run command. + :paramtype timeout_in_seconds: int + :keyword output_blob_uri: Specifies the Azure storage blob where script output stream will be + uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to + provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. + :paramtype output_blob_uri: str + :keyword error_blob_uri: Specifies the Azure storage blob where script error stream will be + uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to + provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. + :paramtype error_blob_uri: str + :keyword output_blob_managed_identity: User-assigned managed identity that has access to + outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure + managed identity has been given access to blob's container with 'Storage Blob Data Contributor' + role assignment. In case of user-assigned identity, make sure you add it under VM's identity. + For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + https://aka.ms/RunCommandManaged. + :paramtype output_blob_managed_identity: + ~azure.mgmt.hybridcompute.models.RunCommandManagedIdentity + :keyword error_blob_managed_identity: User-assigned managed identity that has access to + errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure + managed identity has been given access to blob's container with 'Storage Blob Data Contributor' + role assignment. In case of user-assigned identity, make sure you add it under VM's identity. + For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + https://aka.ms/RunCommandManaged. + :paramtype error_blob_managed_identity: + ~azure.mgmt.hybridcompute.models.RunCommandManagedIdentity + """ + super().__init__(tags=tags, location=location, **kwargs) + self.source = source + self.parameters = parameters + self.protected_parameters = protected_parameters + self.async_execution = async_execution + self.run_as_user = run_as_user + self.run_as_password = run_as_password + self.timeout_in_seconds = timeout_in_seconds + self.output_blob_uri = output_blob_uri + self.error_blob_uri = error_blob_uri + self.output_blob_managed_identity = output_blob_managed_identity + self.error_blob_managed_identity = error_blob_managed_identity + self.provisioning_state = None + self.instance_view = None + + +class MachineRunCommandInstanceView(_serialization.Model): + """The instance view of a machine run command. + + :ivar execution_state: Script execution status. Known values are: "Unknown", "Pending", + "Running", "Failed", "Succeeded", "TimedOut", and "Canceled". + :vartype execution_state: str or ~azure.mgmt.hybridcompute.models.ExecutionState + :ivar execution_message: Communicate script configuration errors or execution messages. + :vartype execution_message: str + :ivar exit_code: Exit code returned from script execution. + :vartype exit_code: int + :ivar output: Script output stream. + :vartype output: str + :ivar error: Script error stream. + :vartype error: str + :ivar start_time: Script start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Script end time. + :vartype end_time: ~datetime.datetime + :ivar statuses: The status information. + :vartype statuses: list[~azure.mgmt.hybridcompute.models.ExtensionsResourceStatus] + """ + + _attribute_map = { + "execution_state": {"key": "executionState", "type": "str"}, + "execution_message": {"key": "executionMessage", "type": "str"}, + "exit_code": {"key": "exitCode", "type": "int"}, + "output": {"key": "output", "type": "str"}, + "error": {"key": "error", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "statuses": {"key": "statuses", "type": "[ExtensionsResourceStatus]"}, + } + + def __init__( + self, + *, + execution_state: Optional[Union[str, "_models.ExecutionState"]] = None, + execution_message: Optional[str] = None, + exit_code: Optional[int] = None, + output: Optional[str] = None, + error: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + statuses: Optional[List["_models.ExtensionsResourceStatus"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword execution_state: Script execution status. Known values are: "Unknown", "Pending", + "Running", "Failed", "Succeeded", "TimedOut", and "Canceled". + :paramtype execution_state: str or ~azure.mgmt.hybridcompute.models.ExecutionState + :keyword execution_message: Communicate script configuration errors or execution messages. + :paramtype execution_message: str + :keyword exit_code: Exit code returned from script execution. + :paramtype exit_code: int + :keyword output: Script output stream. + :paramtype output: str + :keyword error: Script error stream. + :paramtype error: str + :keyword start_time: Script start time. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Script end time. + :paramtype end_time: ~datetime.datetime + :keyword statuses: The status information. + :paramtype statuses: list[~azure.mgmt.hybridcompute.models.ExtensionsResourceStatus] + """ + super().__init__(**kwargs) + self.execution_state = execution_state + self.execution_message = execution_message + self.exit_code = exit_code + self.output = output + self.error = error + self.start_time = start_time + self.end_time = end_time + self.statuses = statuses + + +class MachineRunCommandScriptSource(_serialization.Model): + """Describes the script sources for run command. Use only one of script, scriptUri, commandId. + + :ivar script: Specifies the script content to be executed on the machine. + :vartype script: str + :ivar script_uri: Specifies the script download location. It can be either SAS URI of an Azure + storage blob with read access or public URI. + :vartype script_uri: str + :ivar command_id: Specifies the commandId of predefined built-in script. + :vartype command_id: str + :ivar script_uri_managed_identity: User-assigned managed identity that has access to scriptUri + in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make + sure the Azure storage blob exists, and managed identity has been given access to blob's + container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, + make sure you add it under VM's identity. For more info on managed identity and Run Command, + refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + :vartype script_uri_managed_identity: + ~azure.mgmt.hybridcompute.models.RunCommandManagedIdentity + """ + + _attribute_map = { + "script": {"key": "script", "type": "str"}, + "script_uri": {"key": "scriptUri", "type": "str"}, + "command_id": {"key": "commandId", "type": "str"}, + "script_uri_managed_identity": {"key": "scriptUriManagedIdentity", "type": "RunCommandManagedIdentity"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + script: Optional[str] = None, + script_uri: Optional[str] = None, + command_id: Optional[str] = None, + script_uri_managed_identity: Optional["_models.RunCommandManagedIdentity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword script: Specifies the script content to be executed on the machine. + :paramtype script: str + :keyword script_uri: Specifies the script download location. It can be either SAS URI of an + Azure storage blob with read access or public URI. + :paramtype script_uri: str + :keyword command_id: Specifies the commandId of predefined built-in script. + :paramtype command_id: str + :keyword script_uri_managed_identity: User-assigned managed identity that has access to + scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned + identity. Make sure the Azure storage blob exists, and managed identity has been given access + to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned + identity, make sure you add it under VM's identity. For more info on managed identity and Run + Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + :paramtype script_uri_managed_identity: + ~azure.mgmt.hybridcompute.models.RunCommandManagedIdentity + """ super().__init__(**kwargs) - self.status = None - self.installation_activity_id = None - self.reboot_status = None - self.maintenance_window_exceeded = None - self.excluded_patch_count = None - self.not_selected_patch_count = None - self.pending_patch_count = None - self.installed_patch_count = None - self.failed_patch_count = None - self.start_date_time = None - self.last_modified_date_time = None - self.started_by = None - self.patch_service_used = None - self.os_type = None - self.error_details = None - + self.script = script + self.script_uri = script_uri + self.command_id = command_id + self.script_uri_managed_identity = script_uri_managed_identity -class MachineListResult(_serialization.Model): - """The List hybrid machine operation response. - All required parameters must be populated in order to send to server. +class MachineRunCommandsListResult(_serialization.Model): + """Describes the Run Commands List Result. - :ivar value: The list of hybrid machines. Required. - :vartype value: list[~azure.mgmt.hybridcompute.models.Machine] - :ivar next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI to - fetch the next page of hybrid machines. + :ivar value: The list of run commands. + :vartype value: list[~azure.mgmt.hybridcompute.models.MachineRunCommand] + :ivar next_link: The uri to fetch the next page of run commands. Call ListNext() with this to + fetch the next page of run commands. :vartype next_link: str """ - _validation = { - "value": {"required": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[Machine]"}, + "value": {"key": "value", "type": "[MachineRunCommand]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: List["_models.Machine"], next_link: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + value: Optional[List["_models.MachineRunCommand"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword value: The list of hybrid machines. Required. - :paramtype value: list[~azure.mgmt.hybridcompute.models.Machine] - :keyword next_link: The URI to fetch the next page of Machines. Call ListNext() with this URI - to fetch the next page of hybrid machines. + :keyword value: The list of run commands. + :paramtype value: list[~azure.mgmt.hybridcompute.models.MachineRunCommand] + :keyword next_link: The uri to fetch the next page of run commands. Call ListNext() with this + to fetch the next page of run commands. :paramtype next_link: str """ super().__init__(**kwargs) @@ -3018,6 +4294,14 @@ def __init__(self, *, value: List["_models.Machine"], next_link: Optional[str] = self.next_link = next_link +class MachineRunCommandUpdate(ResourceUpdate): + """Describes a Machine Extension Update. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + class MachineUpdate(ResourceUpdate): """Describes a hybrid machine Update. @@ -3104,23 +4388,127 @@ def __init__( self.private_link_scope_resource_id = private_link_scope_resource_id +class NetworkConfiguration(ProxyResourceAutoGenerated): + """NetworkConfiguration. + + 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}. # pylint: disable=line-too-long + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar location: Resource location. + :vartype location: str + :ivar tenant_id: Azure resource tenant Id. + :vartype tenant_id: str + :ivar network_configuration_scope_id: Associated Network Configuration Scope Id (GUID). + :vartype network_configuration_scope_id: str + :ivar network_configuration_scope_resource_id: Associated Network Configuration Scope Resource + Id. + :vartype network_configuration_scope_resource_id: str + :ivar key_properties: Public key information for client authentication. + :vartype key_properties: ~azure.mgmt.hybridcompute.models.KeyProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "tenant_id": {"readonly": True}, + "key_properties": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "location": {"key": "properties.location", "type": "str"}, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "network_configuration_scope_id": {"key": "properties.networkConfigurationScopeId", "type": "str"}, + "network_configuration_scope_resource_id": { + "key": "properties.networkConfigurationScopeResourceId", + "type": "str", + }, + "key_properties": {"key": "properties.keyProperties", "type": "KeyProperties"}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + network_configuration_scope_id: Optional[str] = None, + network_configuration_scope_resource_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: Resource location. + :paramtype location: str + :keyword network_configuration_scope_id: Associated Network Configuration Scope Id (GUID). + :paramtype network_configuration_scope_id: str + :keyword network_configuration_scope_resource_id: Associated Network Configuration Scope + Resource Id. + :paramtype network_configuration_scope_resource_id: str + """ + super().__init__(**kwargs) + self.location = location + self.tenant_id = None + self.network_configuration_scope_id = network_configuration_scope_id + self.network_configuration_scope_resource_id = network_configuration_scope_resource_id + self.key_properties = None + + class NetworkInterface(_serialization.Model): """Describes a network interface. + :ivar mac_address: Represents MAC address of the network interface. + :vartype mac_address: str + :ivar id: Represents the ID of the network interface. + :vartype id: str + :ivar name: Represents the name of the network interface. + :vartype name: str :ivar ip_addresses: The list of IP addresses in this interface. :vartype ip_addresses: list[~azure.mgmt.hybridcompute.models.IpAddress] """ _attribute_map = { + "mac_address": {"key": "macAddress", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, "ip_addresses": {"key": "ipAddresses", "type": "[IpAddress]"}, } - def __init__(self, *, ip_addresses: Optional[List["_models.IpAddress"]] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + mac_address: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + ip_addresses: Optional[List["_models.IpAddress"]] = None, + **kwargs: Any + ) -> None: """ + :keyword mac_address: Represents MAC address of the network interface. + :paramtype mac_address: str + :keyword id: Represents the ID of the network interface. + :paramtype id: str + :keyword name: Represents the name of the network interface. + :paramtype name: str :keyword ip_addresses: The list of IP addresses in this interface. :paramtype ip_addresses: list[~azure.mgmt.hybridcompute.models.IpAddress] """ super().__init__(**kwargs) + self.mac_address = mac_address + self.id = id + self.name = name self.ip_addresses = ip_addresses @@ -3642,26 +5030,6 @@ def __init__( self.error = None -class ProxyResourceAutoGenerated(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}. # pylint: disable=line-too-long - :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 - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData - """ - - class PrivateEndpointConnection(ProxyResourceAutoGenerated): """A private endpoint connection. @@ -4044,6 +5412,34 @@ def __init__(self, *, status: str, description: str, **kwargs: Any) -> None: self.actions_required = None +class Processor(_serialization.Model): + """Describes the firmware of the machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the processor. + :vartype name: str + :ivar number_of_cores: The total number of physical cores on the processor. + :vartype number_of_cores: int + """ + + _validation = { + "name": {"readonly": True}, + "number_of_cores": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "number_of_cores": {"key": "numberOfCores", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.number_of_cores = None + + class ProductFeature(_serialization.Model): """Product Feature. @@ -4225,6 +5621,76 @@ def __init__(self, **kwargs: Any) -> None: self.access_mode = None +class RunCommandInputParameter(_serialization.Model): + """Describes the properties of a run command parameter. + + All required parameters must be populated in order to send to server. + + :ivar name: The run command parameter name. Required. + :vartype name: str + :ivar value: The run command parameter value. Required. + :vartype value: str + """ + + _validation = { + "name": {"required": True}, + "value": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, *, name: str, value: str, **kwargs: Any) -> None: + """ + :keyword name: The run command parameter name. Required. + :paramtype name: str + :keyword value: The run command parameter value. Required. + :paramtype value: str + """ + super().__init__(**kwargs) + self.name = name + self.value = value + + +class RunCommandManagedIdentity(_serialization.Model): + """Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that + has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object + in case of system-assigned identity. Make sure the Azure storage blob exists in case of + scriptUri, and managed identity has been given access to blob's container with 'Storage Blob + Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append + blobs(outputBlobUri, errorBlobUri). In case of user assigned identity, make sure you add it + under VM's identity. For more info on managed identity and Run Command, refer + https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + + :ivar client_id: Client Id (GUID value) of the user-assigned managed identity. ObjectId should + not be used if this is provided. + :vartype client_id: str + :ivar object_id: Object Id (GUID value) of the user-assigned managed identity. ClientId should + not be used if this is provided. + :vartype object_id: str + """ + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + } + + def __init__(self, *, client_id: Optional[str] = None, object_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword client_id: Client Id (GUID value) of the user-assigned managed identity. ObjectId + should not be used if this is provided. + :paramtype client_id: str + :keyword object_id: Object Id (GUID value) of the user-assigned managed identity. ClientId + should not be used if this is provided. + :paramtype object_id: str + """ + super().__init__(**kwargs) + self.client_id = client_id + self.object_id = object_id + + class ServiceStatus(_serialization.Model): """Describes the status and behavior of a service. @@ -4285,6 +5751,75 @@ def __init__( self.guest_configuration_service = guest_configuration_service +class Settings(ProxyResourceAutoGenerated): + """Settings. + + 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}. # pylint: disable=line-too-long + :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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.hybridcompute.models.SystemData + :ivar tenant_id: Azure resource tenant Id. + :vartype tenant_id: str + :ivar gateway_resource_id: Associated Gateway Resource Id. + :vartype gateway_resource_id: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "tenant_id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "gateway_resource_id": {"key": "properties.gatewayProperties.gatewayResourceId", "type": "str"}, + } + + def __init__(self, *, gateway_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword gateway_resource_id: Associated Gateway Resource Id. + :paramtype gateway_resource_id: str + """ + super().__init__(**kwargs) + self.tenant_id = None + self.gateway_resource_id = gateway_resource_id + + +class StorageProfile(_serialization.Model): + """Describes the storage configuration of the machine. + + :ivar disks: The disks on the machine. + :vartype disks: list[~azure.mgmt.hybridcompute.models.Disk] + """ + + _attribute_map = { + "disks": {"key": "disks", "type": "[Disk]"}, + } + + def __init__(self, *, disks: Optional[List["_models.Disk"]] = None, **kwargs: Any) -> None: + """ + :keyword disks: The disks on the machine. + :paramtype disks: list[~azure.mgmt.hybridcompute.models.Disk] + """ + super().__init__(**kwargs) + self.disks = disks + + class Subnet(_serialization.Model): """Describes the subnet. diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py index 83cdf6243d70a..dd6e6ab896437 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py @@ -12,8 +12,14 @@ from ._machine_extensions_operations import MachineExtensionsOperations from ._hybrid_compute_management_client_operations import HybridComputeManagementClientOperationsMixin from ._extension_metadata_operations import ExtensionMetadataOperations +from ._extension_metadata_v2_operations import ExtensionMetadataV2Operations +from ._extension_type_operations import ExtensionTypeOperations +from ._extension_publisher_operations import ExtensionPublisherOperations from ._operations import Operations from ._network_profile_operations import NetworkProfileOperations +from ._machine_run_commands_operations import MachineRunCommandsOperations +from ._gateways_operations import GatewaysOperations +from ._settings_operations import SettingsOperations from ._private_link_scopes_operations import PrivateLinkScopesOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations @@ -30,8 +36,14 @@ "MachineExtensionsOperations", "HybridComputeManagementClientOperationsMixin", "ExtensionMetadataOperations", + "ExtensionMetadataV2Operations", + "ExtensionTypeOperations", + "ExtensionPublisherOperations", "Operations", "NetworkProfileOperations", + "MachineRunCommandsOperations", + "GatewaysOperations", + "SettingsOperations", "PrivateLinkScopesOperations", "PrivateLinkResourcesOperations", "PrivateEndpointConnectionsOperations", diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py index 6d07603fae985..7c0d08bcceabe 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_operations.py @@ -45,7 +45,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_v2_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_v2_operations.py new file mode 100644 index 0000000000000..70cee43a2a168 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_metadata_v2_operations.py @@ -0,0 +1,265 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request(location: str, publisher: str, extension_type: str, version: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str", min_length=1), + "publisher": _SERIALIZER.url("publisher", publisher, "str"), + "extensionType": _SERIALIZER.url("extension_type", extension_type, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request(location: str, publisher: str, extension_type: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str", min_length=1), + "publisher": _SERIALIZER.url("publisher", publisher, "str"), + "extensionType": _SERIALIZER.url("extension_type", extension_type, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ExtensionMetadataV2Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`extension_metadata_v2` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, location: str, publisher: str, extension_type: str, version: str, **kwargs: Any + ) -> _models.ExtensionValueV2: + """Gets an Extension Metadata based on location, publisher, extensionType and version. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :param version: The version of the Extension being received. Required. + :type version: str + :return: ExtensionValueV2 or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.ExtensionValueV2 + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionValueV2] = kwargs.pop("cls", None) + + _request = build_get_request( + location=location, + publisher=publisher, + extension_type=extension_type, + version=version, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ExtensionValueV2", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, location: str, publisher: str, extension_type: str, **kwargs: Any + ) -> Iterable["_models.ExtensionValueV2"]: + """Gets all Extension versions based on location, publisher, extensionType. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :param extension_type: The extensionType of the Extension being received. Required. + :type extension_type: str + :return: An iterator like instance of either ExtensionValueV2 or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.ExtensionValueV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionValueListResultV2] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + publisher=publisher, + extension_type=extension_type, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionValueListResultV2", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_publisher_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_publisher_operations.py new file mode 100644 index 0000000000000..95c0bea5d815b --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_publisher_operations.py @@ -0,0 +1,160 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(location: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.HybridCompute/locations/{location}/publishers") + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ExtensionPublisherOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`extension_publisher` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> Iterable["_models.ExtensionPublisher"]: + """Gets all Extension publishers based on the location. + + :param location: The name of Azure region. Required. + :type location: str + :return: An iterator like instance of either ExtensionPublisher or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.ExtensionPublisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionPublisherListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionPublisherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_type_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_type_operations.py new file mode 100644 index 0000000000000..5b335ec55f3c2 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_extension_type_operations.py @@ -0,0 +1,166 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(location: str, publisher: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes" + ) # pylint: disable=line-too-long + path_format_arguments = { + "location": _SERIALIZER.url("location", location, "str", min_length=1), + "publisher": _SERIALIZER.url("publisher", publisher, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ExtensionTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`extension_type` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, location: str, publisher: str, **kwargs: Any) -> Iterable["_models.ExtensionType"]: + """Gets all Extension types based on location and publisher. + + :param location: The name of Azure region. Required. + :type location: str + :param publisher: The publisher of the Extension being received. Required. + :type publisher: str + :return: An iterator like instance of either ExtensionType or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.ExtensionType] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ExtensionTypeListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + publisher=publisher, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionTypeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_gateways_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_gateways_operations.py new file mode 100644 index 0000000000000..f37378e54a4bd --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_gateways_operations.py @@ -0,0 +1,895 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_create_or_update_request( + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request(resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class GatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`gateways` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _create_or_update_initial( + self, resource_group_name: str, gateway_name: str, parameters: Union[_models.Gateway, IO[bytes]], **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Gateway") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + parameters: _models.Gateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Gateway]: + """The operation to create or update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Create gateway operation. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Gateway + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Gateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.Gateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Gateway]: + """The operation to create or update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Create gateway operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Gateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.Gateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, resource_group_name: str, gateway_name: str, parameters: Union[_models.Gateway, IO[bytes]], **kwargs: Any + ) -> LROPoller[_models.Gateway]: + """The operation to create or update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Create gateway operation. Is either a Gateway + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Gateway or IO[bytes] + :return: An instance of LROPoller that returns either Gateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.Gateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Gateway] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Gateway", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Gateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Gateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_group_name: str, + gateway_name: str, + parameters: _models.GatewayUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Gateway: + """The operation to update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Update gateway operation. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.GatewayUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Gateway or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Gateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + gateway_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Gateway: + """The operation to update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Update gateway operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Gateway or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Gateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + gateway_name: str, + parameters: Union[_models.GatewayUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.Gateway: + """The operation to update a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :param parameters: Parameters supplied to the Update gateway operation. Is either a + GatewayUpdate type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.GatewayUpdate or IO[bytes] + :return: Gateway or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Gateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Gateway] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "GatewayUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Gateway", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> _models.Gateway: + """Retrieves information about the view of a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :return: Gateway or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Gateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Gateway] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Gateway", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, gateway_name: str, **kwargs: Any) -> LROPoller[None]: + """The operation to delete a gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gateway_name: The name of the Gateway. Required. + :type gateway_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Gateway"]: + """The operation to get all gateways of a non-Azure machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either Gateway or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.Gateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.GatewaysListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("GatewaysListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Gateway"]: + """The operation to get all gateways of a non-Azure machine. + + :return: An iterator like instance of either Gateway or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.Gateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.GatewaysListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("GatewaysListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py index 09955df19f3ac..18702ebd4363d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_hybrid_compute_management_client_operations.py @@ -49,7 +49,7 @@ def build_upgrade_extensions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -81,6 +81,44 @@ def build_upgrade_extensions_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_setup_extensions_request( + resource_group_name: str, machine_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/setupExtensions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", max_length=54, min_length=1, pattern=r"^[a-zA-Z0-9-_\.]{1,54}$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class HybridComputeManagementClientOperationsMixin( # pylint: disable=name-too-long HybridComputeManagementClientMixinABC ): @@ -281,3 +319,204 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _setup_extensions_initial( + self, + resource_group_name: str, + machine_name: str, + extension_setup_body: Union[_models.MachineExtensionSetup, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(extension_setup_body, (IOBase, bytes)): + _content = extension_setup_body + else: + _json = self._serialize.body(extension_setup_body, "MachineExtensionSetup") + + _request = build_setup_extensions_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extension_setup_body: _models.MachineExtensionSetup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MachineExtensionSetup]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extension_setup_body: Parameters supplied to the Setup Extensions operation. Required. + :type extension_setup_body: ~azure.mgmt.hybridcompute.models.MachineExtensionSetup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either MachineExtensionSetup or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineExtensionSetup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extension_setup_body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MachineExtensionSetup]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extension_setup_body: Parameters supplied to the Setup Extensions operation. Required. + :type extension_setup_body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either MachineExtensionSetup or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineExtensionSetup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_setup_extensions( + self, + resource_group_name: str, + machine_name: str, + extension_setup_body: Union[_models.MachineExtensionSetup, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.MachineExtensionSetup]: + """The operation to Setup Machine Extensions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param extension_setup_body: Parameters supplied to the Setup Extensions operation. Is either a + MachineExtensionSetup type or a IO[bytes] type. Required. + :type extension_setup_body: ~azure.mgmt.hybridcompute.models.MachineExtensionSetup or IO[bytes] + :return: An instance of LROPoller that returns either MachineExtensionSetup or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineExtensionSetup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MachineExtensionSetup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._setup_extensions_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + extension_setup_body=extension_setup_body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MachineExtensionSetup", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.MachineExtensionSetup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MachineExtensionSetup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_license_profiles_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_license_profiles_operations.py index 3c3bb0722c977..27db073b0b858 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_license_profiles_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_license_profiles_operations.py @@ -50,7 +50,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) license_profile_name: Literal["default"] = kwargs.pop("license_profile_name", "default") content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -88,7 +88,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) license_profile_name: Literal["default"] = kwargs.pop("license_profile_name", "default") content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -124,7 +124,7 @@ def build_get_request(resource_group_name: str, machine_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) license_profile_name: Literal["default"] = kwargs.pop("license_profile_name", "default") accept = _headers.pop("Accept", "application/json") @@ -159,7 +159,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) license_profile_name: Literal["default"] = kwargs.pop("license_profile_name", "default") accept = _headers.pop("Accept", "application/json") @@ -192,7 +192,7 @@ def build_list_request(resource_group_name: str, machine_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_licenses_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_licenses_operations.py index 522d0e49cfeb1..0822db4b8a980 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_licenses_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_licenses_operations.py @@ -48,7 +48,7 @@ def build_validate_license_request(subscription_id: str, **kwargs: Any) -> HttpR _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -79,7 +79,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -115,7 +115,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -149,7 +149,7 @@ def build_get_request(resource_group_name: str, license_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +213,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +243,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py index faeed55d7cc9a..7b8d19961e973 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py @@ -50,7 +50,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -89,7 +89,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -128,7 +128,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +164,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +200,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -548,7 +548,7 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> 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. The name is case insensitive. Required. @@ -581,7 +581,7 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> 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. The name is case insensitive. Required. @@ -612,7 +612,7 @@ def begin_update( extension_parameters: Union[_models.MachineExtensionUpdate, IO[bytes]], **kwargs: Any ) -> 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. The name is case insensitive. Required. diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_run_commands_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_run_commands_operations.py new file mode 100644 index 0000000000000..51e692e6db06e --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_run_commands_operations.py @@ -0,0 +1,687 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_create_or_update_request( + resource_group_name: str, machine_name: str, run_command_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "machineName": _SERIALIZER.url("machine_name", machine_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + "runCommandName": _SERIALIZER.url("run_command_name", run_command_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, machine_name: str, run_command_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "machineName": _SERIALIZER.url("machine_name", machine_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + "runCommandName": _SERIALIZER.url("run_command_name", run_command_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, machine_name: str, run_command_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "machineName": _SERIALIZER.url("machine_name", machine_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + "runCommandName": _SERIALIZER.url("run_command_name", run_command_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_request( + resource_group_name: str, machine_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "machineName": _SERIALIZER.url("machine_name", machine_name, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class MachineRunCommandsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`machine_run_commands` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _create_or_update_initial( + self, + resource_group_name: str, + machine_name: str, + run_command_name: str, + run_command_properties: Union[_models.MachineRunCommand, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(run_command_properties, (IOBase, bytes)): + _content = run_command_properties + else: + _json = self._serialize.body(run_command_properties, "MachineRunCommand") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + run_command_name=run_command_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + machine_name: str, + run_command_name: str, + run_command_properties: _models.MachineRunCommand, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MachineRunCommand]: + """The operation to create or update a run command. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param run_command_name: The name of the run command. Required. + :type run_command_name: str + :param run_command_properties: Parameters supplied to the Create Run Command. Required. + :type run_command_properties: ~azure.mgmt.hybridcompute.models.MachineRunCommand + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either MachineRunCommand or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + machine_name: str, + run_command_name: str, + run_command_properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MachineRunCommand]: + """The operation to create or update a run command. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param run_command_name: The name of the run command. Required. + :type run_command_name: str + :param run_command_properties: Parameters supplied to the Create Run Command. Required. + :type run_command_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either MachineRunCommand or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + machine_name: str, + run_command_name: str, + run_command_properties: Union[_models.MachineRunCommand, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.MachineRunCommand]: + """The operation to create or update a run command. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param run_command_name: The name of the run command. Required. + :type run_command_name: str + :param run_command_properties: Parameters supplied to the Create Run Command. Is either a + MachineRunCommand type or a IO[bytes] type. Required. + :type run_command_properties: ~azure.mgmt.hybridcompute.models.MachineRunCommand or IO[bytes] + :return: An instance of LROPoller that returns either MachineRunCommand or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridcompute.models.MachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MachineRunCommand] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + run_command_name=run_command_name, + run_command_properties=run_command_properties, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("MachineRunCommand", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.MachineRunCommand].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MachineRunCommand]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, machine_name: str, run_command_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + run_command_name=run_command_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, machine_name: str, run_command_name: str, **kwargs: Any + ) -> LROPoller[None]: + """The operation to delete a run command. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param run_command_name: The name of the run command. Required. + :type run_command_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + machine_name=machine_name, + run_command_name=run_command_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, machine_name: str, run_command_name: str, **kwargs: Any + ) -> _models.MachineRunCommand: + """The operation to get a run command. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param run_command_name: The name of the run command. Required. + :type run_command_name: str + :return: MachineRunCommand or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.MachineRunCommand + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.MachineRunCommand] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + run_command_name=run_command_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MachineRunCommand", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, machine_name: str, expand: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.MachineRunCommand"]: + """The operation to get all the run commands of a non-Azure machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param machine_name: The name of the hybrid machine. Required. + :type machine_name: str + :param expand: The expand expression to apply on the operation. Default value is None. + :type expand: str + :return: An iterator like instance of either MachineRunCommand or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridcompute.models.MachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.MachineRunCommandsListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MachineRunCommandsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py index f7b5aa5af5530..9e9abb8a8bf72 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py @@ -50,7 +50,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +90,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +127,7 @@ def build_assess_patches_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +158,7 @@ def build_install_patches_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -192,7 +192,7 @@ def build_list_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +224,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py index 5590a8669fb15..44a563b53852c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_profile_operations.py @@ -41,7 +41,7 @@ def build_get_request(resource_group_name: str, machine_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_security_perimeter_configurations_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_security_perimeter_configurations_operations.py index 0ff7c66c6cc81..a98c0a5c9ddb0 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_security_perimeter_configurations_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_network_security_perimeter_configurations_operations.py @@ -49,7 +49,7 @@ def build_get_by_private_link_scope_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_list_by_private_link_scope_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_reconcile_for_private_link_scope_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py index 215be56d7f668..47974e37b96c3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py @@ -43,7 +43,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py index a6b88b28fc165..21265f10b15a9 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py @@ -54,7 +54,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -137,7 +137,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +173,7 @@ def build_list_by_private_link_scope_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py index dc08404513484..c9a03f7e09bc7 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py @@ -45,7 +45,7 @@ def build_list_by_private_link_scope_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py index 2c55fd0ca0d4e..f87c1403346ab 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py @@ -48,7 +48,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_delete_request(resource_group_name: str, scope_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +135,7 @@ def build_get_request(resource_group_name: str, scope_name: str, subscription_id _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +168,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -204,7 +204,7 @@ def build_update_tags_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -240,7 +240,7 @@ def build_get_validation_details_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +271,7 @@ def build_get_validation_details_for_machine_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +284,9 @@ def build_get_validation_details_for_machine_request( # pylint: disable=name-to "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "machineName": _SERIALIZER.url("machine_name", machine_name, "str", min_length=1), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", min_length=1, pattern=r"^[a-zA-Z0-9-_\.]{1,54}$" + ), } _url: str = _url.format(**path_format_arguments) # type: ignore diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_settings_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_settings_operations.py new file mode 100644 index 0000000000000..ded232cf1f109 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_settings_operations.py @@ -0,0 +1,601 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request( + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "baseProvider": _SERIALIZER.url("base_provider", base_provider, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + "baseResourceType": _SERIALIZER.url( + "base_resource_type", base_resource_type, "str", pattern=r"[a-zA-Z0-9-_\.]+" + ), + "baseResourceName": _SERIALIZER.url( + "base_resource_name", base_resource_name, "str", pattern=r"[a-zA-Z0-9-_\.]+" + ), + "settingsResourceName": _SERIALIZER.url( + "settings_resource_name", settings_resource_name, "str", pattern=r"default" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "baseProvider": _SERIALIZER.url("base_provider", base_provider, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + "baseResourceType": _SERIALIZER.url( + "base_resource_type", base_resource_type, "str", pattern=r"[a-zA-Z0-9-_\.]+" + ), + "baseResourceName": _SERIALIZER.url( + "base_resource_name", base_resource_name, "str", pattern=r"[a-zA-Z0-9-_\.]+" + ), + "settingsResourceName": _SERIALIZER.url( + "settings_resource_name", settings_resource_name, "str", pattern=r"default" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_patch_request( + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-10-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "baseProvider": _SERIALIZER.url("base_provider", base_provider, "str", pattern=r"[a-zA-Z0-9-_\.]+"), + "baseResourceType": _SERIALIZER.url( + "base_resource_type", base_resource_type, "str", pattern=r"[a-zA-Z0-9-_\.]+" + ), + "baseResourceName": _SERIALIZER.url( + "base_resource_name", base_resource_name, "str", pattern=r"[a-zA-Z0-9-_\.]+" + ), + "settingsResourceName": _SERIALIZER.url( + "settings_resource_name", settings_resource_name, "str", pattern=r"default" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +class SettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridcompute.HybridComputeManagementClient`'s + :attr:`settings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + **kwargs: Any + ) -> _models.Settings: + """Returns the base Settings for the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Settings] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + base_provider=base_provider, + base_resource_type=base_resource_type, + base_resource_name=base_resource_name, + settings_resource_name=settings_resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Settings", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: _models.Settings, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Settings: + """Updates the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Settings + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Settings: + """Updates the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: Union[_models.Settings, IO[bytes]], + **kwargs: Any + ) -> _models.Settings: + """Updates the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Is either a Settings type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Settings or IO[bytes] + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Settings] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Settings") + + _request = build_update_request( + resource_group_name=resource_group_name, + base_provider=base_provider, + base_resource_type=base_resource_type, + base_resource_name=base_resource_name, + settings_resource_name=settings_resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Settings", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def patch( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: _models.Settings, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Settings: + """Update the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Settings + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def patch( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Settings: + """Update the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def patch( + self, + resource_group_name: str, + base_provider: str, + base_resource_type: str, + base_resource_name: str, + settings_resource_name: str, + parameters: Union[_models.Settings, IO[bytes]], + **kwargs: Any + ) -> _models.Settings: + """Update the base Settings of the target resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param base_provider: The name of the base Resource Provider. Required. + :type base_provider: str + :param base_resource_type: The name of the base Resource Type. Required. + :type base_resource_type: str + :param base_resource_name: The name of the base resource. Required. + :type base_resource_name: str + :param settings_resource_name: The name of the settings resource. Required. + :type settings_resource_name: str + :param parameters: Settings details. Is either a Settings type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.hybridcompute.models.Settings or IO[bytes] + :return: Settings or the result of cls(response) + :rtype: ~azure.mgmt.hybridcompute.models.Settings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Settings] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Settings") + + _request = build_patch_request( + resource_group_name=resource_group_name, + base_provider=base_provider, + base_resource_type=base_resource_type, + base_resource_name=base_resource_name, + settings_resource_name=settings_resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Settings", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_create_or_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_create_or_update.py index c3517c188c60e..042e35c1b8d3b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_create_or_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_create_or_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_CreateOrUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/Extension_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_delete.py index b93fee6e9cdfd..43ac13cbbc7af 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/Extension_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_get.py index 304fdcdce22fe..5877ca825dccc 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/Extension_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_list.py index 9c91a50cbb0e6..c3b3f7c4e61d5 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/Extension_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_get.py index 6f6d4bbba462e..f2be7bd920c92 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/ExtensionMetadata_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_list.py index 13f74d1659b2b..2ee9dd957ed0c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/ExtensionMetadata_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_get.py new file mode 100644 index 0000000000000..874df6eaf7ed2 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_get.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_metadata_v2_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.extension_metadata_v2.get( + location="EastUS", + publisher="microsoft.azure.monitor", + extension_type="azuremonitorlinuxagent", + version="1.33.0", + ) + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/ExtensionMetadataV2_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_list.py new file mode 100644 index 0000000000000..286670753641a --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_metadata_v2_list.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_metadata_v2_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.extension_metadata_v2.list( + location="EastUS", + publisher="microsoft.azure.monitor", + extension_type="azuremonitorlinuxagent", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/ExtensionMetadataV2_List.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_publisher_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_publisher_list.py new file mode 100644 index 0000000000000..2d9908d93df50 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_publisher_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_publisher_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.extension_publisher.list( + location="EastUS", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/ExtensionPublisher_List.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_setup.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_setup.py new file mode 100644 index 0000000000000..339f0c690d94f --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_setup.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_setup.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="{subscriptionId}", + ) + + response = client.begin_setup_extensions( + resource_group_name="myResourceGroup", + machine_name="myMachine", + extension_setup_body={ + "extensionSetupList": [ + {"publisher": "Microsoft.Azure.Monitoring", "type": "AzureMonitorAgentLinux"}, + {"publisher": "", "type": ""}, + ] + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/Extension_Setup.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_type_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_type_list.py new file mode 100644 index 0000000000000..03c66257ce77c --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_type_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python extension_type_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.extension_type.list( + location="EastUS", + publisher="microsoft.azure.monitor", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/ExtensionType_List.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_update.py index 8253dbdd9d3fb..886f52da8ae43 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extension_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/Extension_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extensions_upgrade.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extensions_upgrade.py index 1f5ada0a4b03e..0a7206bdb7afb 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extensions_upgrade.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/extension/extensions_upgrade.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extensions_Upgrade.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/extension/Extensions_Upgrade.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_create_or_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_create_or_update.py new file mode 100644 index 0000000000000..e9dc6f4004fb9 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_create_or_update.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python gateway_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="ffd506c8-3415-42d3-9612-fdb423fb17df", + ) + + response = client.gateways.begin_create_or_update( + resource_group_name="myResourceGroup", + gateway_name="{gatewayName}", + parameters={"location": "eastus2euap", "properties": {"allowedFeatures": ["*"], "gatewayType": "Public"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/gateway/Gateway_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_delete.py new file mode 100644 index 0000000000000..858bb19b05034 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_delete.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python gateway_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="ffd506c8-3415-42d3-9612-fdb423fb17df", + ) + + client.gateways.begin_delete( + resource_group_name="myResourceGroup", + gateway_name="{gatewayName}", + ).result() + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/gateway/Gateway_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_get.py new file mode 100644 index 0000000000000..0b4408a7f2bea --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python gateway_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="ffd506c8-3415-42d3-9612-fdb423fb17df", + ) + + response = client.gateways.get( + resource_group_name="myResourceGroup", + gateway_name="{gatewayName}", + ) + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/gateway/Gateway_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_resource_group.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_resource_group.py new file mode 100644 index 0000000000000..4d4d85776b181 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_resource_group.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python gateway_list_by_resource_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="ffd506c8-3415-42d3-9612-fdb423fb17df", + ) + + response = client.gateways.list_by_resource_group( + resource_group_name="myResourceGroup", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/gateway/Gateway_ListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_subscription.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_subscription.py new file mode 100644 index 0000000000000..0db371e87571f --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_list_by_subscription.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python gateway_list_by_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="ffd506c8-3415-42d3-9612-fdb423fb17df", + ) + + response = client.gateways.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/gateway/Gateway_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_update.py new file mode 100644 index 0000000000000..b3b2836cc0019 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/gateway/gateway_update.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python gateway_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="ffd506c8-3415-42d3-9612-fdb423fb17df", + ) + + response = client.gateways.update( + resource_group_name="myResourceGroup", + gateway_name="{gatewayName}", + parameters={"properties": {"allowedFeatures": ["*"]}}, + ) + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/gateway/Gateway_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_create_or_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_create_or_update.py index 2f4102ca2387b..1a2933cd99427 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_create_or_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_create_or_update.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_CreateOrUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/license/License_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_delete.py index 7c9f879d6eb24..f9d87dd8ab2a4 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/license/License_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_get.py index 02c511e7db263..a753d31638f17 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/license/License_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_resource_group.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_resource_group.py index eb938ab20a039..6b13a11c9b585 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_resource_group.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_ListByResourceGroup.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/license/License_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_subscription.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_subscription.py index dc0b53da54fef..babeab8774f81 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_subscription.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_ListBySubscription.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/license/License_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_update.py index 3ba5c6eeb0716..41aca926d748b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/license/License_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_validate_license.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_validate_license.py index 759180be6c9eb..d61f527c2eb90 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_validate_license.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license/license_validate_license.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_ValidateLicense.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/license/License_ValidateLicense.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_create_or_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_create_or_update.py index dacbb739adebd..9b1aefc08c2bb 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_create_or_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_create_or_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_CreateOrUpdate.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/licenseProfile/LicenseProfile_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_delete.py index a9077890f1cc9..d2a4990c5211c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/licenseProfile/LicenseProfile_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_get.py index acad38f01f582..a64f6f7526c8e 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/licenseProfile/LicenseProfile_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_list.py index 17b5e59c477c1..8b7b018bdd46d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/licenseProfile/LicenseProfile_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_update.py index 366346b7c224a..449a41ff83194 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/license_profile/license_profile_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/licenseProfile/LicenseProfile_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_assess_patches.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_assess_patches.py index d11ecac252e90..21a1028f2c44f 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_assess_patches.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_assess_patches.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machine_AssessPatches.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/machine/Machine_AssessPatches.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_install_patches.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_install_patches.py index cdced9c6583df..d8ddc8c25ec8c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_install_patches.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machine_install_patches.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machine_InstallPatches.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/machine/Machine_InstallPatches.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_delete.py index f3ec75d29c9a2..e270d157e04c4 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_delete.py @@ -36,6 +36,6 @@ def main(): ) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/machine/Machines_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get.py index ff28061826b54..373da2c251725 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/machine/Machines_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get_license_profile_instance_view.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get_license_profile_instance_view.py index 41deeffe7434c..86d06a6b25903 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get_license_profile_instance_view.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_get_license_profile_instance_view.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get_LicenseProfileInstanceView.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_resource_group.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_resource_group.py index 5dfb73a9ed994..afc5af18aae7d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_resource_group.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_ListByResourceGroup.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/machine/Machines_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_subscription.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_subscription.py index 2fc4d1ea456c5..2ab562408f637 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_subscription.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/machine/machines_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_ListBySubscription.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/machine/Machines_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_profile_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_profile_get.py index 8aac9afff832c..d1c873f389afb 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_profile_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_profile_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/NetworkProfile_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/NetworkProfile_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_get.py index 0391b2cde82ba..f73d60127a5c1 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_list.py index fdaf27c30b98f..d12eb8cd0c3b5 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationList.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationList.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_reconcile.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_reconcile.py index 1b8fc280c55da..7e452604a76f6 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_reconcile.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/network_security_perimeter_configuration/network_security_perimeter_configuration_reconcile.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationReconcile.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationReconcile.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py index 3f4becdc6ba72..f49ea33dc744a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/Operations_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_delete.py index 3a24fed7bebf3..337b369f972bd 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateEndpoint/PrivateEndpointConnection_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_get.py index 329d8cc62d84e..9c4f4bdcdf00b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_list.py index 847279f9fae66..55958dd3ca67b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateEndpoint/PrivateEndpointConnection_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_update.py index 24fbfb6a4a11c..084fe01e6ea7f 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_endpoint/private_endpoint_connection_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_get.py index da116732bcf1b..ace19f903b7e3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_list_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_list_get.py index 62f0684d09cad..93cbd6093403c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_list_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scope_private_link_resource_list_get.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_create.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_create.py index e0e559e525f8e..c8ec27d0c8584 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_create.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_create.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Create.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateLinkScope/PrivateLinkScopes_Create.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_delete.py index e4d26aab5b1b8..0d24bc4b01645 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_delete.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Delete.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateLinkScope/PrivateLinkScopes_Delete.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get.py index 47af57c65710f..ce255d31cd1f2 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Get.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation.py index 6aa99f4be2495..d1917d7b8e357 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation_for_machine.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation_for_machine.py index b8ff9c11e6e44..c49960b991e02 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation_for_machine.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_get_validation_for_machine.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list.py index a7a18e90be73e..e9714fc3251db 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_List.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateLinkScope/PrivateLinkScopes_List.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list_by_resource_group.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list_by_resource_group.py index 4b89527e720d9..71dede3ae7db8 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list_by_resource_group.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_update.py index 6ec57c842b69c..8fcb00f0c2f63 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_update.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/private_link_scope/private_link_scopes_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Update.json +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/privateLinkScope/PrivateLinkScopes_Update.json if __name__ == "__main__": main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_create_or_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_create_or_update.py new file mode 100644 index 0000000000000..2a84fa284f4aa --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_create_or_update.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python run_commands_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="{subscriptionId}", + ) + + response = client.machine_run_commands.begin_create_or_update( + resource_group_name="myResourceGroup", + machine_name="myMachine", + run_command_name="myRunCommand", + run_command_properties={ + "location": "eastus2", + "properties": { + "asyncExecution": False, + "errorBlobUri": "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", + "outputBlobUri": "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", + "parameters": [{"name": "param1", "value": "value1"}, {"name": "param2", "value": "value2"}], + "runAsPassword": "", + "runAsUser": "user1", + "source": {"script": "Write-Host Hello World!"}, + "timeoutInSeconds": 3600, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/runCommand/RunCommands_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_delete.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_delete.py new file mode 100644 index 0000000000000..64316ca6b9e9c --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python run_commands_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="{subscriptionId}", + ) + + client.machine_run_commands.begin_delete( + resource_group_name="myResourceGroup", + machine_name="myMachine", + run_command_name="myRunCommand", + ).result() + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/runCommand/RunCommands_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_get.py new file mode 100644 index 0000000000000..78c3d72c76166 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python run_commands_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="{subscriptionId}", + ) + + response = client.machine_run_commands.get( + resource_group_name="myResourceGroup", + machine_name="myMachine", + run_command_name="myRunCommand", + ) + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/runCommand/RunCommands_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_list.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_list.py new file mode 100644 index 0000000000000..4bf222c6a23bf --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/run_command/run_commands_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python run_commands_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="{subscriptionId}", + ) + + response = client.machine_run_commands.list( + resource_group_name="myResourceGroup", + machine_name="myMachine", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/runCommand/RunCommands_List.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_get.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_get.py new file mode 100644 index 0000000000000..8306348ccb004 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_get.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python settings_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.settings.get( + resource_group_name="hybridRG", + base_provider="Microsoft.HybridCompute", + base_resource_type="machines", + base_resource_name="testMachine", + settings_resource_name="default", + ) + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/settings/SettingsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_patch.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_patch.py new file mode 100644 index 0000000000000..551af2cdb7bdb --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_patch.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python settings_patch.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.settings.patch( + resource_group_name="hybridRG", + base_provider="Microsoft.HybridCompute", + base_resource_type="machines", + base_resource_name="testMachine", + settings_resource_name="default", + parameters={ + "properties": { + "gatewayProperties": { + "gatewayResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway" + } + } + }, + ) + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/settings/SettingsPatch.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_update.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_update.py new file mode 100644 index 0000000000000..d8c7cb68d8bfe --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_samples/settings/settings_update.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridcompute +# USAGE + python settings_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridComputeManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.settings.update( + resource_group_name="hybridRG", + base_provider="Microsoft.HybridCompute", + base_resource_type="machines", + base_resource_name="testMachine", + settings_resource_name="default", + parameters={ + "properties": { + "gatewayProperties": { + "gatewayResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway" + } + } + }, + ) + print(response) + + +# x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-09-10-preview/examples/settings/SettingsUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management.py index 21147743a7db2..86575dfc21422 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management.py @@ -25,7 +25,46 @@ def test_begin_upgrade_extensions(self, resource_group): resource_group_name=resource_group.name, machine_name="str", extension_upgrade_parameters={"extensionTargets": {"str": {"targetVersion": "str"}}}, - api_version="2024-07-10", + api_version="2024-09-10-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_setup_extensions(self, resource_group): + response = self.client.begin_setup_extensions( + resource_group_name=resource_group.name, + machine_name="str", + extension_setup_body={ + "extensionSetupList": [ + { + "autoUpgradeMinorVersion": bool, + "enableAutomaticUpgrade": bool, + "forceUpdateTag": "str", + "instanceView": { + "name": "str", + "status": { + "code": "str", + "displayStatus": "str", + "level": "str", + "message": "str", + "time": "2020-02-20 00:00:00", + }, + "type": "str", + "typeHandlerVersion": "str", + }, + "protectedSettings": {"str": {}}, + "provisioningState": "str", + "publisher": "str", + "settings": {"str": {}}, + "type": "str", + "typeHandlerVersion": "str", + } + ] + }, + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_async.py index c5e032f942da4..74d69a455b3a3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_async.py @@ -27,7 +27,48 @@ async def test_begin_upgrade_extensions(self, resource_group): resource_group_name=resource_group.name, machine_name="str", extension_upgrade_parameters={"extensionTargets": {"str": {"targetVersion": "str"}}}, - api_version="2024-07-10", + api_version="2024-09-10-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_setup_extensions(self, resource_group): + response = await ( + await self.client.begin_setup_extensions( + resource_group_name=resource_group.name, + machine_name="str", + extension_setup_body={ + "extensionSetupList": [ + { + "autoUpgradeMinorVersion": bool, + "enableAutomaticUpgrade": bool, + "forceUpdateTag": "str", + "instanceView": { + "name": "str", + "status": { + "code": "str", + "displayStatus": "str", + "level": "str", + "message": "str", + "time": "2020-02-20 00:00:00", + }, + "type": "str", + "typeHandlerVersion": "str", + }, + "protectedSettings": {"str": {}}, + "provisioningState": "str", + "publisher": "str", + "settings": {"str": {}}, + "type": "str", + "typeHandlerVersion": "str", + } + ] + }, + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations.py index 21df16935f841..b18d74233112b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations.py @@ -26,7 +26,7 @@ def test_get(self, resource_group): publisher="str", extension_type="str", version="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_list(self, resource_group): location="str", publisher="str", extension_type="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations_async.py index 222cf03ddae2b..e6ad1ee1da4bc 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_operations_async.py @@ -27,7 +27,7 @@ async def test_get(self, resource_group): publisher="str", extension_type="str", version="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_list(self, resource_group): location="str", publisher="str", extension_type="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations.py new file mode 100644 index 0000000000000..321928937b8da --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionMetadataV2Operations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.extension_metadata_v2.get( + location="str", + publisher="str", + extension_type="str", + version="str", + api_version="2024-09-10-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.extension_metadata_v2.list( + location="str", + publisher="str", + extension_type="str", + api_version="2024-09-10-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations_async.py new file mode 100644 index 0000000000000..0a64278e1b1e9 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_metadata_v2_operations_async.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute.aio import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionMetadataV2OperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_get(self, resource_group): + response = await self.client.extension_metadata_v2.get( + location="str", + publisher="str", + extension_type="str", + version="str", + api_version="2024-09-10-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list(self, resource_group): + response = self.client.extension_metadata_v2.list( + location="str", + publisher="str", + extension_type="str", + api_version="2024-09-10-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations.py new file mode 100644 index 0000000000000..2a0d57c34f11e --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionPublisherOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.extension_publisher.list( + location="str", + api_version="2024-09-10-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations_async.py new file mode 100644 index 0000000000000..c4c4d918a4ac7 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_publisher_operations_async.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute.aio import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionPublisherOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list(self, resource_group): + response = self.client.extension_publisher.list( + location="str", + api_version="2024-09-10-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations.py new file mode 100644 index 0000000000000..e7573baade4e2 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionTypeOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.extension_type.list( + location="str", + publisher="str", + api_version="2024-09-10-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations_async.py new file mode 100644 index 0000000000000..2c88495e4721c --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_extension_type_operations_async.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridcompute.aio import HybridComputeManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridComputeManagementExtensionTypeOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridComputeManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_list(self, resource_group): + response = self.client.extension_type.list( + location="str", + publisher="str", + api_version="2024-09-10-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations.py index aa1678bf9e8a6..df182d729187d 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations.py @@ -44,7 +44,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -57,7 +57,7 @@ def test_update(self, resource_group): resource_group_name=resource_group.name, gateway_name="str", parameters={"allowedFeatures": ["str"], "tags": {"str": "str"}}, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ def test_get(self, resource_group): response = self.client.gateways.get( resource_group_name=resource_group.name, gateway_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -81,7 +81,7 @@ def test_begin_delete(self, resource_group): response = self.client.gateways.begin_delete( resource_group_name=resource_group.name, gateway_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -92,7 +92,7 @@ def test_begin_delete(self, resource_group): def test_list_by_resource_group(self, resource_group): response = self.client.gateways.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -102,7 +102,7 @@ def test_list_by_resource_group(self, resource_group): @recorded_by_proxy def test_list_by_subscription(self, resource_group): response = self.client.gateways.list_by_subscription( - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations_async.py index adf849d61f419..147aa84a52ba6 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_gateways_operations_async.py @@ -46,7 +46,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -60,7 +60,7 @@ async def test_update(self, resource_group): resource_group_name=resource_group.name, gateway_name="str", parameters={"allowedFeatures": ["str"], "tags": {"str": "str"}}, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -72,7 +72,7 @@ async def test_get(self, resource_group): response = await self.client.gateways.get( resource_group_name=resource_group.name, gateway_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -85,7 +85,7 @@ async def test_begin_delete(self, resource_group): await self.client.gateways.begin_delete( resource_group_name=resource_group.name, gateway_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -97,7 +97,7 @@ async def test_begin_delete(self, resource_group): async def test_list_by_resource_group(self, resource_group): response = self.client.gateways.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -107,7 +107,7 @@ async def test_list_by_resource_group(self, resource_group): @recorded_by_proxy_async async def test_list_by_subscription(self, resource_group): response = self.client.gateways.list_by_subscription( - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations.py index 20d05a4ee3c87..8352d3974d67a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations.py @@ -77,7 +77,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", license_profile_name="default", ).result() # call '.result()' to poll until service return final result @@ -98,7 +98,7 @@ def test_begin_update(self, resource_group): "subscriptionStatus": "str", "tags": {"str": "str"}, }, - api_version="2024-07-10", + api_version="2024-09-10-preview", license_profile_name="default", ).result() # call '.result()' to poll until service return final result @@ -111,7 +111,7 @@ def test_get(self, resource_group): response = self.client.license_profiles.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", license_profile_name="default", ) @@ -124,7 +124,7 @@ def test_begin_delete(self, resource_group): response = self.client.license_profiles.begin_delete( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", license_profile_name="default", ).result() # call '.result()' to poll until service return final result @@ -137,7 +137,7 @@ def test_list(self, resource_group): response = self.client.license_profiles.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations_async.py index 2ce84af43e6b0..56d2cc19e060a 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_license_profiles_operations_async.py @@ -79,7 +79,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", license_profile_name="default", ) ).result() # call '.result()' to poll until service return final result @@ -102,7 +102,7 @@ async def test_begin_update(self, resource_group): "subscriptionStatus": "str", "tags": {"str": "str"}, }, - api_version="2024-07-10", + api_version="2024-09-10-preview", license_profile_name="default", ) ).result() # call '.result()' to poll until service return final result @@ -116,7 +116,7 @@ async def test_get(self, resource_group): response = await self.client.license_profiles.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", license_profile_name="default", ) @@ -130,7 +130,7 @@ async def test_begin_delete(self, resource_group): await self.client.license_profiles.begin_delete( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", license_profile_name="default", ) ).result() # call '.result()' to poll until service return final result @@ -144,7 +144,7 @@ async def test_list(self, resource_group): response = self.client.license_profiles.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations.py index 28f20ded80d0f..20a5e01efb12b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations.py @@ -50,7 +50,7 @@ def test_begin_validate_license(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -90,7 +90,7 @@ def test_begin_create_or_update(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -111,7 +111,7 @@ def test_begin_update(self, resource_group): "target": "str", "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -123,7 +123,7 @@ def test_get(self, resource_group): response = self.client.licenses.get( resource_group_name=resource_group.name, license_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -135,7 +135,7 @@ def test_begin_delete(self, resource_group): response = self.client.licenses.begin_delete( resource_group_name=resource_group.name, license_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -146,7 +146,7 @@ def test_begin_delete(self, resource_group): def test_list_by_resource_group(self, resource_group): response = self.client.licenses.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -156,7 +156,7 @@ def test_list_by_resource_group(self, resource_group): @recorded_by_proxy def test_list_by_subscription(self, resource_group): response = self.client.licenses.list_by_subscription( - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations_async.py index 705277e81c809..2b0b16948d421 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_licenses_operations_async.py @@ -52,7 +52,7 @@ async def test_begin_validate_license(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -94,7 +94,7 @@ async def test_begin_create_or_update(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -117,7 +117,7 @@ async def test_begin_update(self, resource_group): "target": "str", "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -130,7 +130,7 @@ async def test_get(self, resource_group): response = await self.client.licenses.get( resource_group_name=resource_group.name, license_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -143,7 +143,7 @@ async def test_begin_delete(self, resource_group): await self.client.licenses.begin_delete( resource_group_name=resource_group.name, license_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -155,7 +155,7 @@ async def test_begin_delete(self, resource_group): async def test_list_by_resource_group(self, resource_group): response = self.client.licenses.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -165,7 +165,7 @@ async def test_list_by_resource_group(self, resource_group): @recorded_by_proxy_async async def test_list_by_subscription(self, resource_group): response = self.client.licenses.list_by_subscription( - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations.py index 10b0f847a2571..b71fabad83793 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations.py @@ -63,7 +63,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -87,7 +87,7 @@ def test_begin_update(self, resource_group): "type": "str", "typeHandlerVersion": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -100,7 +100,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, machine_name="str", extension_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -113,7 +113,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, machine_name="str", extension_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -125,7 +125,7 @@ def test_list(self, resource_group): response = self.client.machine_extensions.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations_async.py index 3320b80e75001..6b54a422e7460 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_extensions_operations_async.py @@ -65,7 +65,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -91,7 +91,7 @@ async def test_begin_update(self, resource_group): "type": "str", "typeHandlerVersion": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -106,7 +106,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, machine_name="str", extension_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -120,7 +120,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, machine_name="str", extension_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -132,7 +132,7 @@ async def test_list(self, resource_group): response = self.client.machine_extensions.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations.py index 852ba4adb2f37..a51ca077502e9 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations.py @@ -75,7 +75,7 @@ def test_begin_create_or_update(self, resource_group): "timeoutInSeconds": 0, "type": "str", }, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -88,7 +88,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, machine_name="str", run_command_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -101,7 +101,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, machine_name="str", run_command_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -113,7 +113,7 @@ def test_list(self, resource_group): response = self.client.machine_run_commands.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations_async.py index a357800aad1a1..7a7249f86aa05 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machine_run_commands_operations_async.py @@ -77,7 +77,7 @@ async def test_begin_create_or_update(self, resource_group): "timeoutInSeconds": 0, "type": "str", }, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -92,7 +92,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, machine_name="str", run_command_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -106,7 +106,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, machine_name="str", run_command_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -118,7 +118,7 @@ async def test_list(self, resource_group): response = self.client.machine_run_commands.list( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations.py index 8569a1382a3b1..4c4fdf79c3ae2 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations.py @@ -24,7 +24,7 @@ def test_delete(self, resource_group): response = self.client.machines.delete( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -36,7 +36,7 @@ def test_get(self, resource_group): response = self.client.machines.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -48,7 +48,7 @@ def test_begin_assess_patches(self, resource_group): response = self.client.machines.begin_assess_patches( resource_group_name=resource_group.name, name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -76,7 +76,7 @@ def test_begin_install_patches(self, resource_group): "maxPatchPublishDate": "2020-02-20 00:00:00", }, }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -87,7 +87,7 @@ def test_begin_install_patches(self, resource_group): def test_list_by_resource_group(self, resource_group): response = self.client.machines.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -97,7 +97,7 @@ def test_list_by_resource_group(self, resource_group): @recorded_by_proxy def test_list_by_subscription(self, resource_group): response = self.client.machines.list_by_subscription( - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations_async.py index 3156b600210b3..59328c5faba78 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_machines_operations_async.py @@ -25,7 +25,7 @@ async def test_delete(self, resource_group): response = await self.client.machines.delete( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -37,7 +37,7 @@ async def test_get(self, resource_group): response = await self.client.machines.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -50,7 +50,7 @@ async def test_begin_assess_patches(self, resource_group): await self.client.machines.begin_assess_patches( resource_group_name=resource_group.name, name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -80,7 +80,7 @@ async def test_begin_install_patches(self, resource_group): "maxPatchPublishDate": "2020-02-20 00:00:00", }, }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -92,7 +92,7 @@ async def test_begin_install_patches(self, resource_group): async def test_list_by_resource_group(self, resource_group): response = self.client.machines.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -102,7 +102,7 @@ async def test_list_by_resource_group(self, resource_group): @recorded_by_proxy_async async def test_list_by_subscription(self, resource_group): response = self.client.machines.list_by_subscription( - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations.py index 94f0280a0fa00..b4de368afa479 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations.py @@ -24,7 +24,7 @@ def test_get(self, resource_group): response = self.client.network_profile.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations_async.py index 3582c0fbc2724..4ddcb48ed0b38 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_profile_operations_async.py @@ -25,7 +25,7 @@ async def test_get(self, resource_group): response = await self.client.network_profile.get( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations.py index def35e1036516..6ded318270bb3 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations.py @@ -25,7 +25,7 @@ def test_get_by_private_link_scope(self, resource_group): resource_group_name=resource_group.name, scope_name="str", perimeter_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_list_by_private_link_scope(self, resource_group): response = self.client.network_security_perimeter_configurations.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -50,7 +50,7 @@ def test_begin_reconcile_for_private_link_scope(self, resource_group): resource_group_name=resource_group.name, scope_name="str", perimeter_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations_async.py index 99b906e2c9354..e46bea5dc36f6 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_network_security_perimeter_configurations_operations_async.py @@ -26,7 +26,7 @@ async def test_get_by_private_link_scope(self, resource_group): resource_group_name=resource_group.name, scope_name="str", perimeter_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_list_by_private_link_scope(self, resource_group): response = self.client.network_security_perimeter_configurations.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -52,7 +52,7 @@ async def test_begin_reconcile_for_private_link_scope(self, resource_group): resource_group_name=resource_group.name, scope_name="str", perimeter_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations.py index 8ac1d7afb139c..f7c6d62a9786b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_list(self, resource_group): response = self.client.operations.list( - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations_async.py index 38debf283f91f..64b83413d956c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_list(self, resource_group): response = self.client.operations.list( - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations.py index ace2796caf43a..2753df736e68e 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations.py @@ -25,7 +25,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, scope_name="str", private_endpoint_connection_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -61,7 +61,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -74,7 +74,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, scope_name="str", private_endpoint_connection_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,7 +86,7 @@ def test_list_by_private_link_scope(self, resource_group): response = self.client.private_endpoint_connections.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations_async.py index 99d1ed6f74df6..7a4254f95fcda 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_endpoint_connections_operations_async.py @@ -26,7 +26,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, scope_name="str", private_endpoint_connection_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -63,7 +63,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -78,7 +78,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, scope_name="str", private_endpoint_connection_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -91,7 +91,7 @@ async def test_list_by_private_link_scope(self, resource_group): response = self.client.private_endpoint_connections.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations.py index 40cfa0f3f6dcd..ad5959b731975 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations.py @@ -24,7 +24,7 @@ def test_list_by_private_link_scope(self, resource_group): response = self.client.private_link_resources.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, scope_name="str", group_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations_async.py index d670c5f650918..4be1fa89ee747 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list_by_private_link_scope(self, resource_group): response = self.client.private_link_resources.list_by_private_link_scope( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, scope_name="str", group_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations.py index 5a68937970a3e..a2394b616b038 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_list(self, resource_group): response = self.client.private_link_scopes.list( - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_list(self, resource_group): def test_list_by_resource_group(self, resource_group): response = self.client.private_link_scopes.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_begin_delete(self, resource_group): response = self.client.private_link_scopes.begin_delete( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -57,7 +57,7 @@ def test_get(self, resource_group): response = self.client.private_link_scopes.get( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -106,7 +106,7 @@ def test_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -119,7 +119,7 @@ def test_update_tags(self, resource_group): resource_group_name=resource_group.name, scope_name="str", private_link_scope_tags={"tags": {"str": "str"}}, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -131,7 +131,7 @@ def test_get_validation_details(self, resource_group): response = self.client.private_link_scopes.get_validation_details( location="str", private_link_scope_id="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -143,7 +143,7 @@ def test_get_validation_details_for_machine(self, resource_group): response = self.client.private_link_scopes.get_validation_details_for_machine( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations_async.py index 5b5a26108a23c..dc83b99f37eb0 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_private_link_scopes_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_list(self, resource_group): response = self.client.private_link_scopes.list( - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_list(self, resource_group): async def test_list_by_resource_group(self, resource_group): response = self.client.private_link_scopes.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -47,7 +47,7 @@ async def test_begin_delete(self, resource_group): await self.client.private_link_scopes.begin_delete( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) ).result() # call '.result()' to poll until service return final result @@ -60,7 +60,7 @@ async def test_get(self, resource_group): response = await self.client.private_link_scopes.get( resource_group_name=resource_group.name, scope_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -109,7 +109,7 @@ async def test_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -122,7 +122,7 @@ async def test_update_tags(self, resource_group): resource_group_name=resource_group.name, scope_name="str", private_link_scope_tags={"tags": {"str": "str"}}, - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -134,7 +134,7 @@ async def test_get_validation_details(self, resource_group): response = await self.client.private_link_scopes.get_validation_details( location="str", private_link_scope_id="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -146,7 +146,7 @@ async def test_get_validation_details_for_machine(self, resource_group): response = await self.client.private_link_scopes.get_validation_details_for_machine( resource_group_name=resource_group.name, machine_name="str", - api_version="2024-07-10", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations.py index 49d5808bb97b0..7403837849fcb 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations.py @@ -27,7 +27,7 @@ def test_get(self, resource_group): base_resource_type="str", base_resource_name="str", settings_resource_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -57,7 +57,7 @@ def test_update(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -87,7 +87,7 @@ def test_patch(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations_async.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations_async.py index 71f5d256e4d42..f7b9d145d1789 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations_async.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/generated_tests/test_hybrid_compute_management_settings_operations_async.py @@ -28,7 +28,7 @@ async def test_get(self, resource_group): base_resource_type="str", base_resource_name="str", settings_resource_name="str", - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -58,7 +58,7 @@ async def test_update(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself @@ -88,7 +88,7 @@ async def test_patch(self, resource_group): "tenantId": "str", "type": "str", }, - api_version="2024-05-20-preview", + api_version="2024-09-10-preview", ) # please add some check logic here by yourself