From 77e8f4c837ff859935df891a564cf5ed2b8f6076 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Thu, 22 Sep 2022 16:25:03 -0400 Subject: [PATCH 01/44] Implement registry creation in sdk --- .../azure/ai/ml/constants/__init__.py | 27 -------- .../azure/ai/ml/constants/_registry.py | 28 -------- .../ai/ml/entities/_registry/identity.py | 41 +++++++++++ .../ai/ml/entities/_registry/registry.py | 38 ++++++++++- .../_registry/registry_support_classes.py | 68 +++++++++++++++++++ .../ai/ml/operations/_registry_operations.py | 43 ++++++++++-- .../registry/e2etests/WIP_test_registry.py | 27 -------- .../tests/registry/e2etests/test_registry.py | 43 ++++++++++++ .../test_configs/registry/registry_valid.yaml | 6 +- .../registry/registry_valid_min.yaml | 10 +++ 10 files changed, 239 insertions(+), 92 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/identity.py delete mode 100644 sdk/ml/azure-ai-ml/tests/registry/e2etests/WIP_test_registry.py create mode 100644 sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py create mode 100644 sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py deleted file mode 100644 index a38f567afd7d..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# --------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# --------------------------------------------------------- - -__path__ = __import__("pkgutil").extend_path(__path__, __name__) - -from ._common import AssetTypes, GitProperties, InputOutputModes, ModelType, TimeZone -from ._component import ParallelTaskType -from ._deployment import BatchDeploymentOutputAction -from ._job import AutoMLConstants, AutoMLTransformerParameterKeys, DistributionType, ImportSourceType, JobType -from ._workspace import ManagedServiceIdentityType - -__all__ = [ - "ImportSourceType", - "JobType", - "ParallelTaskType", - "AssetTypes", - "InputOutputModes", - "AutoMLConstants", - "AutoMLTransformerParameterKeys", - "GitProperties", - "DistributionType", - "TimeZone", - "BatchDeploymentOutputAction", - "ModelType", - "ManagedServiceIdentityType", -] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py deleted file mode 100644 index 117777b06eca..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py +++ /dev/null @@ -1,28 +0,0 @@ -# --------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# --------------------------------------------------------- -import re -from enum import Enum - - -class StorageAccountType(str, Enum): - STANDARD_LRS = "Standard_LRS".lower() - STANDARD_GRS = "Standard_GRS".lower() - STANDARD_RAGRS = "Standard_RAGRS".lower() - STANDARD_ZRS = "Standard_ZRS".lower() - STANDARD_GZRS = "Standard_GZRS".lower() - STANDARD_RAGZRS = "Standard_RAGZRS".lower() - PREMIUM_LRS = "Premium_LRS".lower() - PREMIUM_ZRS = "Premium_ZRS".lower() - - -# based on /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/ -# # ...providers/Microsoft.Storage/storageAccounts/{StorageAccountName} -STORAGE_ACCOUNT_FORMAT = re.compile( - ("/subscriptions/(.*)/resourceGroups/(.*)/providers/Microsoft.Storage/storageAccounts/(.*)") -) -# based on /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/ -# # ...providers/Microsoft.ContainerRegistry/registries/{AcrName}\ -ACR_ACCOUNT_FORMAT = re.compile( - ("/subscriptions/(.*)/resourceGroups/(.*)/providers/Microsoft.ContainerRegistry/registries/(.*)") -) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/identity.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/identity.py new file mode 100644 index 000000000000..778b16691347 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/identity.py @@ -0,0 +1,41 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +from typing import Dict, Optional, Union + +from azure.ai.ml._restclient.v2022_10_01_preview.models import ManagedServiceIdentity as RestManagedServiceIdentity +from azure.ai.ml._restclient.v2022_10_01_preview.models import UserAssignedIdentity as RestUserAssignedIdentity +from azure.ai.ml.constants._workspace import ManagedServiceIdentityType + + +class ManagedServiceIdentity: + """Managed service identity (system assigned and/or user assigned identities).""" + + def __init__( + self, + *, + type: Union[str, "ManagedServiceIdentityType"], + principal_id: str = None, + tenant_id: str = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + ): + self.type = type + self.principal_id = principal_id + self.tenant_id = tenant_id + self.user_assigned_identities = user_assigned_identities + + def _to_rest_object(self) -> RestManagedServiceIdentity: + return RestManagedServiceIdentity( + type=self.type, + principal_id=self.principal_id, + tenant_id=self.tenant_id, + ) + + @classmethod + def _from_rest_object(cls, obj: RestManagedServiceIdentity) -> "ManagedServiceIdentity": + return cls( + type=obj.type, + principal_id=obj.principal_id, + tenant_id=obj.tenant_id, + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index 5dc36feb0761..d2758bdccfb0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -8,10 +8,16 @@ from pathlib import Path from typing import IO, AnyStr, Dict, List, Union +from azure.ai.ml._restclient.v2022_10_01_preview.models import ManagedServiceIdentity as RestManagedServiceIdentity +from azure.ai.ml._restclient.v2022_10_01_preview.models import ( + ManagedServiceIdentityType as RestManagedServiceIdentityType, +) from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry +from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryProperties from azure.ai.ml._schema.registry.registry import RegistrySchema from azure.ai.ml._utils.utils import dump_yaml_to_file from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY +from azure.ai.ml.entities._registry.identity import ManagedServiceIdentity from azure.ai.ml.entities._resource import Resource from azure.ai.ml.entities._util import load_from_dict @@ -28,6 +34,7 @@ def __init__( *, name: str, location: str, + identity: ManagedServiceIdentity = None, description: str = None, tags: Dict[str, str] = None, public_network_access: str = None, @@ -38,7 +45,6 @@ def __init__( region_details: List[RegistryRegionArmDetails], **kwargs, ): - """Azure ML registry. :param name: Name of the registry. Must be globally unique and is immutable. @@ -65,6 +71,7 @@ def __init__( # self.display_name = name # Do we need a top-level visible name value? self.location = location + self.identity = identity self.region_details = region_details self.public_network_access = public_network_access self.intellectual_property_publisher = intellectual_property_publisher @@ -116,9 +123,13 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": region_details = [ RegistryRegionArmDetails._from_rest_object(details) for details in real_registry.region_details ] + identity = None + if rest_obj.identity and isinstance(rest_obj.identity, RestManagedServiceIdentity): + identity = ManagedServiceIdentity._from_rest_object(rest_obj.identity) return Registry( name=rest_obj.name, description=real_registry.description, + identity=identity, tags=real_registry.tags, location=rest_obj.location, public_network_access=real_registry.public_network_access, @@ -148,3 +159,28 @@ def _convert_yaml_dict_to_entity_input(cls, input: Dict): if global_acr_exists: if not hasattr(region_detail, "acr_details") or len(region_detail.acr_details) == 0: region_detail.acr_config = [acr_input] + + def _to_rest_object(self) -> RestRegistry: + """Build current parameterized schedule instance to a registry object before submission. + + :return: Rest registry. + """ + identity = RestManagedServiceIdentity(type=RestManagedServiceIdentityType.SYSTEM_ASSIGNED) + region_details = [] + if self.region_details: + region_details = [details._to_rest_object() for details in self.region_details] + return RestRegistry( + name=self.name, + location=self.location, + identity=identity, + properties=RegistryProperties( + description=self.description, + tags=self.tags, + public_network_access=self.public_network_access, + discovery_url=self.discovery_url, + intellectual_property_publisher=self.intellectual_property_publisher, + managed_resource_group=self.managed_resource_group, + ml_flow_registry_uri=self.mlflow_registry_uri, + region_details=region_details, + ), + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index e68080d598d9..b40721409091 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -5,8 +5,19 @@ from typing import List, Union from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails as RestAcrDetails +from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId as RestArmResourceId from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryRegionArmDetails as RestRegistryRegionArmDetails +from azure.ai.ml._restclient.v2022_10_01_preview.models import SkuTier from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountDetails as RestStorageAccountDetails +from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountType as RestStorageAccountType +from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount as RestSystemCreatedAcrAccount +from azure.ai.ml._restclient.v2022_10_01_preview.models import ( + SystemCreatedStorageAccount as RestSystemCreatedStorageAccount, +) +from azure.ai.ml._restclient.v2022_10_01_preview.models import UserCreatedAcrAccount as RestUserCreatedAcrAccount +from azure.ai.ml._restclient.v2022_10_01_preview.models import ( + UserCreatedStorageAccount as RestUserCreatedStorageAccount, +) from azure.ai.ml.constants._registry import StorageAccountType @@ -98,6 +109,37 @@ def _from_rest_object(cls, rest_obj: RestRegistryRegionArmDetails) -> "RegistryR acr_config=converted_acr_details, location=rest_obj.location, storage_config=storages ) + def _to_rest_object(self) -> RestRegistryRegionArmDetails: + converted_acr_details = [] + if self.acr_config: + converted_acr_details = [convert_to_rest_acr(acr) for acr in self.acr_config] + storages = [] + if self.storage_config: + storages = [convert_to_rest_storage(storage) for storage in self.storage_config] + return RestRegistryRegionArmDetails( + acr_details=converted_acr_details, + location=self.location, + storage_account_details=storages, + ) + + +def convert_to_rest_acr(acr: Union[str, RestSystemCreatedAcrAccount]) -> RestAcrDetails: + # if not type(acr) is str: + # return RestAcrDetails( + # system_created_storage_account=RestSystemCreatedAcrAccount( + # acr.acr_account_sku, RestArmResourceId(resource_id=acr.arm_resource_id) + # ) + # ) + # else: + # return RestAcrDetails( + # user_created_acr_account=RestUserCreatedAcrAccount(arm_resource_id=RestArmResourceId(resource_id=acr)) + # ) + acr_account = RestAcrDetails( + system_created_acr_account=RestSystemCreatedAcrAccount(acr_account_sku=SkuTier.PREMIUM) + ) + + return acr_account + def convert_rest_acr(rest_obj: RestAcrDetails) -> "Union[str, SystemCreatedAcrAccount]": if not rest_obj: @@ -114,6 +156,32 @@ def convert_rest_acr(rest_obj: RestAcrDetails) -> "Union[str, SystemCreatedAcrAc return None # TODO should this throw an error instead? +def convert_to_rest_storage(storage: Union[str, SystemCreatedStorageAccount]) -> RestStorageAccountDetails: + # if not type(storage) is str: + # storage_account_type = StorageAccountType( + # storage.storage_account_type.lower()) + # account = RestSystemCreatedStorageAccount( + # arm_resource_id=RestArmResourceId( + # resource_id=storage.arm_resource_id), + # storage_account_hns_enabled=storage.storage_account_hns, + # storage_account_type=storage_account_type, + # ) + # return RestStorageAccountDetails(system_created_storage_account=account) + # else: + # return RestStorageAccountDetails( + # user_created_storage_account=RestUserCreatedStorageAccount( + # arm_resource_id=RestArmResourceId(resource_id=storage) + # ) + # ) + storage_account = RestStorageAccountDetails( + system_created_storage_account=RestSystemCreatedStorageAccount( + storage_account_hns=False, storage_account_type=RestStorageAccountType.STANDARD_LRS + ) + ) + + return storage_account + + def convert_rest_storage(rest_obj: RestStorageAccountDetails) -> "Union[str, SystemCreatedStorageAccount]": if not rest_obj: return None diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 99cde1d5e32f..7136621cb41b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -7,14 +7,17 @@ from typing import Dict, Iterable from azure.ai.ml._restclient.v2022_10_01_preview import AzureMachineLearningWorkspaces as ServiceClient102022 -from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry from azure.ai.ml._scope_dependent_operations import OperationsContainer, OperationScope -from azure.ai.ml._telemetry import AML_INTERNAL_LOGGER_NAMESPACE, ActivityType, monitor_with_activity +from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml.entities import Registry from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationException from azure.core.credentials import TokenCredential from azure.core.polling import LROPoller +from azure.mgmt.msi._managed_service_identity_client import ManagedServiceIdentityClient + +from .._utils._azureml_polling import AzureMLPolling +from ..constants._common import LROConfigurations ops_logger = OpsLogger(__name__) logger, module_logger = ops_logger.logger, ops_logger.module_logger @@ -86,11 +89,39 @@ def _check_registry_name(self, name) -> str: ) return registry_name + def _get_polling(self, name): + """Return the polling with custom poll interval.""" + path_format_arguments = { + "registryName": name, + "resourceGroupName": self._resource_group_name, + } + return AzureMLPolling( + LROConfigurations.POLL_INTERVAL, + path_format_arguments=path_format_arguments, + ) + @monitor_with_activity(logger, "Registry.BeginCreate", ActivityType.PUBLICAPI) - def begin_create_or_update( + def begin_create( self, registry: Registry, - update_dependent_resources: bool = False, **kwargs: Dict, - ) -> LROPoller[RestRegistry]: - raise NotImplementedError("Placeholder until implemented in subsequent task.") + ) -> LROPoller["_models.Registry"]: + """Create a new Azure Machine Learning Registry. + + Returns the registry if already exists. + + :param registry: Registry definition. + :type registry: Registry + :type update_dependent_resources: boolean + :return: A poller to track the operation status. + :rtype: LROPoller + """ + registry_data = registry._to_rest_object() + poller = self._operation.begin_create_or_update( + resource_group_name=self._resource_group_name, # type: str + registry_name=registry.name, # type: str + body=registry_data, # type: "_models.Registry" + polling=self._get_polling(registry.name), + ) + + return poller diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/WIP_test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/WIP_test_registry.py deleted file mode 100644 index 49a062168d31..000000000000 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/WIP_test_registry.py +++ /dev/null @@ -1,27 +0,0 @@ -# # --------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# # --------------------------------------------------------- - -# import pytest -# from tests.conftest import crud_registry_client - -# from azure.ai.ml import MLClient -# from azure.ai.ml.entities._registry.registry import Registry -# from azure.core.paging import ItemPaged - - -# @pytest.mark.e2etest -# @pytest.mark.mlc -# class TestRegistry: -# # Need to implement more verbs for this to be functional - testing on hardcoded registry within pipeline causes authorization errors -# # However this test passed locally -# def WIP_test_registry_list_and_get( -# self, crud_registry_client: MLClient, randstr: Callable[[], str], location: str -# ) -> None: -# reg_name = "TestRegistryOperations" - -# registry = crud_registry_client.registries.get(reg_name) -# assert registry.name == reg_name - -# registry_list = crud_registry_client.registries.list() -# assert isinstance(registry_list, ItemPaged) diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py new file mode 100644 index 000000000000..c8b8c6fd4aaf --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -0,0 +1,43 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +from typing import Callable + +import pytest + +from azure.ai.ml import MLClient, load_registry +from azure.ai.ml.constants._common import LROConfigurations +from azure.ai.ml.entities._workspace.identity import ManagedServiceIdentityType +from azure.core.paging import ItemPaged + + +@pytest.mark.e2etest +@pytest.mark.mlc +class TestRegistry: + @pytest.mark.e2etest + @pytest.mark.mlc + def test_registry_list_and_get( + self, + crud_registry_client: MLClient, + randstr: Callable[[], str], + ) -> None: + reg_name = f"e2etest_{randstr()}" + params_override = [ + { + "name": reg_name, + } + ] + reg = load_registry( + source="./tests/test_configs/registry/registry_valid_min.yaml", params_override=params_override + ) + registry = crud_registry_client.registries.begin_create(registry=reg).result( + timeout=LROConfigurations.POLLING_TIMEOUT + ) + assert registry.name == reg_name + assert registry.identity.type == ManagedServiceIdentityType.SYSTEM_ASSIGNED + + registry_list = crud_registry_client.registries.list() + assert isinstance(registry_list, ItemPaged) + + registry = crud_registry_client.registries.get(name=reg_name) + assert registry.name == reg_name diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml index 70c0805cc4ff..effd97253039 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml @@ -10,7 +10,7 @@ intellectual_property_publisher: registry_publisher replication_locations: - location: EastUS storage_config: - - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False - storage_account_type: Standard_RAGRS + - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account + - storage_account_hns: False + storage_account_type: Standard_RAGRS container_registry: /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.ContainerRegistry/registries/acr_id diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml new file mode 100644 index 000000000000..dc647ebe012b --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml @@ -0,0 +1,10 @@ +description: This is a registry description +name: registry_name +location: WestCentralUS +replication_locations: + - location: WestCentralUS + storage_config: + - /subscriptions/b17253fa-f327-42d6-9686-f3e553e24763/resourceGroups/static_resources_cli_v2_e2e_tests_resources/providers/Microsoft.Storage/storageAccounts/testwsswstorage16668f03c + - storage_account_hns: False + storage_account_type: Standard_RAGRS +container_registry: /subscriptions/b17253fa-f327-42d6-9686-f3e553e24763/resourceGroups/static_resources_cli_v2_e2e_tests_resources/providers/Microsoft.ContainerRegistry/registries/clie2etestacr1 From 390aa78c2ee765beb5c519841745007df080ea1d Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Thu, 22 Sep 2022 16:34:00 -0400 Subject: [PATCH 02/44] Replace missing files from ADO migration --- .../azure/ai/ml/constants/__init__.py | 37 +++++++++++++++++ .../azure/ai/ml/constants/_registry.py | 40 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py new file mode 100644 index 000000000000..c86addc59caa --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py @@ -0,0 +1,37 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +__path__ = __import__("pkgutil").extend_path(__path__, __name__) + +from ._common import AssetTypes, GitProperties, InputOutputModes, ModelType, TimeZone +from ._component import ParallelTaskType +from ._deployment import BatchDeploymentOutputAction +from ._job import ( + DistributionType, + ImageClassificationModelNames, + ImageInstanceSegmentationModelNames, + ImageObjectDetectionModelNames, + ImportSourceType, + JobType, +) +from ._registry import ManagedServiceIdentityType as RegistryManagedServiceIdentityType +from ._workspace import ManagedServiceIdentityType + +__all__ = [ + "ImportSourceType", + "JobType", + "ParallelTaskType", + "AssetTypes", + "InputOutputModes", + "GitProperties", + "DistributionType", + "TimeZone", + "BatchDeploymentOutputAction", + "ModelType", + "ManagedServiceIdentityType", + "ImageClassificationModelNames", + "ImageObjectDetectionModelNames", + "ImageInstanceSegmentationModelNames", + "RegistryManagedServiceIdentityType", +] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py new file mode 100644 index 000000000000..75d2e649fc1f --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py @@ -0,0 +1,40 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +import re +from enum import Enum + + +class ManagedServiceIdentityType(str, Enum): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).""" + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + + +class StorageAccountType(str, Enum): + STANDARD_LRS = "Standard_LRS".lower() + STANDARD_GRS = "Standard_GRS".lower() + STANDARD_RAGRS = "Standard_RAGRS".lower() + STANDARD_ZRS = "Standard_ZRS".lower() + STANDARD_GZRS = "Standard_GZRS".lower() + STANDARD_RAGZRS = "Standard_RAGZRS".lower() + PREMIUM_LRS = "Premium_LRS".lower() + PREMIUM_ZRS = "Premium_ZRS".lower() + + +# When will other values be allowed? +class AcrAccountSku(str, Enum): + PREMIUM = "Premium".lower() + + +# based on /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/ +# # ...providers/Microsoft.Storage/storageAccounts/{StorageAccountName} +STORAGE_ACCOUNT_FORMAT = re.compile( + ("/subscriptions/(.*)/resourceGroups/(.*)/providers/Microsoft.Storage/storageAccounts/(.*)") +) +# based on /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/ +# # ...providers/Microsoft.ContainerRegistry/registries/{AcrName}\ +ACR_ACCOUNT_FORMAT = re.compile( + ("/subscriptions/(.*)/resourceGroups/(.*)/providers/Microsoft.ContainerRegistry/registries/(.*)") +) From c16be7fe2d17883b98e1667e7af0ae392d56f7b5 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Fri, 23 Sep 2022 12:15:00 -0400 Subject: [PATCH 03/44] Add additional unittest --- .../tests/registry/unittests/test_registry_operations.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index 4687f66a2743..b86b2c6ac8b6 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -2,13 +2,12 @@ from unittest.mock import DEFAULT, Mock, call, patch import pytest -from pytest_mock import MockFixture - from azure.ai.ml._scope_dependent_operations import OperationScope from azure.ai.ml.entities._registry.registry import Registry from azure.ai.ml.operations import RegistryOperations from azure.core.exceptions import ResourceExistsError from azure.core.polling import LROPoller +from pytest_mock import MockFixture @pytest.fixture @@ -40,3 +39,8 @@ def test_check_registry_name(self, mock_registry_operation: RegistryOperations): mock_registry_operation._default_registry_name = None with pytest.raises(Exception): mock_registry_operation._check_registry_name(None) + + def test_create(self, mock_registry_operation: RegistryOperations) -> None: + mock_registry_operation.begin_create() + mock_registry_operation._operation.begin_create_or_update.assert_called_once() + From 29e6bc220cbc8f80a172fa461af8be5cb17bea42 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Fri, 23 Sep 2022 16:58:41 -0400 Subject: [PATCH 04/44] Print existing registries until UPDATE implemented --- .../ai/ml/operations/_registry_operations.py | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 7136621cb41b..3aa705232f63 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -6,15 +6,19 @@ from typing import Dict, Iterable -from azure.ai.ml._restclient.v2022_10_01_preview import AzureMachineLearningWorkspaces as ServiceClient102022 -from azure.ai.ml._scope_dependent_operations import OperationsContainer, OperationScope +from azure.ai.ml._restclient.v2022_10_01_preview import \ + AzureMachineLearningWorkspaces as ServiceClient102022 +from azure.ai.ml._scope_dependent_operations import (OperationsContainer, + OperationScope) from azure.ai.ml._telemetry import ActivityType, monitor_with_activity from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml.entities import Registry -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationException +from azure.ai.ml.exceptions import (ErrorCategory, ErrorTarget, + ValidationException) from azure.core.credentials import TokenCredential from azure.core.polling import LROPoller -from azure.mgmt.msi._managed_service_identity_client import ManagedServiceIdentityClient +from azure.mgmt.msi._managed_service_identity_client import \ + ManagedServiceIdentityClient from .._utils._azureml_polling import AzureMLPolling from ..constants._common import LROConfigurations @@ -116,6 +120,17 @@ def begin_create( :return: A poller to track the operation status. :rtype: LROPoller """ + existing_registry = None + resource_group = self._resource_group_name + try: + existing_registry = self.get(name=registry.name) + except Exception: # pylint: disable=broad-except + pass + + if existing_registry: + # for now return existing registries until UPDATE is implemented + return existing_registry + registry_data = registry._to_rest_object() poller = self._operation.begin_create_or_update( resource_group_name=self._resource_group_name, # type: str From a5ef298fb2d11d978aea0070c5e942c2fcacc21b Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Mon, 26 Sep 2022 11:44:44 -0400 Subject: [PATCH 05/44] regenerate 10-01-preview autorest with manual fix --- .../_azure_machine_learning_workspaces.py | 7 +- .../v2022_10_01_preview/_configuration.py | 5 +- .../aio/_azure_machine_learning_workspaces.py | 7 +- .../v2022_10_01_preview/aio/_configuration.py | 5 +- .../_batch_deployments_operations.py | 85 ++-- .../operations/_batch_endpoints_operations.py | 96 ++-- .../operations/_code_containers_operations.py | 51 +- .../operations/_code_versions_operations.py | 51 +- .../_component_containers_operations.py | 51 +- .../_component_versions_operations.py | 51 +- .../aio/operations/_compute_operations.py | 199 ++++---- .../operations/_data_containers_operations.py | 51 +- .../operations/_data_versions_operations.py | 51 +- .../aio/operations/_datastores_operations.py | 62 +-- .../_environment_containers_operations.py | 51 +- .../_environment_versions_operations.py | 51 +- .../aio/operations/_jobs_operations.py | 82 +-- .../operations/_labeling_jobs_operations.py | 111 ++-- .../_model_containers_operations.py | 51 +- .../operations/_model_versions_operations.py | 51 +- .../_online_deployments_operations.py | 107 ++-- .../_online_endpoints_operations.py | 129 ++--- .../aio/operations/_operations.py | 17 +- ...private_endpoint_connections_operations.py | 51 +- .../_private_link_resources_operations.py | 16 +- .../aio/operations/_quotas_operations.py | 27 +- .../aio/operations/_registries_operations.py | 85 ++-- .../_registry_code_containers_operations.py | 67 +-- .../_registry_code_versions_operations.py | 67 +-- ...egistry_component_containers_operations.py | 67 +-- ..._registry_component_versions_operations.py | 67 +-- ...istry_environment_containers_operations.py | 67 +-- ...egistry_environment_versions_operations.py | 67 +-- .../_registry_model_containers_operations.py | 67 +-- .../_registry_model_versions_operations.py | 67 +-- .../aio/operations/_schedules_operations.py | 67 +-- .../aio/operations/_usages_operations.py | 17 +- .../_virtual_machine_sizes_operations.py | 16 +- .../_workspace_connections_operations.py | 51 +- .../_workspace_features_operations.py | 17 +- .../aio/operations/_workspaces_operations.py | 209 ++++---- .../v2022_10_01_preview/models/_models.py | 77 --- .../v2022_10_01_preview/models/_models_py3.py | 77 --- .../_batch_deployments_operations.py | 188 +++---- .../operations/_batch_endpoints_operations.py | 215 ++++---- .../operations/_code_containers_operations.py | 130 ++--- .../operations/_code_versions_operations.py | 134 ++--- .../_component_containers_operations.py | 132 ++--- .../_component_versions_operations.py | 136 ++--- .../operations/_compute_operations.py | 430 ++++++++-------- .../operations/_data_containers_operations.py | 132 ++--- .../operations/_data_versions_operations.py | 138 ++--- .../operations/_datastores_operations.py | 173 +++---- .../_environment_containers_operations.py | 132 ++--- .../_environment_versions_operations.py | 136 ++--- .../operations/_jobs_operations.py | 189 +++---- .../operations/_labeling_jobs_operations.py | 252 +++++----- .../_model_containers_operations.py | 134 ++--- .../operations/_model_versions_operations.py | 148 +++--- .../_online_deployments_operations.py | 252 +++++----- .../_online_endpoints_operations.py | 296 +++++------ .../operations/_operations.py | 35 +- ...private_endpoint_connections_operations.py | 128 ++--- .../_private_link_resources_operations.py | 37 +- .../operations/_quotas_operations.py | 68 +-- .../operations/_registries_operations.py | 204 ++++---- .../_registry_code_containers_operations.py | 146 +++--- .../_registry_code_versions_operations.py | 150 +++--- ...egistry_component_containers_operations.py | 146 +++--- ..._registry_component_versions_operations.py | 150 +++--- ...istry_environment_containers_operations.py | 148 +++--- ...egistry_environment_versions_operations.py | 152 +++--- .../_registry_model_containers_operations.py | 148 +++--- .../_registry_model_versions_operations.py | 160 +++--- .../operations/_schedules_operations.py | 148 +++--- .../operations/_usages_operations.py | 37 +- .../_virtual_machine_sizes_operations.py | 37 +- .../_workspace_connections_operations.py | 132 ++--- .../_workspace_features_operations.py | 37 +- .../operations/_workspaces_operations.py | 474 +++++++++--------- 80 files changed, 4301 insertions(+), 4251 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py index 54b433a18eee..d3c92e8135bc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py @@ -9,21 +9,22 @@ from copy import deepcopy from typing import TYPE_CHECKING -from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from azure.mgmt.core import ARMPipelineClient + from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, LabelingJobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional + from typing import Any from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse -class AzureMachineLearningWorkspaces(object): +class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py index 3c095542afad..f395f71d01fe 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py @@ -21,7 +21,7 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): +class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -31,7 +31,8 @@ class AzureMachineLearningWorkspacesConfiguration(Configuration): :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that overriding this default value may result in unsupported behavior. + :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that + overriding this default value may result in unsupported behavior. :paramtype api_version: str """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py index f38f5a082b39..bd38eaf1f3d9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py @@ -7,11 +7,12 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, Optional, TYPE_CHECKING +from typing import Any, Awaitable, TYPE_CHECKING + +from msrest import Deserializer, Serializer from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration @@ -21,7 +22,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspaces: +class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py index 58d868c71e24..dde99f5c7bff 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py @@ -19,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): +class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -29,7 +29,8 @@ class AzureMachineLearningWorkspacesConfiguration(Configuration): :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that overriding this default value may result in unsupported behavior. + :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that + overriding this default value may result in unsupported behavior. :paramtype api_version: str """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py index 41c5678e62fd..1483c2fe2ca7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -75,9 +74,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BatchDeploymentTrackedResourceArmPaginatedResult or the result of cls(response) @@ -137,7 +133,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -151,9 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -182,7 +182,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -199,11 +203,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -223,9 +227,6 @@ async def begin_delete( :type endpoint_name: str :param deployment_name: Inference deployment identifier. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -239,7 +240,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -273,10 +274,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -299,9 +299,6 @@ async def get( :type endpoint_name: str :param deployment_name: The identifier for the Batch deployments. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BatchDeployment, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment @@ -328,7 +325,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -343,7 +344,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( @@ -380,7 +381,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -403,7 +408,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async @@ -431,9 +436,6 @@ async def begin_update( :param body: Batch inference deployment definition object. :type body: ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -450,7 +452,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -489,10 +491,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -528,7 +529,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -550,7 +555,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async @@ -577,9 +582,6 @@ async def begin_create_or_update( :type deployment_name: str :param body: Batch inference deployment definition object. :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -596,7 +598,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -635,7 +637,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py index c9376b449969..a31ef8ddd428 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -69,9 +68,6 @@ def list( :type count: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BatchEndpointTrackedResourceArmPaginatedResult or the result of cls(response) @@ -127,7 +123,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -141,9 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -170,7 +170,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -187,11 +191,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -208,9 +212,6 @@ async def begin_delete( :type workspace_name: str :param endpoint_name: Inference Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -224,7 +225,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -257,10 +258,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -280,9 +280,6 @@ async def get( :type workspace_name: str :param endpoint_name: Name for the Batch Endpoint. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BatchEndpoint, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint @@ -308,7 +305,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -323,7 +324,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _update_initial( @@ -358,7 +359,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -381,7 +386,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async @@ -406,9 +411,6 @@ async def begin_update( :param body: Mutable batch inference endpoint definition object. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -425,7 +427,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -463,10 +465,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -500,7 +501,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -522,7 +527,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async @@ -546,9 +551,6 @@ async def begin_create_or_update( :type endpoint_name: str :param body: Batch inference endpoint definition object. :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -565,7 +567,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -603,10 +605,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -626,9 +627,6 @@ async def list_keys( :type workspace_name: str :param endpoint_name: Inference Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthKeys, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys @@ -654,7 +652,11 @@ async def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -669,5 +671,5 @@ async def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py index 4f0be951a934..51250fad9f43 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -64,9 +63,6 @@ def list( :type workspace_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the result of cls(response) @@ -120,7 +116,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -134,10 +134,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -154,9 +154,6 @@ async def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -182,7 +179,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -193,7 +194,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async @@ -214,9 +215,6 @@ async def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -242,7 +240,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -257,7 +259,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async @@ -281,9 +283,6 @@ async def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -313,7 +312,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -332,5 +335,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py index 5b1af5a04e03..6470da292155 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -73,9 +72,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the result of cls(response) @@ -135,7 +131,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -149,10 +149,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -172,9 +172,6 @@ async def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -201,7 +198,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -212,7 +213,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -236,9 +237,6 @@ async def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -265,7 +263,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -280,7 +282,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -307,9 +309,6 @@ async def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -340,7 +339,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -359,5 +362,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py index c31422dce68d..acbc0fe6d2a6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -67,9 +66,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or the result of cls(response) @@ -125,7 +121,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -139,10 +139,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -159,9 +159,6 @@ async def delete( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -187,7 +184,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -198,7 +199,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async @@ -219,9 +220,6 @@ async def get( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -247,7 +245,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -262,7 +264,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async @@ -286,9 +288,6 @@ async def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -318,7 +317,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -337,5 +340,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py index 83a32b62f87f..d3dbca43c2b8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -76,9 +75,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the result of cls(response) @@ -140,7 +136,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -154,10 +154,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -177,9 +177,6 @@ async def delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -206,7 +203,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -217,7 +218,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -241,9 +242,6 @@ async def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -270,7 +268,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -285,7 +287,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -312,9 +314,6 @@ async def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -345,7 +344,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -364,5 +367,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py index 67d8b0abc734..bf8c25a14d65 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -64,9 +63,6 @@ def list( :type workspace_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PaginatedComputeResourcesList or the result of cls(response) @@ -120,7 +116,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -134,7 +134,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace_async async def get( @@ -153,9 +153,6 @@ async def get( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComputeResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource @@ -181,7 +178,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -196,7 +197,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _create_or_update_initial( @@ -231,7 +232,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -252,7 +257,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async @@ -276,9 +281,6 @@ async def begin_create_or_update( :type compute_name: str :param parameters: Payload with Machine Learning compute definition. :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -295,7 +297,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -333,10 +335,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _update_initial( self, @@ -370,7 +371,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -384,7 +389,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async @@ -407,9 +412,6 @@ async def begin_update( :type compute_name: str :param parameters: Additional parameters for cluster update. :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -426,7 +428,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -464,12 +466,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -498,7 +499,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -514,11 +519,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -538,9 +543,6 @@ async def begin_delete( underlying compute from workspace if 'Detach'. :type underlying_resource_action: str or ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -554,7 +556,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -588,13 +590,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async - async def update_custom_services( + async def update_custom_services( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -612,9 +613,6 @@ async def update_custom_services( :type compute_name: str :param custom_services: New list of Custom Services. :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -644,7 +642,11 @@ async def update_custom_services( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -655,7 +657,7 @@ async def update_custom_services( if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices'} # type: ignore + update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace @@ -674,9 +676,6 @@ def list_nodes( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AmlComputeNodesInformation or the result of cls(response) @@ -730,7 +729,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -744,7 +747,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore + list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace_async async def list_keys( @@ -762,9 +765,6 @@ async def list_keys( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComputeSecrets, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets @@ -790,7 +790,11 @@ async def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -805,10 +809,10 @@ async def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - async def _start_initial( + async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -835,7 +839,11 @@ async def _start_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: @@ -845,11 +853,11 @@ async def _start_initial( if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace_async - async def begin_start( + async def begin_start( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -864,9 +872,6 @@ async def begin_start( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -880,7 +885,7 @@ async def begin_start( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -913,12 +918,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - async def _stop_initial( + async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -945,7 +949,11 @@ async def _stop_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: @@ -955,11 +963,11 @@ async def _stop_initial( if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace_async - async def begin_stop( + async def begin_stop( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -974,9 +982,6 @@ async def begin_stop( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -990,7 +995,7 @@ async def begin_stop( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1023,12 +1028,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - async def _restart_initial( + async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -1055,7 +1059,11 @@ async def _restart_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: @@ -1065,11 +1073,11 @@ async def _restart_initial( if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async - async def begin_restart( + async def begin_restart( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -1084,9 +1092,6 @@ async def begin_restart( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -1100,7 +1105,7 @@ async def begin_restart( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1133,13 +1138,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async - async def update_idle_shutdown_setting( + async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -1157,9 +1161,6 @@ async def update_idle_shutdown_setting( :type compute_name: str :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -1189,7 +1190,11 @@ async def update_idle_shutdown_setting( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1200,5 +1205,5 @@ async def update_idle_shutdown_setting( if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting'} # type: ignore + update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py index 9e0f2b048eaa..431836783f5f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -67,9 +66,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the result of cls(response) @@ -125,7 +121,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -139,10 +139,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -159,9 +159,6 @@ async def delete( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -187,7 +184,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -198,7 +199,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async @@ -219,9 +220,6 @@ async def get( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer @@ -247,7 +245,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -262,7 +264,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async @@ -286,9 +288,6 @@ async def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer @@ -318,7 +317,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -337,5 +340,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py index e2fda1d2ec4d..36293053cf04 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -83,9 +82,6 @@ def list( :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the result of cls(response) @@ -149,7 +145,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -163,10 +163,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -186,9 +186,6 @@ async def delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -215,7 +212,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -226,7 +227,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -250,9 +251,6 @@ async def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataVersionBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase @@ -279,7 +277,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -294,7 +296,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -321,9 +323,6 @@ async def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataVersionBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase @@ -354,7 +353,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -373,5 +376,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py index 47c84aaf073c..4599f14170cc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -82,9 +81,6 @@ def list( :type order_by: str :param order_by_asc: Order by property in ascending order. :type order_by_asc: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatastoreResourceArmPaginatedResult or the result of cls(response) @@ -150,7 +146,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -164,10 +164,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -184,9 +184,6 @@ async def delete( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -212,7 +209,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -223,7 +224,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async @@ -244,9 +245,6 @@ async def get( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Datastore, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Datastore @@ -272,7 +270,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -287,7 +289,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async @@ -314,9 +316,6 @@ async def create_or_update( :type body: ~azure.mgmt.machinelearningservices.models.Datastore :param skip_validation: Flag to skip validation. :type skip_validation: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Datastore, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Datastore @@ -347,7 +346,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -366,7 +369,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async @@ -387,9 +390,6 @@ async def list_secrets( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatastoreSecrets, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets @@ -415,7 +415,11 @@ async def list_secrets( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -430,5 +434,5 @@ async def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py index 4152f4ae8cd8..774d9f5bdf4d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -67,9 +66,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or the result of cls(response) @@ -125,7 +121,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -139,10 +139,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -159,9 +159,6 @@ async def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -187,7 +184,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -198,7 +199,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async @@ -219,9 +220,6 @@ async def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -247,7 +245,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -262,7 +264,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async @@ -286,9 +288,6 @@ async def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -318,7 +317,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -337,5 +340,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py index 96296e4f2673..d5d425464fa6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -76,9 +75,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or the result of cls(response) @@ -140,7 +136,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -154,10 +154,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -177,9 +177,6 @@ async def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -206,7 +203,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -217,7 +218,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -241,9 +242,6 @@ async def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -270,7 +268,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -285,7 +287,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -312,9 +314,6 @@ async def create_or_update( :type version: str :param body: Definition of EnvironmentVersion. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -345,7 +344,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -364,5 +367,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py index cc1d3c251fd8..70edbcfcf4b2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -81,9 +80,6 @@ def list( :type scheduled: bool :param schedule_id: The scheduled id for listing the job triggered from. :type schedule_id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobBaseResourceArmPaginatedResult or the result of cls(response) @@ -147,7 +143,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -161,9 +161,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -190,7 +190,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -207,11 +211,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -228,9 +232,6 @@ async def begin_delete( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -244,7 +245,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -277,10 +278,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -300,9 +300,6 @@ async def get( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.JobBase @@ -328,7 +325,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -343,7 +344,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async @@ -367,9 +368,6 @@ async def create_or_update( :type id: str :param body: Job definition object. :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.JobBase @@ -399,7 +397,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -418,10 +420,10 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - async def _cancel_initial( + async def _cancel_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -448,7 +450,11 @@ async def _cancel_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -464,11 +470,11 @@ async def _cancel_initial( if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore + _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace_async - async def begin_cancel( + async def begin_cancel( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -485,9 +491,6 @@ async def begin_cancel( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -501,7 +504,7 @@ async def begin_cancel( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -534,7 +537,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore + begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py index 3bd638d88d4c..c29db25275c4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -69,9 +68,6 @@ def list( :type skip: str :param count: Number of labeling jobs to return. :type count: int - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the result of cls(response) @@ -127,7 +123,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -141,10 +141,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -161,9 +161,6 @@ async def delete( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -189,7 +186,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -200,7 +201,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async @@ -229,9 +230,6 @@ async def get( :param include_label_categories: Boolean value to indicate Whether to include LabelCategories in response. :type include_label_categories: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LabelingJob, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob @@ -259,7 +257,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -274,7 +276,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _create_or_update_initial( @@ -309,7 +311,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -331,7 +337,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async @@ -355,9 +361,6 @@ async def begin_create_or_update( :type id: str :param body: LabelingJob definition object. :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -374,7 +377,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] lro_delay = kwargs.pop( 'polling_interval', @@ -412,10 +415,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _export_labels_initial( self, @@ -449,7 +451,11 @@ async def _export_labels_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -471,7 +477,7 @@ async def _export_labels_initial( return deserialized - _export_labels_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels'} # type: ignore + _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async @@ -495,9 +501,6 @@ async def begin_export_labels( :type id: str :param body: The export summary. :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -514,7 +517,7 @@ async def begin_export_labels( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] lro_delay = kwargs.pop( 'polling_interval', @@ -552,13 +555,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_export_labels.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels'} # type: ignore + begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async - async def pause( + async def pause( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -575,9 +577,6 @@ async def pause( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -603,7 +602,11 @@ async def pause( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -614,10 +617,10 @@ async def pause( if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause'} # type: ignore + pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - async def _resume_initial( + async def _resume_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -644,7 +647,11 @@ async def _resume_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -660,11 +667,11 @@ async def _resume_initial( if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume'} # type: ignore + _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace_async - async def begin_resume( + async def begin_resume( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -681,9 +688,6 @@ async def begin_resume( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -697,7 +701,7 @@ async def begin_resume( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -730,7 +734,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume'} # type: ignore + begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py index fe05d8971044..5013a222b365 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -70,9 +69,6 @@ def list( :type count: int :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the result of cls(response) @@ -130,7 +126,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -144,10 +144,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -164,9 +164,6 @@ async def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -192,7 +189,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -203,7 +204,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async @@ -224,9 +225,6 @@ async def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -252,7 +250,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -267,7 +269,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async @@ -291,9 +293,6 @@ async def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -323,7 +322,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -342,5 +345,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py index b5723cb2362a..1f9f681bbfac 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -96,9 +95,6 @@ def list( :type feed: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the result of cls(response) @@ -172,7 +168,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -186,10 +186,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -209,9 +209,6 @@ async def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -238,7 +235,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -249,7 +250,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -273,9 +274,6 @@ async def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -302,7 +300,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -317,7 +319,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -344,9 +346,6 @@ async def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -377,7 +376,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -396,5 +399,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py index 1005057a5186..a880752577b2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -75,9 +74,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OnlineDeploymentTrackedResourceArmPaginatedResult or the result of cls(response) @@ -137,7 +133,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -151,9 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -182,7 +182,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -199,11 +203,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -223,9 +227,6 @@ async def begin_delete( :type endpoint_name: str :param deployment_name: Inference Endpoint Deployment name. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -239,7 +240,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -273,10 +274,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -299,9 +299,6 @@ async def get( :type endpoint_name: str :param deployment_name: Inference Endpoint Deployment name. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OnlineDeployment, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment @@ -328,7 +325,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -343,7 +344,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( @@ -380,7 +381,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -403,7 +408,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async @@ -430,9 +435,6 @@ async def begin_update( :type deployment_name: str :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -449,7 +451,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -488,10 +490,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -527,7 +528,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -549,7 +554,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async @@ -576,9 +581,6 @@ async def begin_create_or_update( :type deployment_name: str :param body: Inference Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -595,7 +597,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -634,10 +636,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get_logs( @@ -663,9 +664,6 @@ async def get_logs( :type deployment_name: str :param body: The request containing parameters for retrieving logs. :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentLogs, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs @@ -696,7 +694,11 @@ async def get_logs( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -711,7 +713,7 @@ async def get_logs( return deserialized - get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs'} # type: ignore + get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace @@ -741,9 +743,6 @@ def list_skus( :type count: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of cls(response) @@ -803,7 +802,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -817,4 +820,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus'} # type: ignore + list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py index bcb2a63e451a..e8333e8beee5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -87,9 +86,6 @@ def list( :type properties: str :param order_by: The option to order the response. :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OnlineEndpointTrackedResourceArmPaginatedResult or the result of cls(response) @@ -155,7 +151,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -169,9 +169,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -198,7 +198,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -215,11 +219,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -236,9 +240,6 @@ async def begin_delete( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -252,7 +253,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -285,10 +286,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -308,9 +308,6 @@ async def get( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OnlineEndpoint, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint @@ -336,7 +333,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -351,7 +352,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _update_initial( @@ -386,7 +387,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -409,7 +414,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async @@ -434,9 +439,6 @@ async def begin_update( :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -453,7 +455,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -491,10 +493,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -528,7 +529,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -550,7 +555,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async @@ -574,9 +579,6 @@ async def begin_create_or_update( :type endpoint_name: str :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -593,7 +595,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -631,10 +633,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -654,9 +655,6 @@ async def list_keys( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthKeys, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys @@ -682,7 +680,11 @@ async def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -697,10 +699,10 @@ async def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - async def _regenerate_keys_initial( + async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -732,7 +734,11 @@ async def _regenerate_keys_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -748,11 +754,11 @@ async def _regenerate_keys_initial( if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async - async def begin_regenerate_keys( + async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -772,9 +778,6 @@ async def begin_regenerate_keys( :type endpoint_name: str :param body: RegenerateKeys request . :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -789,7 +792,7 @@ async def begin_regenerate_keys( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -824,10 +827,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( @@ -847,9 +849,6 @@ async def get_token( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthToken, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken @@ -875,7 +874,11 @@ async def get_token( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -890,5 +893,5 @@ async def get_token( return deserialized - get_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token'} # type: ignore + get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py index 45a87c2f66a3..4b016ee8371c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -53,9 +51,6 @@ def list( ) -> AsyncIterable["_models.AmlOperationListResult"]: """Lists all of the available Azure Machine Learning Services REST API operations. - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AmlOperationListResult or the result of cls(response) @@ -101,7 +96,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -115,4 +114,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py index 69c40291d5db..023c936ebc7c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -59,9 +58,6 @@ def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) @@ -113,7 +109,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -127,7 +127,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -146,9 +146,6 @@ async def get( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the workspace. :type private_endpoint_connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateEndpointConnection, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection @@ -174,7 +171,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -189,7 +190,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async @@ -212,9 +213,6 @@ async def create_or_update( :type private_endpoint_connection_name: str :param properties: The private endpoint connection properties. :type properties: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateEndpointConnection, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection @@ -244,7 +242,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -259,11 +261,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -279,9 +281,6 @@ async def delete( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the workspace. :type private_endpoint_connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -307,7 +306,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -318,5 +321,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py index c762f8b03bcb..990798e11422 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -57,9 +56,6 @@ async def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResourceListResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult @@ -84,7 +80,11 @@ async def list( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -99,5 +99,5 @@ async def list( return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py index f2cddd903de4..bf793b7dea97 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -59,9 +58,6 @@ async def update( :type location: str :param parameters: Quota update parameters. :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UpdateWorkspaceQuotasResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult @@ -89,7 +85,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -104,7 +104,7 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace @@ -117,9 +117,6 @@ def list( :param location: The location for which resource usage is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) :rtype: @@ -168,7 +165,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -182,4 +183,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py index d1aebf6ba6e3..34eb1896daee 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -60,9 +59,6 @@ def list_by_subscription( :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the result of cls(response) @@ -112,7 +108,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -126,7 +126,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( @@ -143,9 +143,6 @@ def list( :type resource_group_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the result of cls(response) @@ -197,7 +194,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -211,10 +212,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -228,9 +229,6 @@ async def delete( :type resource_group_name: str :param registry_name: Name of registry. This is case-insensitive. :type registry_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -255,7 +253,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -266,7 +268,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async @@ -284,9 +286,6 @@ async def get( :type resource_group_name: str :param registry_name: Name of registry. This is case-insensitive. :type registry_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Registry, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Registry @@ -311,7 +310,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -326,7 +329,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async @@ -347,9 +350,6 @@ async def update( :type registry_name: str :param body: Details required to create the registry. :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Registry, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Registry @@ -378,7 +378,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -393,7 +397,7 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _create_or_update_initial( @@ -426,10 +430,14 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) @@ -439,12 +447,15 @@ async def _create_or_update_initial( if response.status_code == 201: deserialized = self._deserialize('Registry', pipeline_response) + if response.status_code == 202: + deserialized = self._deserialize('Registry', pipeline_response) + if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async @@ -465,9 +476,6 @@ async def begin_create_or_update( :type registry_name: str :param body: Details required to create the registry. :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -483,7 +491,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( 'polling_interval', @@ -520,7 +528,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py index b1ee4bf31674..e0e6f07ef7c3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -66,9 +65,6 @@ def list( :type registry_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the result of cls(response) @@ -122,7 +118,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -136,9 +136,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -165,7 +165,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -182,11 +186,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -203,9 +207,6 @@ async def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -219,7 +220,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -252,10 +253,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace_async async def get( @@ -275,9 +275,6 @@ async def get( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -303,7 +300,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -318,7 +319,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore async def _create_or_update_initial( @@ -353,7 +354,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -375,7 +380,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace_async @@ -399,9 +404,6 @@ async def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -418,7 +420,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -456,7 +458,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py index cc8a06bfb9b6..2fe62405587d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -75,9 +74,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the result of cls(response) @@ -137,7 +133,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -151,9 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -182,7 +182,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -199,11 +203,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -223,9 +227,6 @@ async def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -239,7 +240,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -273,10 +274,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -299,9 +299,6 @@ async def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -328,7 +325,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -343,7 +344,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( @@ -380,7 +381,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -402,7 +407,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -429,9 +434,6 @@ async def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -448,7 +450,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -487,7 +489,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py index 7f80a508a4a5..0dfb849b76a6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -66,9 +65,6 @@ def list( :type registry_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or the result of cls(response) @@ -122,7 +118,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -136,9 +136,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -165,7 +165,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -182,11 +186,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -203,9 +207,6 @@ async def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -219,7 +220,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -252,10 +253,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace_async async def get( @@ -275,9 +275,6 @@ async def get( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -303,7 +300,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -318,7 +319,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore async def _create_or_update_initial( @@ -353,7 +354,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -375,7 +380,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace_async @@ -399,9 +404,6 @@ async def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -418,7 +420,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -456,7 +458,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py index cc26e48cec8d..5626f3374fac 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -75,9 +74,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the result of cls(response) @@ -137,7 +133,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -151,9 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -182,7 +182,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -199,11 +203,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -223,9 +227,6 @@ async def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -239,7 +240,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -273,10 +274,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -299,9 +299,6 @@ async def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -328,7 +325,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -343,7 +344,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( @@ -380,7 +381,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -402,7 +407,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -429,9 +434,6 @@ async def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -448,7 +450,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -487,7 +489,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py index 4fb0f2bde4f6..8b8ced6bfdfa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -69,9 +68,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or the result of cls(response) @@ -127,7 +123,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -141,9 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -170,7 +170,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -187,11 +191,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -208,9 +212,6 @@ async def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -224,7 +225,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -257,10 +258,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace_async async def get( @@ -280,9 +280,6 @@ async def get( :type registry_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -308,7 +305,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -323,7 +324,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore async def _create_or_update_initial( @@ -358,7 +359,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -380,7 +385,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace_async @@ -404,9 +409,6 @@ async def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -423,7 +425,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -461,7 +463,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py index 2f20cba00840..239914f864d2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -78,9 +77,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or the result of cls(response) @@ -142,7 +138,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -156,9 +156,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -187,7 +187,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -204,11 +208,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -228,9 +232,6 @@ async def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -244,7 +245,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -278,10 +279,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -304,9 +304,6 @@ async def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -333,7 +330,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -348,7 +349,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( @@ -385,7 +386,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -407,7 +412,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -434,9 +439,6 @@ async def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -453,7 +455,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -492,7 +494,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py index e2e608d81dde..919decb21ad7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -69,9 +68,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the result of cls(response) @@ -127,7 +123,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -141,9 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -170,7 +170,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -187,11 +191,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -208,9 +212,6 @@ async def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -224,7 +225,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -257,10 +258,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace_async async def get( @@ -280,9 +280,6 @@ async def get( :type registry_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -308,7 +305,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -323,7 +324,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore async def _create_or_update_initial( @@ -358,7 +359,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -380,7 +385,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace_async @@ -404,9 +409,6 @@ async def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -423,7 +425,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -461,7 +463,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py index 3ad7c5843920..d60638f39eaa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -92,9 +91,6 @@ def list( :type properties: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the result of cls(response) @@ -164,7 +160,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -178,9 +178,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -209,7 +209,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -226,11 +230,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -250,9 +254,6 @@ async def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -266,7 +267,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -300,10 +301,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -326,9 +326,6 @@ async def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -355,7 +352,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -370,7 +371,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( @@ -407,7 +408,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -429,7 +434,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -456,9 +461,6 @@ async def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -475,7 +477,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -514,7 +516,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py index babfae8ff950..d73251e23420 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -69,9 +68,6 @@ def list( :type skip: str :param list_view_type: Status filter for schedule. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ScheduleResourceArmPaginatedResult or the result of cls(response) @@ -127,7 +123,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -141,9 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -170,7 +170,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -187,11 +191,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -208,9 +212,6 @@ async def begin_delete( :type workspace_name: str :param name: Schedule name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -224,7 +225,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -257,10 +258,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def get( @@ -280,9 +280,6 @@ async def get( :type workspace_name: str :param name: Schedule name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Schedule, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Schedule @@ -308,7 +305,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -323,7 +324,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore async def _create_or_update_initial( @@ -358,7 +359,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -380,7 +385,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async @@ -404,9 +409,6 @@ async def begin_create_or_update( :type name: str :param body: Schedule definition. :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -422,7 +424,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( 'polling_interval', @@ -460,7 +462,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py index c3b40a11e2f5..86be8ad1ca4e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -57,9 +55,6 @@ def list( :param location: The location for which resource usage is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListUsagesResult or the result of cls(response) :rtype: @@ -108,7 +103,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -122,4 +121,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py index c98040033d5a..4bbc9f98e159 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -54,9 +53,6 @@ async def list( :param location: The location upon which virtual-machine-sizes is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: VirtualMachineSizeListResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult @@ -80,7 +76,11 @@ async def list( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -95,5 +95,5 @@ async def list( return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py index c454a3dba9e5..e29a99c87f44 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -66,9 +65,6 @@ async def create( :param parameters: The object for creating or updating a new workspace connection. :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource @@ -98,7 +94,11 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -113,7 +113,7 @@ async def create( return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async @@ -132,9 +132,6 @@ async def get( :type workspace_name: str :param connection_name: Friendly name of the workspace connection. :type connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource @@ -160,7 +157,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -175,11 +176,11 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -194,9 +195,6 @@ async def delete( :type workspace_name: str :param connection_name: Friendly name of the workspace connection. :type connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -222,7 +220,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -233,7 +235,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace @@ -255,9 +257,6 @@ def list( :type target: str :param category: Category of the workspace connection. :type category: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult or the result of cls(response) @@ -313,7 +312,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -327,4 +330,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py index f4a4e5acdaad..005b34f1cc62 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -59,9 +57,6 @@ def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListAmlUserFeatureResult or the result of cls(response) @@ -113,7 +108,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -127,4 +126,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py index 979ed3df221e..c56bd5ff84f5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -61,9 +60,6 @@ async def get( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Workspace, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Workspace @@ -88,7 +84,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -103,7 +103,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( @@ -136,7 +136,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -152,7 +156,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async @@ -171,9 +175,6 @@ async def begin_create_or_update( :type workspace_name: str :param parameters: The parameters for creating or updating a machine learning workspace. :type parameters: ~azure.mgmt.machinelearningservices.models.Workspace - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -190,7 +191,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( 'polling_interval', @@ -227,12 +228,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -257,7 +257,11 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -267,11 +271,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -283,9 +287,6 @@ async def begin_delete( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -299,7 +300,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -331,10 +332,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _update_initial( self, @@ -366,7 +366,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -382,7 +386,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async @@ -401,9 +405,6 @@ async def begin_update( :type workspace_name: str :param parameters: The parameters for updating a machine learning workspace. :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -420,7 +421,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( 'polling_interval', @@ -457,10 +458,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -475,9 +475,6 @@ def list_by_resource_group( :type resource_group_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) :rtype: @@ -528,7 +525,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -542,7 +543,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore async def _diagnose_initial( self, @@ -577,7 +578,11 @@ async def _diagnose_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -599,7 +604,7 @@ async def _diagnose_initial( return deserialized - _diagnose_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async @@ -620,9 +625,6 @@ async def begin_diagnose( :type workspace_name: str :param parameters: The parameter of diagnosing workspace health. :type parameters: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -639,7 +641,7 @@ async def begin_diagnose( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -676,10 +678,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_diagnose.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def list_keys( @@ -695,9 +696,6 @@ async def list_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListWorkspaceKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult @@ -722,7 +720,11 @@ async def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -737,10 +739,10 @@ async def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - async def _resync_keys_initial( + async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -765,7 +767,11 @@ async def _resync_keys_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -775,11 +781,11 @@ async def _resync_keys_initial( if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace_async - async def begin_resync_keys( + async def begin_resync_keys( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -792,9 +798,6 @@ async def begin_resync_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -808,7 +811,7 @@ async def begin_resync_keys( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -840,10 +843,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -855,9 +857,6 @@ def list_by_subscription( :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) :rtype: @@ -906,7 +905,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -920,7 +923,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace_async async def list_notebook_access_token( @@ -935,9 +938,6 @@ async def list_notebook_access_token( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NotebookAccessTokenResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult @@ -962,7 +962,11 @@ async def list_notebook_access_token( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -977,7 +981,7 @@ async def list_notebook_access_token( return deserialized - list_notebook_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken'} # type: ignore + list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore async def _prepare_notebook_initial( @@ -1005,7 +1009,11 @@ async def _prepare_notebook_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1021,7 +1029,7 @@ async def _prepare_notebook_initial( return deserialized - _prepare_notebook_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async @@ -1037,9 +1045,6 @@ async def begin_prepare_notebook( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -1055,7 +1060,7 @@ async def begin_prepare_notebook( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -1090,10 +1095,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_prepare_notebook.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def list_storage_account_keys( @@ -1108,9 +1112,6 @@ async def list_storage_account_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListStorageAccountKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult @@ -1135,7 +1136,11 @@ async def list_storage_account_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1150,7 +1155,7 @@ async def list_storage_account_keys( return deserialized - list_storage_account_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys'} # type: ignore + list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace_async @@ -1166,9 +1171,6 @@ async def list_notebook_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListNotebookKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult @@ -1193,7 +1195,11 @@ async def list_notebook_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1208,7 +1214,7 @@ async def list_notebook_keys( return deserialized - list_notebook_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys'} # type: ignore + list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace_async @@ -1228,9 +1234,6 @@ async def list_outbound_network_dependencies_endpoints( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ExternalFQDNResponse, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse @@ -1255,7 +1258,11 @@ async def list_outbound_network_dependencies_endpoints( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1270,5 +1277,5 @@ async def list_outbound_network_dependencies_endpoints( return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints'} # type: ignore + list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py index 804aefaf4691..cb054ec13ba9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py @@ -381,7 +381,6 @@ def __init__( super(AKS, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -517,7 +516,6 @@ def __init__( self.admin_kube_config = kwargs.get('admin_kube_config', None) self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -822,7 +820,6 @@ def __init__( super(AmlCompute, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'AmlCompute' # type: str - self.compute_type = 'AmlCompute' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -2492,13 +2489,7 @@ def __init__( self.properties = kwargs.get('properties', None) self.tags = kwargs.get('tags', None) self.credentials = kwargs['credentials'] - self.datastore_type = 'AzureBlob' # type: str self.is_default = None - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): @@ -2591,10 +2582,7 @@ def __init__( self.properties = kwargs.get('properties', None) self.tags = kwargs.get('tags', None) self.credentials = kwargs['credentials'] - self.datastore_type = 'AzureDataLakeGen1' # type: str self.is_default = None - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): @@ -2706,13 +2694,7 @@ def __init__( self.properties = kwargs.get('properties', None) self.tags = kwargs.get('tags', None) self.credentials = kwargs['credentials'] - self.datastore_type = 'AzureDataLakeGen2' # type: str self.is_default = None - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) class AzureFileDatastore(DatastoreProperties, AzureDatastore): @@ -2826,13 +2808,7 @@ def __init__( self.properties = kwargs.get('properties', None) self.tags = kwargs.get('tags', None) self.credentials = kwargs['credentials'] - self.datastore_type = 'AzureFile' # type: str self.is_default = None - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -4195,11 +4171,7 @@ def __init__( self.training_settings = kwargs.get('training_settings', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'Classification' # type: str self.training_data = kwargs['training_data'] - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) class TrainingSettings(msrest.serialization.Model): @@ -5470,7 +5442,6 @@ def __init__( super(ComputeInstance, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'ComputeInstance' # type: str - self.compute_type = 'ComputeInstance' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -6179,10 +6150,6 @@ def __init__( self.name = None self.type = None self.system_data = None - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) class ComputeSchedules(msrest.serialization.Model): @@ -6663,7 +6630,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'custom_model' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'custom_model' # type: str class JobOutput(msrest.serialization.Model): @@ -6755,7 +6721,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'custom_model' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'custom_model' # type: str class CustomNCrossValidations(NCrossValidations): @@ -7064,7 +7029,6 @@ def __init__( super(Databricks, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -7132,7 +7096,6 @@ def __init__( super(DatabricksComputeSecrets, self).__init__(**kwargs) self.databricks_access_token = kwargs.get('databricks_access_token', None) self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str class DatabricksProperties(msrest.serialization.Model): @@ -7489,7 +7452,6 @@ def __init__( super(DataLakeAnalytics, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_type = 'DataLakeAnalytics' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -9517,11 +9479,7 @@ def __init__( self.training_settings = kwargs.get('training_settings', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'Forecasting' # type: str self.training_data = kwargs['training_data'] - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) class ForecastingSettings(msrest.serialization.Model): @@ -10057,7 +10015,6 @@ def __init__( super(HDInsight, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'HDInsight' # type: str - self.compute_type = 'HDInsight' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -10463,9 +10420,7 @@ def __init__( self.primary_metric = kwargs.get('primary_metric', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'ImageClassification' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): @@ -10580,9 +10535,7 @@ def __init__( self.primary_metric = kwargs.get('primary_metric', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'ImageClassificationMultilabel' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) class ImageObjectDetectionBase(ImageVertical): @@ -10762,9 +10715,7 @@ def __init__( self.primary_metric = kwargs.get('primary_metric', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'ImageInstanceSegmentation' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) class ImageLimitSettings(msrest.serialization.Model): @@ -12639,9 +12590,7 @@ def __init__( self.primary_metric = kwargs.get('primary_metric', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'ImageObjectDetection' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) class ImageSweepSettings(msrest.serialization.Model): @@ -13116,8 +13065,6 @@ def __init__( self.kerberos_realm = kwargs['kerberos_realm'] self.credentials_type = 'KerberosKeytab' # type: str self.secrets = kwargs['secrets'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] class KerberosKeytabSecrets(DatastoreSecrets): @@ -13212,8 +13159,6 @@ def __init__( self.kerberos_realm = kwargs['kerberos_realm'] self.credentials_type = 'KerberosPassword' # type: str self.secrets = kwargs['secrets'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] class KerberosPasswordSecrets(DatastoreSecrets): @@ -13354,7 +13299,6 @@ def __init__( super(Kubernetes, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'Kubernetes' # type: str - self.compute_type = 'Kubernetes' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -14973,7 +14917,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'mlflow_model' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'mlflow_model' # type: str class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -15023,7 +14966,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'mlflow_model' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'mlflow_model' # type: str class MLTableData(DataVersionBaseProperties): @@ -15141,7 +15083,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'mltable' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'mltable' # type: str class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -15191,7 +15132,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'mltable' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'mltable' # type: str class ModelContainer(Resource): @@ -18227,10 +18167,7 @@ def __init__( self.training_settings = kwargs.get('training_settings', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'Regression' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) class RegressionTrainingSettings(TrainingSettings): @@ -21016,9 +20953,7 @@ def __init__( self.primary_metric = kwargs.get('primary_metric', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'TextClassification' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) class TextClassificationMultilabel(AutoMLVertical, NlpVertical): @@ -21125,9 +21060,7 @@ def __init__( self.primary_metric = None self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'TextClassificationMultilabel' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = None class TextNer(AutoMLVertical, NlpVertical): @@ -21235,9 +21168,7 @@ def __init__( self.primary_metric = None self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'TextNER' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = None class TmpfsOptions(msrest.serialization.Model): @@ -21377,7 +21308,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'triton_model' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'triton_model' # type: str class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -21427,7 +21357,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'triton_model' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'triton_model' # type: str class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -21672,7 +21601,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'uri_file' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'uri_file' # type: str class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -21722,7 +21650,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'uri_file' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'uri_file' # type: str class UriFolderDataVersion(DataVersionBaseProperties): @@ -21834,7 +21761,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'uri_folder' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'uri_folder' # type: str class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -21884,7 +21810,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'uri_folder' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'uri_folder' # type: str class Usage(msrest.serialization.Model): @@ -22290,7 +22215,6 @@ def __init__( super(VirtualMachine, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -22448,7 +22372,6 @@ def __init__( super(VirtualMachineSecrets, self).__init__(**kwargs) self.administrator_account = kwargs.get('administrator_account', None) self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str class VirtualMachineSize(msrest.serialization.Model): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py index a75b2649ed39..10bb1d46fc96 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py @@ -404,7 +404,6 @@ def __init__( super(AKS, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -548,7 +547,6 @@ def __init__( self.admin_kube_config = admin_kube_config self.image_pull_secret_name = image_pull_secret_name self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -874,7 +872,6 @@ def __init__( super(AmlCompute, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'AmlCompute' # type: str - self.compute_type = 'AmlCompute' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -2657,13 +2654,7 @@ def __init__( self.properties = properties self.tags = tags self.credentials = credentials - self.datastore_type = 'AzureBlob' # type: str self.is_default = None - self.account_name = account_name - self.container_name = container_name - self.endpoint = endpoint - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): @@ -2765,10 +2756,7 @@ def __init__( self.properties = properties self.tags = tags self.credentials = credentials - self.datastore_type = 'AzureDataLakeGen1' # type: str self.is_default = None - self.service_data_access_auth_identity = service_data_access_auth_identity - self.store_name = store_name class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): @@ -2892,13 +2880,7 @@ def __init__( self.properties = properties self.tags = tags self.credentials = credentials - self.datastore_type = 'AzureDataLakeGen2' # type: str self.is_default = None - self.account_name = account_name - self.endpoint = endpoint - self.filesystem = filesystem - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity class AzureFileDatastore(DatastoreProperties, AzureDatastore): @@ -3024,13 +3006,7 @@ def __init__( self.properties = properties self.tags = tags self.credentials = credentials - self.datastore_type = 'AzureFile' # type: str self.is_default = None - self.account_name = account_name - self.endpoint = endpoint - self.file_share_name = file_share_name - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity class EarlyTerminationPolicy(msrest.serialization.Model): @@ -4510,11 +4486,7 @@ def __init__( self.training_settings = training_settings self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'Classification' # type: str self.training_data = training_data - self.positive_label = positive_label - self.primary_metric = primary_metric - self.training_settings = training_settings class TrainingSettings(msrest.serialization.Model): @@ -5887,7 +5859,6 @@ def __init__( super(ComputeInstance, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'ComputeInstance' # type: str - self.compute_type = 'ComputeInstance' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -6652,10 +6623,6 @@ def __init__( self.name = None self.type = None self.system_data = None - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku class ComputeSchedules(msrest.serialization.Model): @@ -7167,7 +7134,6 @@ def __init__( self.uri = uri self.job_input_type = 'custom_model' # type: str self.description = description - self.job_input_type = 'custom_model' # type: str class JobOutput(msrest.serialization.Model): @@ -7265,7 +7231,6 @@ def __init__( self.uri = uri self.job_output_type = 'custom_model' # type: str self.description = description - self.job_output_type = 'custom_model' # type: str class CustomNCrossValidations(NCrossValidations): @@ -7597,7 +7562,6 @@ def __init__( super(Databricks, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -7669,7 +7633,6 @@ def __init__( super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) self.databricks_access_token = databricks_access_token self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str class DatabricksProperties(msrest.serialization.Model): @@ -8051,7 +8014,6 @@ def __init__( super(DataLakeAnalytics, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_type = 'DataLakeAnalytics' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -10234,11 +10196,7 @@ def __init__( self.training_settings = training_settings self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'Forecasting' # type: str self.training_data = training_data - self.forecasting_settings = forecasting_settings - self.primary_metric = primary_metric - self.training_settings = training_settings class ForecastingSettings(msrest.serialization.Model): @@ -10823,7 +10781,6 @@ def __init__( super(HDInsight, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'HDInsight' # type: str - self.compute_type = 'HDInsight' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -11266,9 +11223,7 @@ def __init__( self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'ImageClassification' # type: str self.training_data = training_data - self.primary_metric = primary_metric class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): @@ -11394,9 +11349,7 @@ def __init__( self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'ImageClassificationMultilabel' # type: str self.training_data = training_data - self.primary_metric = primary_metric class ImageObjectDetectionBase(ImageVertical): @@ -11594,9 +11547,7 @@ def __init__( self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'ImageInstanceSegmentation' # type: str self.training_data = training_data - self.primary_metric = primary_metric class ImageLimitSettings(msrest.serialization.Model): @@ -13706,9 +13657,7 @@ def __init__( self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'ImageObjectDetection' # type: str self.training_data = training_data - self.primary_metric = primary_metric class ImageSweepSettings(msrest.serialization.Model): @@ -14224,8 +14173,6 @@ def __init__( self.kerberos_realm = kerberos_realm self.credentials_type = 'KerberosKeytab' # type: str self.secrets = secrets - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = secrets class KerberosKeytabSecrets(DatastoreSecrets): @@ -14327,8 +14274,6 @@ def __init__( self.kerberos_realm = kerberos_realm self.credentials_type = 'KerberosPassword' # type: str self.secrets = secrets - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = secrets class KerberosPasswordSecrets(DatastoreSecrets): @@ -14478,7 +14423,6 @@ def __init__( super(Kubernetes, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'Kubernetes' # type: str - self.compute_type = 'Kubernetes' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -16220,7 +16164,6 @@ def __init__( self.uri = uri self.job_input_type = 'mlflow_model' # type: str self.description = description - self.job_input_type = 'mlflow_model' # type: str class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -16274,7 +16217,6 @@ def __init__( self.uri = uri self.job_output_type = 'mlflow_model' # type: str self.description = description - self.job_output_type = 'mlflow_model' # type: str class MLTableData(DataVersionBaseProperties): @@ -16404,7 +16346,6 @@ def __init__( self.uri = uri self.job_input_type = 'mltable' # type: str self.description = description - self.job_input_type = 'mltable' # type: str class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -16458,7 +16399,6 @@ def __init__( self.uri = uri self.job_output_type = 'mltable' # type: str self.description = description - self.job_output_type = 'mltable' # type: str class ModelContainer(Resource): @@ -19766,10 +19706,7 @@ def __init__( self.training_settings = training_settings self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'Regression' # type: str self.training_data = training_data - self.primary_metric = primary_metric - self.training_settings = training_settings class RegressionTrainingSettings(TrainingSettings): @@ -22828,9 +22765,7 @@ def __init__( self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'TextClassification' # type: str self.training_data = training_data - self.primary_metric = primary_metric class TextClassificationMultilabel(AutoMLVertical, NlpVertical): @@ -22947,9 +22882,7 @@ def __init__( self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'TextClassificationMultilabel' # type: str self.training_data = training_data - self.primary_metric = None class TextNer(AutoMLVertical, NlpVertical): @@ -23067,9 +23000,7 @@ def __init__( self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'TextNER' # type: str self.training_data = training_data - self.primary_metric = None class TmpfsOptions(msrest.serialization.Model): @@ -23222,7 +23153,6 @@ def __init__( self.uri = uri self.job_input_type = 'triton_model' # type: str self.description = description - self.job_input_type = 'triton_model' # type: str class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -23276,7 +23206,6 @@ def __init__( self.uri = uri self.job_output_type = 'triton_model' # type: str self.description = description - self.job_output_type = 'triton_model' # type: str class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -23539,7 +23468,6 @@ def __init__( self.uri = uri self.job_input_type = 'uri_file' # type: str self.description = description - self.job_input_type = 'uri_file' # type: str class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -23593,7 +23521,6 @@ def __init__( self.uri = uri self.job_output_type = 'uri_file' # type: str self.description = description - self.job_output_type = 'uri_file' # type: str class UriFolderDataVersion(DataVersionBaseProperties): @@ -23716,7 +23643,6 @@ def __init__( self.uri = uri self.job_input_type = 'uri_folder' # type: str self.description = description - self.job_input_type = 'uri_folder' # type: str class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -23770,7 +23696,6 @@ def __init__( self.uri = uri self.job_output_type = 'uri_folder' # type: str self.description = description - self.job_output_type = 'uri_folder' # type: str class Usage(msrest.serialization.Model): @@ -24197,7 +24122,6 @@ def __init__( super(VirtualMachine, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -24368,7 +24292,6 @@ def __init__( super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) self.administrator_account = administrator_account self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str class VirtualMachineSize(msrest.serialization.Model): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py index 5851933c7860..cc437c31c4ca 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments") # 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), @@ -56,27 +56,27 @@ def build_list_request( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -94,7 +94,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # 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), @@ -103,21 +103,21 @@ def build_delete_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -135,7 +135,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # 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), @@ -144,21 +144,21 @@ def build_get_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -177,7 +177,7 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # 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), @@ -186,23 +186,23 @@ def build_update_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -221,7 +221,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # 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), @@ -230,23 +230,23 @@ def build_create_or_update_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -301,9 +301,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BatchDeploymentTrackedResourceArmPaginatedResult or the result of cls(response) @@ -363,7 +360,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -377,9 +378,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -409,7 +410,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -426,11 +431,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -451,9 +456,6 @@ def begin_delete( :type endpoint_name: str :param deployment_name: Inference deployment identifier. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -467,7 +469,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -501,10 +503,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -528,9 +529,6 @@ def get( :type endpoint_name: str :param deployment_name: The identifier for the Batch deployments. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BatchDeployment, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment @@ -557,7 +555,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -572,7 +574,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( @@ -610,7 +612,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -633,7 +639,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace @@ -662,9 +668,6 @@ def begin_update( :param body: Batch inference deployment definition object. :type body: ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -681,7 +684,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -720,10 +723,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -760,7 +762,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -782,7 +788,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace @@ -810,9 +816,6 @@ def begin_create_or_update( :type deployment_name: str :param body: Batch inference deployment definition object. :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -829,7 +832,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -868,7 +871,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py index b179f561a8a7..ecfd3ea617d3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,32 +46,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -88,7 +88,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # 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), @@ -96,21 +96,21 @@ def build_delete_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -127,7 +127,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # 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), @@ -135,21 +135,21 @@ def build_get_request( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -167,7 +167,7 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # 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), @@ -175,23 +175,23 @@ def build_update_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -209,7 +209,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # 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), @@ -217,23 +217,23 @@ def build_create_or_update_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -250,7 +250,7 @@ def build_list_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys") # 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), @@ -258,21 +258,21 @@ def build_list_keys_request( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -321,9 +321,6 @@ def list( :type count: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BatchEndpointTrackedResourceArmPaginatedResult or the result of cls(response) @@ -379,7 +376,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -393,9 +394,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -423,7 +424,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -440,11 +445,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -462,9 +467,6 @@ def begin_delete( :type workspace_name: str :param endpoint_name: Inference Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -478,7 +480,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -511,10 +513,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -535,9 +536,6 @@ def get( :type workspace_name: str :param endpoint_name: Name for the Batch Endpoint. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BatchEndpoint, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint @@ -563,7 +561,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -578,7 +580,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _update_initial( @@ -614,7 +616,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -637,7 +643,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace @@ -663,9 +669,6 @@ def begin_update( :param body: Mutable batch inference endpoint definition object. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -681,7 +684,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -719,10 +722,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -757,7 +759,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -779,7 +785,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace @@ -804,9 +810,6 @@ def begin_create_or_update( :type endpoint_name: str :param body: Batch inference endpoint definition object. :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -822,7 +825,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -860,10 +863,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -884,9 +886,6 @@ def list_keys( :type workspace_name: str :param endpoint_name: Inference Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthKeys, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys @@ -912,7 +911,11 @@ def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -927,5 +930,5 @@ def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py index 884850073b28..254317233f79 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,30 +43,30 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -83,7 +83,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # 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), @@ -91,21 +91,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -122,7 +122,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # 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), @@ -130,21 +130,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -162,7 +162,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # 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), @@ -170,23 +170,23 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -232,9 +232,6 @@ def list( :type workspace_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the result of cls(response) @@ -288,7 +285,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -302,10 +303,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -323,9 +324,6 @@ def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -351,7 +349,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -362,7 +364,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace @@ -384,9 +386,6 @@ def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -412,7 +411,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -427,7 +430,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace @@ -452,9 +455,6 @@ def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -484,7 +484,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -503,5 +507,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py index 5f23b0eacec5..17a29c3b389e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +46,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions") # 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), @@ -54,27 +54,27 @@ def build_list_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -92,7 +92,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # 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), @@ -101,21 +101,21 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -133,7 +133,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # 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), @@ -142,21 +142,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -175,7 +175,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # 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), @@ -184,23 +184,23 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -255,9 +255,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the result of cls(response) @@ -317,7 +314,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -331,10 +332,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -355,9 +356,6 @@ def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -384,7 +382,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -395,7 +397,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -420,9 +422,6 @@ def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -449,7 +448,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -464,7 +467,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -492,9 +495,6 @@ def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -525,7 +525,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -544,5 +548,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py index 53f9c4e0361d..2568cbe99064 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,32 +44,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -86,7 +86,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # 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), @@ -94,21 +94,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -125,7 +125,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # 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), @@ -133,21 +133,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -165,7 +165,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # 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), @@ -173,23 +173,23 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -238,9 +238,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or the result of cls(response) @@ -296,7 +293,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -310,10 +311,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -331,9 +332,6 @@ def delete( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -359,7 +357,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -370,7 +372,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace @@ -392,9 +394,6 @@ def get( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -420,7 +419,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -435,7 +438,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace @@ -460,9 +463,6 @@ def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -492,7 +492,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -511,5 +515,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py index c328cd6999d8..45ae72b476f5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +47,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions") # 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), @@ -55,29 +55,29 @@ def build_list_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -95,7 +95,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # 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), @@ -104,21 +104,21 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -136,7 +136,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # 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), @@ -145,21 +145,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -178,7 +178,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # 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), @@ -187,23 +187,23 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -261,9 +261,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the result of cls(response) @@ -325,7 +322,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -339,10 +340,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -363,9 +364,6 @@ def delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -392,7 +390,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -403,7 +405,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -428,9 +430,6 @@ def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -457,7 +456,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -472,7 +475,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -500,9 +503,6 @@ def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -533,7 +533,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -552,5 +556,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py index 7098dc584f98..fc67fc0cfc9d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,30 +45,30 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,7 +85,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # 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), @@ -93,21 +93,21 @@ def build_get_request( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -125,7 +125,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # 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), @@ -133,23 +133,23 @@ def build_create_or_update_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -167,7 +167,7 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # 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), @@ -175,23 +175,23 @@ def build_update_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -209,7 +209,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # 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), @@ -217,22 +217,22 @@ def build_delete_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - query_parameters['underlyingResourceAction'] = _SERIALIZER.query("underlying_resource_action", underlying_resource_action, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['underlyingResourceAction'] = _SERIALIZER.query("underlying_resource_action", underlying_resource_action, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -250,7 +250,7 @@ def build_update_custom_services_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices") # 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), @@ -258,23 +258,23 @@ def build_update_custom_services_request( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -291,7 +291,7 @@ def build_list_nodes_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes") # 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), @@ -299,21 +299,21 @@ def build_list_nodes_request( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -330,7 +330,7 @@ def build_list_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys") # 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), @@ -338,21 +338,21 @@ def build_list_keys_request( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -369,7 +369,7 @@ def build_start_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start") # 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), @@ -377,21 +377,21 @@ def build_start_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -408,7 +408,7 @@ def build_stop_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop") # 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), @@ -416,21 +416,21 @@ def build_stop_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -447,7 +447,7 @@ def build_restart_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart") # 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), @@ -455,21 +455,21 @@ def build_restart_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -487,7 +487,7 @@ def build_update_idle_shutdown_setting_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting") # 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), @@ -495,23 +495,23 @@ def build_update_idle_shutdown_setting_request( "computeName": _SERIALIZER.url("compute_name", compute_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -555,9 +555,6 @@ def list( :type workspace_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PaginatedComputeResourcesList or the result of cls(response) @@ -611,7 +608,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -625,7 +626,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace def get( @@ -645,9 +646,6 @@ def get( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComputeResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource @@ -673,7 +671,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -688,7 +690,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _create_or_update_initial( @@ -724,7 +726,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -745,7 +751,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace @@ -770,9 +776,6 @@ def begin_create_or_update( :type compute_name: str :param parameters: Payload with Machine Learning compute definition. :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -789,7 +792,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -827,10 +830,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _update_initial( self, @@ -865,7 +867,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -879,7 +885,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace @@ -903,9 +909,6 @@ def begin_update( :type compute_name: str :param parameters: Additional parameters for cluster update. :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -922,7 +925,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -960,12 +963,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -995,7 +997,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -1011,11 +1017,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1036,9 +1042,6 @@ def begin_delete( underlying compute from workspace if 'Detach'. :type underlying_resource_action: str or ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1052,7 +1055,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1086,13 +1089,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace - def update_custom_services( + def update_custom_services( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1111,9 +1113,6 @@ def update_custom_services( :type compute_name: str :param custom_services: New list of Custom Services. :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -1143,7 +1142,11 @@ def update_custom_services( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1154,7 +1157,7 @@ def update_custom_services( if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices'} # type: ignore + update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace @@ -1174,9 +1177,6 @@ def list_nodes( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AmlComputeNodesInformation or the result of cls(response) @@ -1230,7 +1230,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1244,7 +1248,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore + list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace def list_keys( @@ -1263,9 +1267,6 @@ def list_keys( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComputeSecrets, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets @@ -1291,7 +1292,11 @@ def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1306,10 +1311,10 @@ def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - def _start_initial( + def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1337,7 +1342,11 @@ def _start_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: @@ -1347,11 +1356,11 @@ def _start_initial( if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace - def begin_start( + def begin_start( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1367,9 +1376,6 @@ def begin_start( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1383,7 +1389,7 @@ def begin_start( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1416,12 +1422,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - def _stop_initial( + def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1449,7 +1454,11 @@ def _stop_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: @@ -1459,11 +1468,11 @@ def _stop_initial( if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace - def begin_stop( + def begin_stop( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1479,9 +1488,6 @@ def begin_stop( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1495,7 +1501,7 @@ def begin_stop( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1528,12 +1534,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - def _restart_initial( + def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1561,7 +1566,11 @@ def _restart_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: @@ -1571,11 +1580,11 @@ def _restart_initial( if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace - def begin_restart( + def begin_restart( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1591,9 +1600,6 @@ def begin_restart( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1607,7 +1613,7 @@ def begin_restart( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1640,13 +1646,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace - def update_idle_shutdown_setting( + def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1665,9 +1670,6 @@ def update_idle_shutdown_setting( :type compute_name: str :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -1697,7 +1699,11 @@ def update_idle_shutdown_setting( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1708,5 +1714,5 @@ def update_idle_shutdown_setting( if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting'} # type: ignore + update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py index a23c79eb33f1..e809b6cc7a71 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,32 +44,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -86,7 +86,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # 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), @@ -94,21 +94,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -125,7 +125,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # 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), @@ -133,21 +133,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -165,7 +165,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # 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), @@ -173,23 +173,23 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -238,9 +238,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the result of cls(response) @@ -296,7 +293,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -310,10 +311,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -331,9 +332,6 @@ def delete( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -359,7 +357,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -370,7 +372,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace @@ -392,9 +394,6 @@ def get( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer @@ -420,7 +419,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -435,7 +438,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace @@ -460,9 +463,6 @@ def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer @@ -492,7 +492,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -511,5 +515,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py index d892e4946f40..eae182ebdb75 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions") # 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), @@ -56,31 +56,31 @@ def build_list_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if tags is not None: - query_parameters['$tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['$tags'] = _SERIALIZER.query("tags", tags, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -98,7 +98,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # 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), @@ -107,21 +107,21 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -139,7 +139,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # 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), @@ -148,21 +148,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -181,7 +181,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # 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), @@ -190,23 +190,23 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -271,9 +271,6 @@ def list( :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the result of cls(response) @@ -337,7 +334,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -351,10 +352,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -375,9 +376,6 @@ def delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -404,7 +402,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -415,7 +417,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -440,9 +442,6 @@ def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataVersionBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase @@ -469,7 +468,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -484,7 +487,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -512,9 +515,6 @@ def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataVersionBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase @@ -545,7 +545,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -564,5 +568,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py index 0f364095279e..24fe3fbf1f80 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,42 +49,42 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') if is_default is not None: - query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') + _query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') if names is not None: - query_parameters['names'] = _SERIALIZER.query("names", names, '[str]', div=',') + _query_parameters['names'] = _SERIALIZER.query("names", names, '[str]', div=',') if search_text is not None: - query_parameters['searchText'] = _SERIALIZER.query("search_text", search_text, 'str') + _query_parameters['searchText'] = _SERIALIZER.query("search_text", search_text, 'str') if order_by is not None: - query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if order_by_asc is not None: - query_parameters['orderByAsc'] = _SERIALIZER.query("order_by_asc", order_by_asc, 'bool') + _query_parameters['orderByAsc'] = _SERIALIZER.query("order_by_asc", order_by_asc, 'bool') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -101,7 +101,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # 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), @@ -109,21 +109,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -140,7 +140,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # 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), @@ -148,21 +148,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -181,7 +181,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # 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), @@ -189,25 +189,25 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip_validation is not None: - query_parameters['skipValidation'] = _SERIALIZER.query("skip_validation", skip_validation, 'bool') + _query_parameters['skipValidation'] = _SERIALIZER.query("skip_validation", skip_validation, 'bool') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -224,7 +224,7 @@ def build_list_secrets_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets") # 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), @@ -232,21 +232,21 @@ def build_list_secrets_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -310,9 +310,6 @@ def list( :type order_by: str :param order_by_asc: Order by property in ascending order. :type order_by_asc: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatastoreResourceArmPaginatedResult or the result of cls(response) @@ -378,7 +375,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -392,10 +393,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -413,9 +414,6 @@ def delete( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -441,7 +439,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -452,7 +454,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace @@ -474,9 +476,6 @@ def get( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Datastore, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Datastore @@ -502,7 +501,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -517,7 +520,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace @@ -545,9 +548,6 @@ def create_or_update( :type body: ~azure.mgmt.machinelearningservices.models.Datastore :param skip_validation: Flag to skip validation. :type skip_validation: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Datastore, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Datastore @@ -578,7 +578,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -597,7 +601,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace @@ -619,9 +623,6 @@ def list_secrets( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatastoreSecrets, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets @@ -647,7 +648,11 @@ def list_secrets( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -662,5 +667,5 @@ def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py index eb83a9d9a0bd..9234f37eb34a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,32 +44,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -86,7 +86,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # 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), @@ -94,21 +94,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -125,7 +125,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # 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), @@ -133,21 +133,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -165,7 +165,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # 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), @@ -173,23 +173,23 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -238,9 +238,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or the result of cls(response) @@ -296,7 +293,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -310,10 +311,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -331,9 +332,6 @@ def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -359,7 +357,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -370,7 +372,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace @@ -392,9 +394,6 @@ def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -420,7 +419,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -435,7 +438,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace @@ -460,9 +463,6 @@ def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -492,7 +492,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -511,5 +515,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py index 12f7aa7056a0..167bbc040c85 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +47,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions") # 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), @@ -55,29 +55,29 @@ def build_list_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -95,7 +95,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # 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), @@ -104,21 +104,21 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -136,7 +136,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # 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), @@ -145,21 +145,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -178,7 +178,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # 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), @@ -187,23 +187,23 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -261,9 +261,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or the result of cls(response) @@ -325,7 +322,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -339,10 +340,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -363,9 +364,6 @@ def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -392,7 +390,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -403,7 +405,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -428,9 +430,6 @@ def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -457,7 +456,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -472,7 +475,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -500,9 +503,6 @@ def create_or_update( :type version: str :param body: Definition of EnvironmentVersion. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -533,7 +533,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -552,5 +556,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py index 85ed28079764..a3a443e03453 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,40 +50,40 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if job_type is not None: - query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') + _query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') if tag is not None: - query_parameters['tag'] = _SERIALIZER.query("tag", tag, 'str') + _query_parameters['tag'] = _SERIALIZER.query("tag", tag, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') if scheduled is not None: - query_parameters['scheduled'] = _SERIALIZER.query("scheduled", scheduled, 'bool') + _query_parameters['scheduled'] = _SERIALIZER.query("scheduled", scheduled, 'bool') if schedule_id is not None: - query_parameters['scheduleId'] = _SERIALIZER.query("schedule_id", schedule_id, 'str') + _query_parameters['scheduleId'] = _SERIALIZER.query("schedule_id", schedule_id, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -100,7 +100,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # 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), @@ -108,21 +108,21 @@ def build_delete_request_initial( "id": _SERIALIZER.url("id", id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -139,7 +139,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # 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), @@ -147,21 +147,21 @@ def build_get_request( "id": _SERIALIZER.url("id", id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -179,7 +179,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # 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), @@ -187,23 +187,23 @@ def build_create_or_update_request( "id": _SERIALIZER.url("id", id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -220,7 +220,7 @@ def build_cancel_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel") # 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), @@ -228,21 +228,21 @@ def build_cancel_request_initial( "id": _SERIALIZER.url("id", id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -303,9 +303,6 @@ def list( :type scheduled: bool :param schedule_id: The scheduled id for listing the job triggered from. :type schedule_id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobBaseResourceArmPaginatedResult or the result of cls(response) @@ -369,7 +366,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -383,9 +384,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -413,7 +414,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -430,11 +435,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -452,9 +457,6 @@ def begin_delete( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -468,7 +470,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -501,10 +503,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def get( @@ -525,9 +526,6 @@ def get( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.JobBase @@ -553,7 +551,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -568,7 +570,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace @@ -593,9 +595,6 @@ def create_or_update( :type id: str :param body: Job definition object. :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.JobBase @@ -625,7 +624,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -644,10 +647,10 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - def _cancel_initial( + def _cancel_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -675,7 +678,11 @@ def _cancel_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -691,11 +698,11 @@ def _cancel_initial( if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore + _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace - def begin_cancel( + def begin_cancel( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -713,9 +720,6 @@ def begin_cancel( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -729,7 +733,7 @@ def begin_cancel( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -762,7 +766,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore + begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py index e4c04d98e84d..6fb608de455b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,32 +46,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -88,7 +88,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}") # 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), @@ -96,21 +96,21 @@ def build_delete_request( "id": _SERIALIZER.url("id", id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -129,7 +129,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}") # 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), @@ -137,25 +137,25 @@ def build_get_request( "id": _SERIALIZER.url("id", id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if include_job_instructions is not None: - query_parameters['includeJobInstructions'] = _SERIALIZER.query("include_job_instructions", include_job_instructions, 'bool') + _query_parameters['includeJobInstructions'] = _SERIALIZER.query("include_job_instructions", include_job_instructions, 'bool') if include_label_categories is not None: - query_parameters['includeLabelCategories'] = _SERIALIZER.query("include_label_categories", include_label_categories, 'bool') + _query_parameters['includeLabelCategories'] = _SERIALIZER.query("include_label_categories", include_label_categories, 'bool') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -173,7 +173,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}") # 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), @@ -181,23 +181,23 @@ def build_create_or_update_request_initial( "id": _SERIALIZER.url("id", id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -215,7 +215,7 @@ def build_export_labels_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels") # 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), @@ -223,23 +223,23 @@ def build_export_labels_request_initial( "id": _SERIALIZER.url("id", id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -256,7 +256,7 @@ def build_pause_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause") # 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), @@ -264,21 +264,21 @@ def build_pause_request( "id": _SERIALIZER.url("id", id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -295,7 +295,7 @@ def build_resume_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume") # 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), @@ -303,21 +303,21 @@ def build_resume_request_initial( "id": _SERIALIZER.url("id", id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -366,9 +366,6 @@ def list( :type skip: str :param count: Number of labeling jobs to return. :type count: int - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the result of cls(response) @@ -424,7 +421,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -438,10 +439,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -459,9 +460,6 @@ def delete( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -487,7 +485,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -498,7 +500,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace @@ -528,9 +530,6 @@ def get( :param include_label_categories: Boolean value to indicate Whether to include LabelCategories in response. :type include_label_categories: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LabelingJob, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob @@ -558,7 +557,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -573,7 +576,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore def _create_or_update_initial( @@ -609,7 +612,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -631,7 +638,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace @@ -656,9 +663,6 @@ def begin_create_or_update( :type id: str :param body: LabelingJob definition object. :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -674,7 +678,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] lro_delay = kwargs.pop( 'polling_interval', @@ -712,10 +716,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore def _export_labels_initial( self, @@ -750,7 +753,11 @@ def _export_labels_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -772,7 +779,7 @@ def _export_labels_initial( return deserialized - _export_labels_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels'} # type: ignore + _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace @@ -797,9 +804,6 @@ def begin_export_labels( :type id: str :param body: The export summary. :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -815,7 +819,7 @@ def begin_export_labels( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] lro_delay = kwargs.pop( 'polling_interval', @@ -853,13 +857,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_export_labels.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels'} # type: ignore + begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace - def pause( + def pause( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -877,9 +880,6 @@ def pause( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -905,7 +905,11 @@ def pause( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -916,10 +920,10 @@ def pause( if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause'} # type: ignore + pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - def _resume_initial( + def _resume_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -947,7 +951,11 @@ def _resume_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -963,11 +971,11 @@ def _resume_initial( if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume'} # type: ignore + _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace - def begin_resume( + def begin_resume( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -985,9 +993,6 @@ def begin_resume( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1001,7 +1006,7 @@ def begin_resume( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1034,7 +1039,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume'} # type: ignore + begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py index bfc1d2f93076..0d78a86fe090 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,34 +45,34 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -89,7 +89,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # 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), @@ -97,21 +97,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -128,7 +128,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # 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), @@ -136,21 +136,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -168,7 +168,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # 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), @@ -176,23 +176,23 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -244,9 +244,6 @@ def list( :type count: int :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the result of cls(response) @@ -304,7 +301,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -318,10 +319,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -339,9 +340,6 @@ def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -367,7 +365,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -378,7 +380,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace @@ -400,9 +402,6 @@ def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -428,7 +427,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -443,7 +446,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace @@ -468,9 +471,6 @@ def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -500,7 +500,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -519,5 +523,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py index 221b6389a8b4..cf1c86a89d73 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions") # 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), @@ -61,41 +61,41 @@ def build_list_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if version is not None: - query_parameters['version'] = _SERIALIZER.query("version", version, 'str') + _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') if description is not None: - query_parameters['description'] = _SERIALIZER.query("description", description, 'str') + _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') if offset is not None: - query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') + _query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') if properties is not None: - query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') + _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') if feed is not None: - query_parameters['feed'] = _SERIALIZER.query("feed", feed, 'str') + _query_parameters['feed'] = _SERIALIZER.query("feed", feed, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -113,7 +113,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # 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), @@ -122,21 +122,21 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -154,7 +154,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # 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), @@ -163,21 +163,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -196,7 +196,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # 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), @@ -205,23 +205,23 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -299,9 +299,6 @@ def list( :type feed: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the result of cls(response) @@ -375,7 +372,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -389,10 +390,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -413,9 +414,6 @@ def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -442,7 +440,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -453,7 +455,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -478,9 +480,6 @@ def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -507,7 +506,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -522,7 +525,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -550,9 +553,6 @@ def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -583,7 +583,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -602,5 +606,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py index 0af2fd7ecdce..4d3d7e29176a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments") # 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), @@ -56,27 +56,27 @@ def build_list_request( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -94,7 +94,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # 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), @@ -103,21 +103,21 @@ def build_delete_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -135,7 +135,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # 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), @@ -144,21 +144,21 @@ def build_get_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -177,7 +177,7 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # 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), @@ -186,23 +186,23 @@ def build_update_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -221,7 +221,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # 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), @@ -230,23 +230,23 @@ def build_create_or_update_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -265,7 +265,7 @@ def build_get_logs_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs") # 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), @@ -274,23 +274,23 @@ def build_get_logs_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -310,7 +310,7 @@ def build_list_skus_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus") # 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), @@ -319,25 +319,25 @@ def build_list_skus_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -392,9 +392,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OnlineDeploymentTrackedResourceArmPaginatedResult or the result of cls(response) @@ -454,7 +451,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -468,9 +469,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -500,7 +501,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -517,11 +522,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -542,9 +547,6 @@ def begin_delete( :type endpoint_name: str :param deployment_name: Inference Endpoint Deployment name. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -558,7 +560,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -592,10 +594,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -619,9 +620,6 @@ def get( :type endpoint_name: str :param deployment_name: Inference Endpoint Deployment name. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OnlineDeployment, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment @@ -648,7 +646,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -663,7 +665,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( @@ -701,7 +703,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -724,7 +730,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace @@ -752,9 +758,6 @@ def begin_update( :type deployment_name: str :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -771,7 +774,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -810,10 +813,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -850,7 +852,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -872,7 +878,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace @@ -900,9 +906,6 @@ def begin_create_or_update( :type deployment_name: str :param body: Inference Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -919,7 +922,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -958,10 +961,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get_logs( @@ -988,9 +990,6 @@ def get_logs( :type deployment_name: str :param body: The request containing parameters for retrieving logs. :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentLogs, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs @@ -1021,7 +1020,11 @@ def get_logs( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1036,7 +1039,7 @@ def get_logs( return deserialized - get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs'} # type: ignore + get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace @@ -1067,9 +1070,6 @@ def list_skus( :type count: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of cls(response) @@ -1129,7 +1129,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1143,4 +1147,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus'} # type: ignore + list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py index 60221ff9d973..448697196546 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,42 +51,42 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if name is not None: - query_parameters['name'] = _SERIALIZER.query("name", name, 'str') + _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') if compute_type is not None: - query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') + _query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') if properties is not None: - query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') + _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') if order_by is not None: - query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -103,7 +103,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # 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), @@ -111,21 +111,21 @@ def build_delete_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -142,7 +142,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # 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), @@ -150,21 +150,21 @@ def build_get_request( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -182,7 +182,7 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # 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), @@ -190,23 +190,23 @@ def build_update_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -224,7 +224,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # 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), @@ -232,23 +232,23 @@ def build_create_or_update_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -265,7 +265,7 @@ def build_list_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys") # 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), @@ -273,21 +273,21 @@ def build_list_keys_request( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -305,7 +305,7 @@ def build_regenerate_keys_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys") # 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), @@ -313,23 +313,23 @@ def build_regenerate_keys_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -346,7 +346,7 @@ def build_get_token_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token") # 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), @@ -354,21 +354,21 @@ def build_get_token_request( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -435,9 +435,6 @@ def list( :type properties: str :param order_by: The option to order the response. :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OnlineEndpointTrackedResourceArmPaginatedResult or the result of cls(response) @@ -503,7 +500,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -517,9 +518,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -547,7 +548,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -564,11 +569,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -586,9 +591,6 @@ def begin_delete( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -602,7 +604,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -635,10 +637,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -659,9 +660,6 @@ def get( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OnlineEndpoint, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint @@ -687,7 +685,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -702,7 +704,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _update_initial( @@ -738,7 +740,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -761,7 +767,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace @@ -787,9 +793,6 @@ def begin_update( :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -806,7 +809,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -844,10 +847,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -882,7 +884,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -904,7 +910,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace @@ -929,9 +935,6 @@ def begin_create_or_update( :type endpoint_name: str :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -948,7 +951,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -986,10 +989,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -1010,9 +1012,6 @@ def list_keys( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthKeys, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys @@ -1038,7 +1037,11 @@ def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1053,10 +1056,10 @@ def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - def _regenerate_keys_initial( + def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1089,7 +1092,11 @@ def _regenerate_keys_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1105,11 +1112,11 @@ def _regenerate_keys_initial( if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace - def begin_regenerate_keys( + def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1130,9 +1137,6 @@ def begin_regenerate_keys( :type endpoint_name: str :param body: RegenerateKeys request . :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1147,7 +1151,7 @@ def begin_regenerate_keys( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1182,10 +1186,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def get_token( @@ -1206,9 +1209,6 @@ def get_token( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthToken, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken @@ -1234,7 +1234,11 @@ def get_token( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1249,5 +1253,5 @@ def get_token( return deserialized - get_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token'} # type: ignore + get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py index ea2920b77703..28734bc56724 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -39,21 +39,21 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/providers/Microsoft.MachineLearningServices/operations') + _url = kwargs.pop("template_url", "/providers/Microsoft.MachineLearningServices/operations") # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -88,9 +88,6 @@ def list( # type: (...) -> Iterable["_models.AmlOperationListResult"] """Lists all of the available Azure Machine Learning Services REST API operations. - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AmlOperationListResult or the result of cls(response) @@ -136,7 +133,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -150,4 +151,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py index 181a009e09dc..58281925f838 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,28 +42,28 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -80,7 +80,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # 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), @@ -88,21 +88,21 @@ def build_get_request( "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -120,7 +120,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # 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), @@ -128,23 +128,23 @@ def build_create_or_update_request( "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -161,7 +161,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # 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), @@ -169,21 +169,21 @@ def build_delete_request( "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -224,9 +224,6 @@ def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) @@ -278,7 +275,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -292,7 +293,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -312,9 +313,6 @@ def get( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the workspace. :type private_endpoint_connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateEndpointConnection, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection @@ -340,7 +338,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -355,7 +357,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace @@ -379,9 +381,6 @@ def create_or_update( :type private_endpoint_connection_name: str :param properties: The private endpoint connection properties. :type properties: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateEndpointConnection, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection @@ -411,7 +410,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -426,11 +429,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -447,9 +450,6 @@ def delete( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the workspace. :type private_endpoint_connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -475,7 +475,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -486,5 +490,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py index 4c7a77d2bf93..1ad9f1900055 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,14 +16,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,28 +41,28 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -103,9 +103,6 @@ def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResourceListResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult @@ -130,7 +127,11 @@ def list( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -145,5 +146,5 @@ def list( return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py index 828a0e22643c..d69bf6dfa54f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,29 +42,29 @@ def build_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas") # pylint: disable=line-too-long path_format_arguments = { "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,27 +79,27 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -140,9 +140,6 @@ def update( :type location: str :param parameters: Quota update parameters. :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UpdateWorkspaceQuotasResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult @@ -170,7 +167,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -185,7 +186,7 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace @@ -199,9 +200,6 @@ def list( :param location: The location for which resource usage is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) :rtype: @@ -250,7 +248,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -264,4 +266,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py index f2c903b70366..a3468d327729 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,28 +43,28 @@ def build_list_by_subscription_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -80,29 +80,29 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries") # 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), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -118,28 +118,28 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # 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), "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -155,28 +155,28 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # 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), "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -193,30 +193,30 @@ def build_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # 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), "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -233,30 +233,30 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # 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), "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -296,9 +296,6 @@ def list_by_subscription( :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the result of cls(response) @@ -348,7 +345,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -362,7 +363,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( @@ -380,9 +381,6 @@ def list( :type resource_group_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the result of cls(response) @@ -434,7 +432,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -448,10 +450,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -466,9 +468,6 @@ def delete( :type resource_group_name: str :param registry_name: Name of registry. This is case-insensitive. :type registry_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -493,7 +492,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -504,7 +507,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace @@ -523,9 +526,6 @@ def get( :type resource_group_name: str :param registry_name: Name of registry. This is case-insensitive. :type registry_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Registry, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Registry @@ -550,7 +550,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -565,7 +569,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace @@ -587,9 +591,6 @@ def update( :type registry_name: str :param body: Details required to create the registry. :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Registry, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Registry @@ -618,7 +619,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -633,7 +638,7 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore def _create_or_update_initial( @@ -667,10 +672,14 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) @@ -680,12 +689,15 @@ def _create_or_update_initial( if response.status_code == 201: deserialized = self._deserialize('Registry', pipeline_response) + if response.status_code == 202: + deserialized = self._deserialize('Registry', pipeline_response) + if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace @@ -707,9 +719,6 @@ def begin_create_or_update( :type registry_name: str :param body: Details required to create the registry. :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -724,7 +733,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( 'polling_interval', @@ -761,7 +770,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py index a330703c74f1..2366781ec437 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,30 +45,30 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes") # 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), "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,7 +85,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}") # 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), @@ -93,21 +93,21 @@ def build_delete_request_initial( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -124,7 +124,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}") # 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), @@ -132,21 +132,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -164,7 +164,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}") # 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), @@ -172,23 +172,23 @@ def build_create_or_update_request_initial( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -234,9 +234,6 @@ def list( :type registry_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the result of cls(response) @@ -290,7 +287,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -304,9 +305,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -334,7 +335,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -351,11 +356,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -373,9 +378,6 @@ def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -389,7 +391,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -422,10 +424,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace def get( @@ -446,9 +447,6 @@ def get( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -474,7 +472,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -489,7 +491,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore def _create_or_update_initial( @@ -525,7 +527,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -547,7 +553,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace @@ -572,9 +578,6 @@ def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -590,7 +593,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -628,7 +631,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py index 69cb21d354f8..df8e42fdc76b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions") # 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), @@ -56,27 +56,27 @@ def build_list_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -94,7 +94,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}") # 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), @@ -103,21 +103,21 @@ def build_delete_request_initial( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -135,7 +135,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}") # 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), @@ -144,21 +144,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -177,7 +177,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}") # 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), @@ -186,23 +186,23 @@ def build_create_or_update_request_initial( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -257,9 +257,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the result of cls(response) @@ -319,7 +316,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -333,9 +334,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -365,7 +366,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -382,11 +387,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -407,9 +412,6 @@ def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -423,7 +425,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -457,10 +459,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -484,9 +485,6 @@ def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -513,7 +511,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -528,7 +530,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( @@ -566,7 +568,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -588,7 +594,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -616,9 +622,6 @@ def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -634,7 +637,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -673,7 +676,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py index 49f648ea56d5..4b9297e159f1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,30 +45,30 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components") # 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), "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,7 +85,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}") # 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), @@ -93,21 +93,21 @@ def build_delete_request_initial( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -124,7 +124,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}") # 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), @@ -132,21 +132,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -164,7 +164,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}") # 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), @@ -172,23 +172,23 @@ def build_create_or_update_request_initial( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -234,9 +234,6 @@ def list( :type registry_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or the result of cls(response) @@ -290,7 +287,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -304,9 +305,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -334,7 +335,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -351,11 +356,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -373,9 +378,6 @@ def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -389,7 +391,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -422,10 +424,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace def get( @@ -446,9 +447,6 @@ def get( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -474,7 +472,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -489,7 +491,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore def _create_or_update_initial( @@ -525,7 +527,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -547,7 +553,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace @@ -572,9 +578,6 @@ def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -591,7 +594,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -629,7 +632,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py index b0ca745c6d92..826aacb218e8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions") # 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), @@ -56,27 +56,27 @@ def build_list_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -94,7 +94,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}") # 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), @@ -103,21 +103,21 @@ def build_delete_request_initial( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -135,7 +135,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}") # 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), @@ -144,21 +144,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -177,7 +177,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}") # 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), @@ -186,23 +186,23 @@ def build_create_or_update_request_initial( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -257,9 +257,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the result of cls(response) @@ -319,7 +316,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -333,9 +334,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -365,7 +366,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -382,11 +387,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -407,9 +412,6 @@ def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -423,7 +425,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -457,10 +459,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -484,9 +485,6 @@ def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -513,7 +511,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -528,7 +530,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( @@ -566,7 +568,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -588,7 +594,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -616,9 +622,6 @@ def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -635,7 +638,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -674,7 +677,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py index a03c2c6686e1..253b3b103a5b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,32 +46,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments") # 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), "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -88,7 +88,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}") # 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), @@ -96,21 +96,21 @@ def build_delete_request_initial( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -127,7 +127,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}") # 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), @@ -135,21 +135,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -167,7 +167,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}") # 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), @@ -175,23 +175,23 @@ def build_create_or_update_request_initial( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -240,9 +240,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or the result of cls(response) @@ -298,7 +295,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -312,9 +313,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -342,7 +343,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -359,11 +364,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -381,9 +386,6 @@ def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -397,7 +399,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -430,10 +432,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace def get( @@ -454,9 +455,6 @@ def get( :type registry_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -482,7 +480,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -497,7 +499,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore def _create_or_update_initial( @@ -533,7 +535,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -555,7 +561,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace @@ -580,9 +586,6 @@ def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -599,7 +602,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -637,7 +640,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py index a52e3e6b2dc0..baf37424abd9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +49,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions") # 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), @@ -57,29 +57,29 @@ def build_list_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -97,7 +97,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}") # 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), @@ -106,21 +106,21 @@ def build_delete_request_initial( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -138,7 +138,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}") # 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), @@ -147,21 +147,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -180,7 +180,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}") # 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), @@ -189,23 +189,23 @@ def build_create_or_update_request_initial( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -263,9 +263,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or the result of cls(response) @@ -327,7 +324,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -341,9 +342,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -373,7 +374,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -390,11 +395,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -415,9 +420,6 @@ def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -431,7 +433,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -465,10 +467,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -492,9 +493,6 @@ def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -521,7 +519,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -536,7 +538,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( @@ -574,7 +576,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -596,7 +602,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -624,9 +630,6 @@ def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -643,7 +646,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -682,7 +685,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py index 5ed8c24e76e6..edf60684ffbb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,32 +46,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models") # 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), "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -88,7 +88,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}") # 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), @@ -96,21 +96,21 @@ def build_delete_request_initial( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -127,7 +127,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}") # 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), @@ -135,21 +135,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -167,7 +167,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}") # 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), @@ -175,23 +175,23 @@ def build_create_or_update_request_initial( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -240,9 +240,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the result of cls(response) @@ -298,7 +295,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -312,9 +313,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -342,7 +343,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -359,11 +364,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -381,9 +386,6 @@ def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -397,7 +399,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -430,10 +432,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace def get( @@ -454,9 +455,6 @@ def get( :type registry_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -482,7 +480,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -497,7 +499,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore def _create_or_update_initial( @@ -533,7 +535,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -555,7 +561,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace @@ -580,9 +586,6 @@ def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -599,7 +602,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -637,7 +640,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py index 94a2fad67cd4..ed7ca8357ae7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions") # 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), @@ -61,37 +61,37 @@ def build_list_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if version is not None: - query_parameters['version'] = _SERIALIZER.query("version", version, 'str') + _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') if description is not None: - query_parameters['description'] = _SERIALIZER.query("description", description, 'str') + _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') if properties is not None: - query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') + _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -109,7 +109,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}") # 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), @@ -118,21 +118,21 @@ def build_delete_request_initial( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -150,7 +150,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}") # 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), @@ -159,21 +159,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -192,7 +192,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}") # 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), @@ -201,23 +201,23 @@ def build_create_or_update_request_initial( "version": _SERIALIZER.url("version", version, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -289,9 +289,6 @@ def list( :type properties: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the result of cls(response) @@ -361,7 +358,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -375,9 +376,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -407,7 +408,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -424,11 +429,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -449,9 +454,6 @@ def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -465,7 +467,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -499,10 +501,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -526,9 +527,6 @@ def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -555,7 +553,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -570,7 +572,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( @@ -608,7 +610,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -630,7 +636,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -658,9 +664,6 @@ def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -676,7 +679,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -715,7 +718,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py index 79681867d082..f86a36206fc2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,32 +46,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -88,7 +88,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # 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), @@ -96,21 +96,21 @@ def build_delete_request_initial( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -127,7 +127,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # 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), @@ -135,21 +135,21 @@ def build_get_request( "name": _SERIALIZER.url("name", name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -167,7 +167,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # 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), @@ -175,23 +175,23 @@ def build_create_or_update_request_initial( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -240,9 +240,6 @@ def list( :type skip: str :param list_view_type: Status filter for schedule. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ScheduleResourceArmPaginatedResult or the result of cls(response) @@ -298,7 +295,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -312,9 +313,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -342,7 +343,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -359,11 +364,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -381,9 +386,6 @@ def begin_delete( :type workspace_name: str :param name: Schedule name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -397,7 +399,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -430,10 +432,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def get( @@ -454,9 +455,6 @@ def get( :type workspace_name: str :param name: Schedule name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Schedule, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Schedule @@ -482,7 +480,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -497,7 +499,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore def _create_or_update_initial( @@ -533,7 +535,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -555,7 +561,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace @@ -580,9 +586,6 @@ def begin_create_or_update( :type name: str :param body: Schedule definition. :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -597,7 +600,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( 'polling_interval', @@ -635,7 +638,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py index 0ddc7b3d314f..eaf2673542b7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,27 +41,27 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -100,9 +100,6 @@ def list( :param location: The location for which resource usage is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListUsagesResult or the result of cls(response) :rtype: @@ -151,7 +148,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -165,4 +166,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py index 20dc5fbf5070..0c8ccb2106cb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,14 +16,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,27 +40,27 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes") # pylint: disable=line-too-long path_format_arguments = { "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -98,9 +98,6 @@ def list( :param location: The location upon which virtual-machine-sizes is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: VirtualMachineSizeListResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult @@ -124,7 +121,11 @@ def list( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -139,5 +140,5 @@ def list( return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py index 7dce64062ad8..0e8b54fa156e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +44,7 @@ def build_create_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # 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), @@ -52,23 +52,23 @@ def build_create_request( "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,7 +85,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # 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), @@ -93,21 +93,21 @@ def build_get_request( "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -124,7 +124,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # 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), @@ -132,21 +132,21 @@ def build_delete_request( "connectionName": _SERIALIZER.url("connection_name", connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -164,32 +164,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if target is not None: - query_parameters['target'] = _SERIALIZER.query("target", target, 'str') + _query_parameters['target'] = _SERIALIZER.query("target", target, 'str') if category is not None: - query_parameters['category'] = _SERIALIZER.query("category", category, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['category'] = _SERIALIZER.query("category", category, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -237,9 +237,6 @@ def create( :param parameters: The object for creating or updating a new workspace connection. :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource @@ -269,7 +266,11 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -284,7 +285,7 @@ def create( return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace @@ -304,9 +305,6 @@ def get( :type workspace_name: str :param connection_name: Friendly name of the workspace connection. :type connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource @@ -332,7 +330,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -347,11 +349,11 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -367,9 +369,6 @@ def delete( :type workspace_name: str :param connection_name: Friendly name of the workspace connection. :type connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -395,7 +394,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -406,7 +409,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace @@ -429,9 +432,6 @@ def list( :type target: str :param category: Category of the workspace connection. :type category: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult or the result of cls(response) @@ -487,7 +487,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -501,4 +505,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py index 527e6f78f637..95365dd5eca7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,28 +42,28 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -104,9 +104,6 @@ def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListAmlUserFeatureResult or the result of cls(response) @@ -158,7 +155,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -172,4 +173,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py index e277ab626ffe..86fa0ef46b74 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,28 +44,28 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -82,30 +82,30 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -121,28 +121,28 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -159,30 +159,30 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -198,29 +198,29 @@ def build_list_by_resource_group_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces") # 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), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -237,30 +237,30 @@ def build_diagnose_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -276,28 +276,28 @@ def build_list_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -313,28 +313,28 @@ def build_resync_keys_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -349,28 +349,28 @@ def build_list_by_subscription_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -386,28 +386,28 @@ def build_list_notebook_access_token_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -423,28 +423,28 @@ def build_prepare_notebook_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -460,28 +460,28 @@ def build_list_storage_account_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -497,28 +497,28 @@ def build_list_notebook_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -534,28 +534,28 @@ def build_list_outbound_network_dependencies_endpoints_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints") # 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), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -596,9 +596,6 @@ def get( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Workspace, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Workspace @@ -623,7 +620,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -638,7 +639,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _create_or_update_initial( @@ -672,7 +673,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -688,7 +693,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace @@ -708,9 +713,6 @@ def begin_create_or_update( :type workspace_name: str :param parameters: The parameters for creating or updating a machine learning workspace. :type parameters: ~azure.mgmt.machinelearningservices.models.Workspace - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -725,7 +727,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( 'polling_interval', @@ -762,12 +764,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -793,7 +794,11 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -803,11 +808,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -820,9 +825,6 @@ def begin_delete( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -836,7 +838,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -868,10 +870,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _update_initial( self, @@ -904,7 +905,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -920,7 +925,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace @@ -940,9 +945,6 @@ def begin_update( :type workspace_name: str :param parameters: The parameters for updating a machine learning workspace. :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -957,7 +959,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( 'polling_interval', @@ -994,10 +996,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -1013,9 +1014,6 @@ def list_by_resource_group( :type resource_group_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) :rtype: @@ -1066,7 +1064,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1080,7 +1082,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore def _diagnose_initial( self, @@ -1116,7 +1118,11 @@ def _diagnose_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1138,7 +1144,7 @@ def _diagnose_initial( return deserialized - _diagnose_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace @@ -1160,9 +1166,6 @@ def begin_diagnose( :type workspace_name: str :param parameters: The parameter of diagnosing workspace health. :type parameters: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1179,7 +1182,7 @@ def begin_diagnose( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1216,10 +1219,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_diagnose.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def list_keys( @@ -1236,9 +1238,6 @@ def list_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListWorkspaceKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult @@ -1263,7 +1262,11 @@ def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1278,10 +1281,10 @@ def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - def _resync_keys_initial( + def _resync_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1307,7 +1310,11 @@ def _resync_keys_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1317,11 +1324,11 @@ def _resync_keys_initial( if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace - def begin_resync_keys( + def begin_resync_keys( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1335,9 +1342,6 @@ def begin_resync_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1351,7 +1355,7 @@ def begin_resync_keys( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1383,10 +1387,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -1399,9 +1402,6 @@ def list_by_subscription( :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) :rtype: @@ -1450,7 +1450,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1464,7 +1468,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace def list_notebook_access_token( @@ -1480,9 +1484,6 @@ def list_notebook_access_token( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NotebookAccessTokenResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult @@ -1507,7 +1508,11 @@ def list_notebook_access_token( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1522,7 +1527,7 @@ def list_notebook_access_token( return deserialized - list_notebook_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken'} # type: ignore + list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore def _prepare_notebook_initial( @@ -1551,7 +1556,11 @@ def _prepare_notebook_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1567,7 +1576,7 @@ def _prepare_notebook_initial( return deserialized - _prepare_notebook_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace @@ -1584,9 +1593,6 @@ def begin_prepare_notebook( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1602,7 +1608,7 @@ def begin_prepare_notebook( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -1637,10 +1643,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_prepare_notebook.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def list_storage_account_keys( @@ -1656,9 +1661,6 @@ def list_storage_account_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListStorageAccountKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult @@ -1683,7 +1685,11 @@ def list_storage_account_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1698,7 +1704,7 @@ def list_storage_account_keys( return deserialized - list_storage_account_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys'} # type: ignore + list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace @@ -1715,9 +1721,6 @@ def list_notebook_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListNotebookKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult @@ -1742,7 +1745,11 @@ def list_notebook_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1757,7 +1764,7 @@ def list_notebook_keys( return deserialized - list_notebook_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys'} # type: ignore + list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace @@ -1778,9 +1785,6 @@ def list_outbound_network_dependencies_endpoints( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ExternalFQDNResponse, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse @@ -1805,7 +1809,11 @@ def list_outbound_network_dependencies_endpoints( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1820,5 +1828,5 @@ def list_outbound_network_dependencies_endpoints( return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints'} # type: ignore + list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore From d08ce6dc97d7cba0120a71493117012f6e4ad6d2 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Mon, 26 Sep 2022 11:46:24 -0400 Subject: [PATCH 06/44] registry schema feedback changes --- .../azure/ai/ml/_schema/registry/registry.py | 4 +-- .../registry/registry_region_arm_details.py | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py index 579ef59a1b89..65664ac7788a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py @@ -4,7 +4,7 @@ from marshmallow import fields -from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum, UnionField +from azure.ai.ml._schema.core.fields import DumpableStringField, NestedField, StringTransformedEnum, UnionField from azure.ai.ml._schema.core.resource import ResourceSchema from azure.ai.ml._utils.utils import snake_to_pascal from azure.ai.ml.constants._common import PublicNetworkAccess @@ -38,7 +38,7 @@ class RegistrySchema(ResourceSchema): # definition, which has a per-region list of acr accounts. # Per-region acr account configuration is NOT possible through yaml configs for now. container_registry = UnionField( - [fields.Str(validate=acr_format_validator), NestedField(SystemCreatedAcrAccountSchema)], + [DumpableStringField(validate=acr_format_validator), NestedField(SystemCreatedAcrAccountSchema)], required=False, is_strict=True, load_default=SystemCreatedAcrAccount(acr_account_sku=AcrAccountSku.PREMIUM), diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py index 879c11bad95b..a828682bedd7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py @@ -4,19 +4,36 @@ from marshmallow import ValidationError, fields, post_load, pre_dump -from azure.ai.ml._schema.core.fields import NestedField, UnionField +from azure.ai.ml._schema.core.fields import DumpableStringField, NestedField, UnionField from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta +from azure.ai.ml.constants._registry import StorageAccountType +from azure.ai.ml.entities._registry.registry_support_classes import SystemCreatedStorageAccount +from .system_created_acr_account import SystemCreatedAcrAccountSchema from .system_created_storage_account import SystemCreatedStorageAccountSchema -from .util import storage_account_validator +from .util import acr_format_validator, storage_account_validator # Differs from the swagger def in that the acr_details can only be supplied as a # single registry-wide instance, rather than a per-region list. class RegistryRegionArmDetailsSchema(metaclass=PatchedSchemaMeta): + acr_config = fields.List( + UnionField( + [DumpableStringField(validate=acr_format_validator), NestedField(SystemCreatedAcrAccountSchema)], + dump_only=True, + is_strict=True, + ) + ) location = fields.Str() - storage_config = fields.List( - UnionField([fields.Str(validate=storage_account_validator), NestedField(SystemCreatedStorageAccountSchema)]) + storage_config = UnionField( + [ + NestedField(SystemCreatedStorageAccountSchema), + fields.List(DumpableStringField(validate=storage_account_validator)), + ], + is_strict=True, + load_default=SystemCreatedStorageAccount( + storage_account_hns=False, storage_account_type=StorageAccountType.STANDARD_LRS + ), ) @post_load From 553b814cdead6f04bc01178cd5cbf04dba735a13 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Mon, 26 Sep 2022 11:49:27 -0400 Subject: [PATCH 07/44] Registry entity class yaml conversion fixes --- .../ai/ml/entities/_registry/registry.py | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index d2758bdccfb0..a8395b630226 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -21,7 +21,7 @@ from azure.ai.ml.entities._resource import Resource from azure.ai.ml.entities._util import load_from_dict -from .registry_support_classes import RegistryRegionArmDetails +from .registry_support_classes import RegistryRegionArmDetails, SystemCreatedStorageAccount YAML_REGION_DETAILS = "replication_locations" YAML_SINGLE_ACR_DETAIL = "container_registry" @@ -90,7 +90,21 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]]) -> None: def _to_dict(self) -> Dict: # pylint: disable=no-member - return RegistrySchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema = RegistrySchema(context={BASE_PATH_CONTEXT_KEY: "./"}) + # Change name of region_details to user-shown anme + self.replication_locations = self.region_details + # Grab the first acr account of the first region and set that + # as the system-wide container registry. + if self.replication_locations and len(self.replication_locations) > 0: + if self.replication_locations[0].acr_config and len(self.replication_locations[0].acr_config) > 0: + self.container_registry = self.replication_locations[0].acr_config[0] + # Change single-list managed storage accounts to not be lists + for region_detail in self.replication_locations: + if region_detail.storage_config and isinstance( + region_detail.storage_config[0], SystemCreatedStorageAccount + ): + region_detail.storage_config = region_detail.storage_config[0] + return schema.dump(self) @classmethod def _load( @@ -130,7 +144,8 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": name=rest_obj.name, description=real_registry.description, identity=identity, - tags=real_registry.tags, + id=rest_obj.id, + tags=rest_obj.tags, location=rest_obj.location, public_network_access=real_registry.public_network_access, discovery_url=real_registry.discovery_url, @@ -139,6 +154,7 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": mlflow_registry_uri=real_registry.ml_flow_registry_uri, region_details=region_details, ) + return result # There are differences between what our registry validation schema # accepts, and how we actually represent things internally. @@ -156,9 +172,13 @@ def _convert_yaml_dict_to_entity_input(cls, input: Dict): acr_input = input.pop(YAML_SINGLE_ACR_DETAIL) global_acr_exists = True for region_detail in input[CLASS_REGION_DETAILS]: + # Apply container_registry as acr_config of each region detail if global_acr_exists: if not hasattr(region_detail, "acr_details") or len(region_detail.acr_details) == 0: region_detail.acr_config = [acr_input] + # Return single, non-list managed storage into a 1-element list. + if region_detail.storage_config and isinstance(region_detail.storage_config, SystemCreatedStorageAccount): + region_detail.storage_config = [region_detail.storage_config] def _to_rest_object(self) -> RestRegistry: """Build current parameterized schedule instance to a registry object before submission. From 80e76e326be9750ca6debc313c5b1f9161f6d12a Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Mon, 26 Sep 2022 12:56:05 -0400 Subject: [PATCH 08/44] fix unit tests --- .../azure/ai/ml/entities/_registry/registry.py | 2 +- .../ai/ml/operations/_registry_operations.py | 2 +- .../unittests/test_registry_autorest.py | 4 +--- .../registry/unittests/test_registry_entity.py | 17 ++++++++++------- .../unittests/test_registry_operations.py | 14 +++++--------- .../registry/unittests/test_registry_schema.py | 13 ++++--------- .../test_configs/registry/registry_valid.yaml | 3 +-- .../test_configs/registry/registry_valid_2.yaml | 2 -- .../test_configs/registry/registry_valid_3.yaml | 3 +-- 9 files changed, 24 insertions(+), 36 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index a8395b630226..f3f101aa2b50 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -177,7 +177,7 @@ def _convert_yaml_dict_to_entity_input(cls, input: Dict): if not hasattr(region_detail, "acr_details") or len(region_detail.acr_details) == 0: region_detail.acr_config = [acr_input] # Return single, non-list managed storage into a 1-element list. - if region_detail.storage_config and isinstance(region_detail.storage_config, SystemCreatedStorageAccount): + if hasattr(region_detail, "storage_config") and isinstance(region_detail.storage_config, SystemCreatedStorageAccount): region_detail.storage_config = [region_detail.storage_config] def _to_rest_object(self) -> RestRegistry: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 3aa705232f63..53da14cb4fd5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -64,7 +64,7 @@ def list(self) -> Iterable[Registry]: :rtype: ~azure.core.paging.ItemPaged[Registry] """ - return self._operation.list_by_subscription(cls=lambda objs: [Registry._from_rest_object(obj) for obj in objs]) + return self._operation.list(cls=lambda objs: [Registry._from_rest_object(obj) for obj in objs]) @monitor_with_activity(logger, "Registry.Get", ActivityType.PUBLICAPI) def get(self, name: str = None, **kwargs: Dict) -> Registry: diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py index fd97afba91ca..4d429e951c54 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py @@ -28,8 +28,6 @@ class TestRegistrySchema: definition, and regenerate you autorest files.""" def test_deserialize_from_autorest_object(self) -> None: - # TODO Implement this once Regisy._from_rest_object is implemented - loc_1 = "USEast" tags = {"test": "registry"} name = "registry name" @@ -93,7 +91,7 @@ def test_deserialize_from_autorest_object(self) -> None: assert registry_entity assert registry_entity.description == description assert registry_entity.location == loc_1 - assert registry_entity.tags == interior_tags + assert registry_entity.tags == tags # assert registry_entity.name == name # TODO Local workspace obj doesn't record name besides pushing up to super class. Should we? # assert registry_entity.id == id # TODO Local workspace obj doesn't record id. Should we? assert registry_entity.public_network_access == pna diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py index b0e459417c7a..d303f114be8d 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py @@ -13,11 +13,14 @@ from azure.ai.ml.entities import Registry, RegistryRegionArmDetails loc_1 = "USEast" -tags = {"test": "registry"} +exterior_tags = {"test": "registry"} name = "registry name" # id = "registry id" description = "registry description" -# There are two places in a registry where tags can live. Which do we care about? +# There are two places in a registry where tags can live. We only care about +# tags set at the top level, AKA the 'exterior_tags' defined above/ +# These interior tags only exists to show that the value technically +# exists due to swagger-side inheritance in the autotest. interior_tags = {"properties": "have tags"} pna = "Enabled" discovery_url = "www.here-be-registries.com" @@ -52,7 +55,7 @@ class TestRegistrySchema: def test_deserialize_from_autorest_object(self) -> None: rest_registry = RestRegistry( location=loc_1, - tags=tags, + tags=exterior_tags, name=name, id="registry id", properties=RegistryProperties( @@ -93,7 +96,7 @@ def test_deserialize_from_autorest_object(self) -> None: assert registry_entity assert registry_entity.description == description assert registry_entity.location == loc_1 - assert registry_entity.tags == interior_tags + assert registry_entity.tags == exterior_tags # TODO https://dev.azure.com/msdata/Vienna/_workitems/edit/1971490/ # assert registry_entity.name == name # TODO Local workspace obj doesn't record name besides pushing up to super class. Should we? # assert registry_entity.id == id # TODO Local workspace obj doesn't record id. Should we? @@ -128,7 +131,7 @@ def test_registry_load_from_dict(self): "name": name, "location": loc_1, "description": description, - "tags": tags, + "tags": exterior_tags, "public_network_access": pna, "replication_locations": [{"location": loc_1, "storage_config": [storage_id_1]}], "container_registry": acr_id_1, @@ -138,7 +141,7 @@ def test_registry_load_from_dict(self): assert registry assert registry.location == loc_1 assert registry.description == description - assert registry.tags == tags + assert registry.tags == exterior_tags assert registry.public_network_access == pna assert registry.region_details[0].acr_config[0] == acr_id_1 assert registry.region_details[0].location == loc_1 @@ -149,7 +152,7 @@ def test_registry_load_from_dict_failure_cases(self): pass def test_registry_dictonary_modifier(self): - details = [1, 2, 3] + details = [type("", (), {})()] input1 = {"replication_locations": details} Registry._convert_yaml_dict_to_entity_input(input1) assert input1["region_details"] == details diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index b86b2c6ac8b6..81f913c98d04 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -2,12 +2,13 @@ from unittest.mock import DEFAULT, Mock, call, patch import pytest +from pytest_mock import MockFixture + from azure.ai.ml._scope_dependent_operations import OperationScope from azure.ai.ml.entities._registry.registry import Registry from azure.ai.ml.operations import RegistryOperations from azure.core.exceptions import ResourceExistsError from azure.core.polling import LROPoller -from pytest_mock import MockFixture @pytest.fixture @@ -29,18 +30,13 @@ def mock_registry_operation( class TestRegistryOperation: def test_list(self, mock_registry_operation: RegistryOperations) -> None: mock_registry_operation.list() - mock_registry_operation._operation.list_by_subscription.assert_called_once() + mock_registry_operation._operation.list.assert_called_once() - def test_get(self, mock_registry_operation: RegistryOperations) -> None: - mock_registry_operation.get("random_name") + def test_get(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: + mock_registry_operation.get(randstr()) mock_registry_operation._operation.get.assert_called_once() def test_check_registry_name(self, mock_registry_operation: RegistryOperations): mock_registry_operation._default_registry_name = None with pytest.raises(Exception): mock_registry_operation._check_registry_name(None) - - def test_create(self, mock_registry_operation: RegistryOperations) -> None: - mock_registry_operation.begin_create() - mock_registry_operation._operation.begin_create_or_update.assert_called_once() - diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py index e0a648732810..84e7dcb1814c 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py @@ -37,15 +37,10 @@ def test_deserialize_from_yaml(self) -> None: assert isinstance(detail, RegistryRegionArmDetails) assert detail.location == "EastUS" storages = detail.storage_config - assert len(storages) == 2 - assert ( - storages[0] - == "/subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account" - ) - assert isinstance(storages[1], SystemCreatedStorageAccount) - assert not storages[1].storage_account_hns - assert storages[1].storage_account_type == StorageAccountType.STANDARD_RAGRS + assert isinstance(storages, SystemCreatedStorageAccount) + assert not storages.storage_account_hns + assert storages.storage_account_type == StorageAccountType.STANDARD_RAGRS def test_deserialize_from_yaml_with_system_acr(self) -> None: path = Path("./tests/test_configs/registry/registry_valid_2.yaml") @@ -76,7 +71,7 @@ def test_deserialize_bad_storage_account_type(self) -> None: load_from_dict(RegistrySchema, target, context) assert e_info assert isinstance(e_info._excinfo[1], ValidationError) - assert "Value 'NOT_A_REAL_ACCOUNT_TYPE' passed is not in set" in e_info._excinfo[1].messages[0] + assert "Invalid input type" in e_info._excinfo[1].messages[0] def test_deserialize_bad_arm_resource_id(self) -> None: path = Path("./tests/test_configs/registry/registry_bad_arm_resource_id.yaml") diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml index effd97253039..43215451ee87 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml @@ -10,7 +10,6 @@ intellectual_property_publisher: registry_publisher replication_locations: - location: EastUS storage_config: - - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False + storage_account_hns: False storage_account_type: Standard_RAGRS container_registry: /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.ContainerRegistry/registries/acr_id diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_2.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_2.yaml index 095b73127176..5e4b8b911c90 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_2.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_2.yaml @@ -11,7 +11,5 @@ replication_locations: - location: EastUS storage_config: - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False - storage_account_type: Standard_RAGRS container_registry: acr_account_sku: premium diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_3.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_3.yaml index b853a9d1b19e..6176eefbe123 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_3.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_3.yaml @@ -10,6 +10,5 @@ intellectual_property_publisher: registry_publisher replication_locations: - location: EastUS storage_config: - - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False + storage_account_hns: False storage_account_type: Standard_RAGRS From 5d23dc902056d28ebf12e2015c3c4f96c9eb2fe3 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Mon, 26 Sep 2022 17:20:39 -0400 Subject: [PATCH 09/44] un-hardcode acr and storage configs --- .../azure/ai/ml/_schema/registry/registry.py | 17 +- .../registry/registry_region_arm_details.py | 10 +- .../ai/ml/entities/_registry/registry.py | 10 +- .../_registry/registry_support_classes.py | 161 +++++++++--------- .../ai/ml/operations/_registry_operations.py | 3 +- 5 files changed, 106 insertions(+), 95 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py index 65664ac7788a..1f45c5fcbd35 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py @@ -18,13 +18,10 @@ # Based on 10-01-preview api class RegistrySchema(ResourceSchema): - # Inherits name, id, tag and description fields from ResourceSchema + # Inherits name, id, tags, and description fields from ResourceSchema # Values from RegistryTrackedResource (Client name: Registry) location = fields.Str(required=True) - # identity = ignored - output only - # kind = ignored - output only - # sku = ignored - output only # Values from Registry (Client name: RegistryProperties) public_network_access = StringTransformedEnum( @@ -43,6 +40,12 @@ class RegistrySchema(ResourceSchema): is_strict=True, load_default=SystemCreatedAcrAccount(acr_account_sku=AcrAccountSku.PREMIUM), ) - # managed_resource_group = ignored - output only - # mlflow_registry_uri = ignored - output only - # discovery_url = ignored - output only + + # Values that can only be set by return values from the system, never + # set by the user. + identity = fields.Str(dump_only=True) + kind = fields.Str(dump_only=True) + sku = fields.Str(dump_only=True) + managed_resource_group = fields.Str(dump_only=True) + mlflow_registry_uri = fields.Str(dump_only=True) + discovery_url = fields.Str(dump_only=True) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py index a828682bedd7..e1114af08259 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py @@ -17,13 +17,19 @@ # Differs from the swagger def in that the acr_details can only be supplied as a # single registry-wide instance, rather than a per-region list. class RegistryRegionArmDetailsSchema(metaclass=PatchedSchemaMeta): - acr_config = fields.List( + # Commenting this out for the time being. + # We do not want to surface the acr_config as a per-region configurable + # field. Instead we want to simplify the UX and surface it as a non-list, + # top-level value called 'container_registry'. + # We don't even want to show the per-region acrs when displaying a + # registry to the user, so this isn't even left as a dump-only field. + '''acr_config = fields.List( UnionField( [DumpableStringField(validate=acr_format_validator), NestedField(SystemCreatedAcrAccountSchema)], dump_only=True, is_strict=True, ) - ) + )''' location = fields.Str() storage_config = UnionField( [ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index f3f101aa2b50..d48f5d7db1d1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -154,14 +154,13 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": mlflow_registry_uri=real_registry.ml_flow_registry_uri, region_details=region_details, ) - return result # There are differences between what our registry validation schema # accepts, and how we actually represent things internally. # This is mostly due to the compromise required to balance # the actual shape of registries as they're defined by # autorest with how the spec wanted users to be able to - # configure them + # configure them. @classmethod def _convert_yaml_dict_to_entity_input(cls, input: Dict): # change replication_locations to region_details @@ -180,6 +179,7 @@ def _convert_yaml_dict_to_entity_input(cls, input: Dict): if hasattr(region_detail, "storage_config") and isinstance(region_detail.storage_config, SystemCreatedStorageAccount): region_detail.storage_config = [region_detail.storage_config] + def _to_rest_object(self) -> RestRegistry: """Build current parameterized schedule instance to a registry object before submission. @@ -193,9 +193,11 @@ def _to_rest_object(self) -> RestRegistry: name=self.name, location=self.location, identity=identity, + tags=self.tags, + description=self.description, properties=RegistryProperties( - description=self.description, - tags=self.tags, + #tags=self.tags, interior tags exist due to swagger inheritance + # issues, don't actually use them. public_network_access=self.public_network_access, discovery_url=self.discovery_url, intellectual_property_publisher=self.intellectual_property_publisher, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index b40721409091..f08885e9bbc9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -42,6 +42,42 @@ def __init__( self.acr_account_sku = acr_account_sku self.arm_resource_id = arm_resource_id + # acr should technically be a union between str and SystemCreatedAcrAccount, + # but python doesn't accept self class references apparently. + # Class method instead of normal function to accept possible + # string input. + @classmethod + def _to_rest_object(cls, acr) -> RestAcrDetails: + if hasattr(acr, "acr_account_sku"): + # SKU enum requires input to be a capitalized word. + # Format input to be acceptable as long as spelling is correct. + acr_account_sku = acr.acr_account_sku.capitalize() + return RestAcrDetails( + system_created_acr_account=RestSystemCreatedAcrAccount( + acr_account_sku=acr_account_sku, + ) + ) + else: + return RestAcrDetails( + user_created_acr_account=RestUserCreatedAcrAccount(arm_resource_id=RestArmResourceId(resource_id=acr)) + ) + + + @classmethod + def _from_rest_object(cls, rest_obj: RestAcrDetails) -> "Union[str, SystemCreatedAcrAccount]": + if not rest_obj: + return None + # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. + if hasattr(rest_obj, "system_created_acr_account"): + return SystemCreatedAcrAccount( + acr_account_sku=rest_obj.system_created_acr_account.acr_account_sku, + arm_resource_id=rest_obj.system_created_acr_account.arm_resource_id, + ) + elif hasattr(rest_obj, "user_created_acr_account"): + return rest_obj.user_created_acr_account + else: + return None # TODO should this throw an error instead? + class SystemCreatedStorageAccount: def __init__( @@ -67,6 +103,46 @@ def __init__( self.storage_account_type = storage_account_type + # storage should technically be a union between str and SystemCreatedStorageAccount, + # but python doesn't accept self class references apparently. + # Class method instead of normal function to accept possible + # string input. + @classmethod + def _to_rest_object(cls, storage) -> RestStorageAccountDetails: + if hasattr(storage, "storage_account_type"): + storage_account_type = StorageAccountType( + storage.storage_account_type.lower()) + account = RestSystemCreatedStorageAccount( + storage_account_hns_enabled=storage.storage_account_hns, + storage_account_type=storage_account_type, + ) + return RestStorageAccountDetails(system_created_storage_account=account) + else: + return RestStorageAccountDetails( + user_created_storage_account=RestUserCreatedStorageAccount( + arm_resource_id=RestArmResourceId(resource_id=storage) + ) + ) + + @classmethod + def _from_rest_object(cls, rest_obj: RestStorageAccountDetails) -> "Union[str, SystemCreatedStorageAccount]": + if not rest_obj: + return None + # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. + if rest_obj.system_created_storage_account: + return SystemCreatedStorageAccount( + storage_account_hns=rest_obj.system_created_storage_account.storage_account_hns_enabled, + storage_account_type=StorageAccountType( + rest_obj.system_created_storage_account.storage_account_type.lower() + ), # TODO validate storage account type? + arm_resource_id=rest_obj.system_created_storage_account.arm_resource_id, + ) + elif rest_obj.user_created_storage_account: + return rest_obj.user_created_storage_account + else: + return None # TODO should this throw an error instead? + + # Per-region information for registries. class RegistryRegionArmDetails: def __init__( @@ -101,10 +177,10 @@ def _from_rest_object(cls, rest_obj: RestRegistryRegionArmDetails) -> "RegistryR return None converted_acr_details = [] if rest_obj.acr_details: - converted_acr_details = [convert_rest_acr(acr) for acr in rest_obj.acr_details] + converted_acr_details = [SystemCreatedAcrAccount._from_rest_object(acr) for acr in rest_obj.acr_details] storages = [] if rest_obj.storage_account_details: - storages = [convert_rest_storage(storages) for storages in rest_obj.storage_account_details] + storages = [SystemCreatedStorageAccount._from_rest_object(storages) for storages in rest_obj.storage_account_details] return RegistryRegionArmDetails( acr_config=converted_acr_details, location=rest_obj.location, storage_config=storages ) @@ -112,89 +188,12 @@ def _from_rest_object(cls, rest_obj: RestRegistryRegionArmDetails) -> "RegistryR def _to_rest_object(self) -> RestRegistryRegionArmDetails: converted_acr_details = [] if self.acr_config: - converted_acr_details = [convert_to_rest_acr(acr) for acr in self.acr_config] + converted_acr_details = [SystemCreatedAcrAccount._to_rest_object(acr) for acr in self.acr_config] storages = [] if self.storage_config: - storages = [convert_to_rest_storage(storage) for storage in self.storage_config] + storages = [SystemCreatedStorageAccount._to_rest_object(storage) for storage in self.storage_config] return RestRegistryRegionArmDetails( acr_details=converted_acr_details, location=self.location, storage_account_details=storages, ) - - -def convert_to_rest_acr(acr: Union[str, RestSystemCreatedAcrAccount]) -> RestAcrDetails: - # if not type(acr) is str: - # return RestAcrDetails( - # system_created_storage_account=RestSystemCreatedAcrAccount( - # acr.acr_account_sku, RestArmResourceId(resource_id=acr.arm_resource_id) - # ) - # ) - # else: - # return RestAcrDetails( - # user_created_acr_account=RestUserCreatedAcrAccount(arm_resource_id=RestArmResourceId(resource_id=acr)) - # ) - acr_account = RestAcrDetails( - system_created_acr_account=RestSystemCreatedAcrAccount(acr_account_sku=SkuTier.PREMIUM) - ) - - return acr_account - - -def convert_rest_acr(rest_obj: RestAcrDetails) -> "Union[str, SystemCreatedAcrAccount]": - if not rest_obj: - return None - # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. - if rest_obj.system_created_acr_account: - return SystemCreatedAcrAccount( - acr_account_sku=rest_obj.system_created_acr_account.acr_account_sku, - arm_resource_id=rest_obj.system_created_acr_account.arm_resource_id, - ) - elif rest_obj.user_created_acr_account: - return rest_obj.user_created_acr_account - else: - return None # TODO should this throw an error instead? - - -def convert_to_rest_storage(storage: Union[str, SystemCreatedStorageAccount]) -> RestStorageAccountDetails: - # if not type(storage) is str: - # storage_account_type = StorageAccountType( - # storage.storage_account_type.lower()) - # account = RestSystemCreatedStorageAccount( - # arm_resource_id=RestArmResourceId( - # resource_id=storage.arm_resource_id), - # storage_account_hns_enabled=storage.storage_account_hns, - # storage_account_type=storage_account_type, - # ) - # return RestStorageAccountDetails(system_created_storage_account=account) - # else: - # return RestStorageAccountDetails( - # user_created_storage_account=RestUserCreatedStorageAccount( - # arm_resource_id=RestArmResourceId(resource_id=storage) - # ) - # ) - storage_account = RestStorageAccountDetails( - system_created_storage_account=RestSystemCreatedStorageAccount( - storage_account_hns=False, storage_account_type=RestStorageAccountType.STANDARD_LRS - ) - ) - - return storage_account - - -def convert_rest_storage(rest_obj: RestStorageAccountDetails) -> "Union[str, SystemCreatedStorageAccount]": - if not rest_obj: - return None - # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. - if rest_obj.system_created_storage_account: - return SystemCreatedStorageAccount( - storage_account_hns=rest_obj.system_created_storage_account.storage_account_hns_enabled, - storage_account_type=StorageAccountType( - rest_obj.system_created_storage_account.storage_account_type.lower() - ), # TODO validate storage account type? - arm_resource_id=rest_obj.system_created_storage_account.arm_resource_id, - ) - elif rest_obj.user_created_storage_account: - return rest_obj.user_created_storage_account - else: - return None # TODO should this throw an error instead? diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 53da14cb4fd5..f5d8d68e8e87 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -64,7 +64,7 @@ def list(self) -> Iterable[Registry]: :rtype: ~azure.core.paging.ItemPaged[Registry] """ - return self._operation.list(cls=lambda objs: [Registry._from_rest_object(obj) for obj in objs]) + return self._operation.list(cls=lambda objs: [Registry._from_rest_object(obj) for obj in objs], resource_group_name=self._resource_group_name) @monitor_with_activity(logger, "Registry.Get", ActivityType.PUBLICAPI) def get(self, name: str = None, **kwargs: Dict) -> Registry: @@ -137,6 +137,7 @@ def begin_create( registry_name=registry.name, # type: str body=registry_data, # type: "_models.Registry" polling=self._get_polling(registry.name), + cls=lambda response, deserialized, headers: Registry._from_rest_object(deserialized), ) return poller From be42fef79dce273732b0d19836e7b2a82d09815d Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Tue, 27 Sep 2022 10:26:39 -0400 Subject: [PATCH 10/44] Fix test setup --- .../ai/ml/operations/_registry_operations.py | 1 - .../tests/registry/e2etests/test_registry.py | 7 +++++-- .../unittests/test_registry_operations.py | 18 ++++++++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 3aa705232f63..994230e25115 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -121,7 +121,6 @@ def begin_create( :rtype: LROPoller """ existing_registry = None - resource_group = self._resource_group_name try: existing_registry = self.get(name=registry.name) except Exception: # pylint: disable=broad-except diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py index c8b8c6fd4aaf..f527cb1a4aeb 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -4,16 +4,19 @@ from typing import Callable import pytest - from azure.ai.ml import MLClient, load_registry from azure.ai.ml.constants._common import LROConfigurations from azure.ai.ml.entities._workspace.identity import ManagedServiceIdentityType from azure.core.paging import ItemPaged +from devtools_testutils import AzureRecordedTestCase @pytest.mark.e2etest @pytest.mark.mlc -class TestRegistry: +@pytest.mark.usefixtures( + "recorded_test" +) +class TestRegistry(AzureRecordedTestCase): @pytest.mark.e2etest @pytest.mark.mlc def test_registry_list_and_get( diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index b86b2c6ac8b6..1cd805a1ce25 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -2,6 +2,7 @@ from unittest.mock import DEFAULT, Mock, call, patch import pytest +from azure.ai.ml import load_registry from azure.ai.ml._scope_dependent_operations import OperationScope from azure.ai.ml.entities._registry.registry import Registry from azure.ai.ml.operations import RegistryOperations @@ -40,7 +41,20 @@ def test_check_registry_name(self, mock_registry_operation: RegistryOperations): with pytest.raises(Exception): mock_registry_operation._check_registry_name(None) - def test_create(self, mock_registry_operation: RegistryOperations) -> None: - mock_registry_operation.begin_create() + def test_create(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: + reg_name = f"unittest_{randstr()}" + params_override = [ + { + "name": reg_name + } + ] + reg = load_registry( + source="./tests/test_configs/registry/registry_valid_min.yaml", params_override=params_override + ) + # valid creation of new registry + mock_registry_operation.begin_create(reg) mock_registry_operation._operation.begin_create_or_update.assert_called_once() + # create existing registry - calls GET + mock_registry_operation.begin_create(registry=reg) + mock_registry_operation._operation.begin_create_or_update.assert_not_called() From 42b964c2d5ab931837a5bb54afe57e8043a4e7dc Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Tue, 27 Sep 2022 10:55:42 -0400 Subject: [PATCH 11/44] spelling corrections --- .../ai/ml/_schema/registry/registry_region_arm_details.py | 4 ++-- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py index e1114af08259..a377f8a14c85 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py @@ -19,9 +19,9 @@ class RegistryRegionArmDetailsSchema(metaclass=PatchedSchemaMeta): # Commenting this out for the time being. # We do not want to surface the acr_config as a per-region configurable - # field. Instead we want to simplify the UX and surface it as a non-list, + # field. Instead we want to simplify the UX and surface it as a non-list, # top-level value called 'container_registry'. - # We don't even want to show the per-region acrs when displaying a + # We don't even want to show the per-region acr accounts when displaying a # registry to the user, so this isn't even left as a dump-only field. '''acr_config = fields.List( UnionField( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index d48f5d7db1d1..0be197bf59bc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -91,7 +91,7 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]]) -> None: def _to_dict(self) -> Dict: # pylint: disable=no-member schema = RegistrySchema(context={BASE_PATH_CONTEXT_KEY: "./"}) - # Change name of region_details to user-shown anme + # Change name of region_details to user-shown name self.replication_locations = self.region_details # Grab the first acr account of the first region and set that # as the system-wide container registry. From 9a2e95092548016444ff43ea024a71d6424d39c2 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Tue, 27 Sep 2022 11:21:19 -0400 Subject: [PATCH 12/44] correct invalid syntax --- .../azure/ai/ml/operations/_registry_operations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 38d376983e31..7f7ce70fad61 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -132,9 +132,9 @@ def begin_create( registry_data = registry._to_rest_object() poller = self._operation.begin_create_or_update( - resource_group_name=self._resource_group_name, # type: str - registry_name=registry.name, # type: str - body=registry_data, # type: "_models.Registry" + resource_group_name=self._resource_group_name. + registry_name=registry.name, + body=registry_data, polling=self._get_polling(registry.name), cls=lambda response, deserialized, headers: Registry._from_rest_object(deserialized), ) From 2c71cbc014288a9b73d1ca444c1ad8a33940dd0d Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Tue, 27 Sep 2022 11:44:35 -0400 Subject: [PATCH 13/44] more syntax corrections --- .../azure/ai/ml/operations/_registry_operations.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 7f7ce70fad61..3e7b465285d3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -17,8 +17,6 @@ ValidationException) from azure.core.credentials import TokenCredential from azure.core.polling import LROPoller -from azure.mgmt.msi._managed_service_identity_client import \ - ManagedServiceIdentityClient from .._utils._azureml_polling import AzureMLPolling from ..constants._common import LROConfigurations @@ -132,7 +130,7 @@ def begin_create( registry_data = registry._to_rest_object() poller = self._operation.begin_create_or_update( - resource_group_name=self._resource_group_name. + resource_group_name=self._resource_group_name, registry_name=registry.name, body=registry_data, polling=self._get_polling(registry.name), From 7b842eca7651892101232616ca10fd1085c7200b Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Tue, 27 Sep 2022 12:47:01 -0400 Subject: [PATCH 14/44] more robust conditionals in to/from rest functions --- .../ai/ml/entities/_registry/registry_support_classes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index f08885e9bbc9..1828b82eeff5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -48,7 +48,7 @@ def __init__( # string input. @classmethod def _to_rest_object(cls, acr) -> RestAcrDetails: - if hasattr(acr, "acr_account_sku"): + if hasattr(acr, "acr_account_sku") and acr.acr_account_sku is not None: # SKU enum requires input to be a capitalized word. # Format input to be acceptable as long as spelling is correct. acr_account_sku = acr.acr_account_sku.capitalize() @@ -68,12 +68,12 @@ def _from_rest_object(cls, rest_obj: RestAcrDetails) -> "Union[str, SystemCreate if not rest_obj: return None # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. - if hasattr(rest_obj, "system_created_acr_account"): + if hasattr(rest_obj, "system_created_acr_account") and rest_obj.system_created_acr_account is not None: return SystemCreatedAcrAccount( acr_account_sku=rest_obj.system_created_acr_account.acr_account_sku, arm_resource_id=rest_obj.system_created_acr_account.arm_resource_id, ) - elif hasattr(rest_obj, "user_created_acr_account"): + elif hasattr(rest_obj, "user_created_acr_account") and rest_obj.user_created_acr_account is not None: return rest_obj.user_created_acr_account else: return None # TODO should this throw an error instead? @@ -109,7 +109,7 @@ def __init__( # string input. @classmethod def _to_rest_object(cls, storage) -> RestStorageAccountDetails: - if hasattr(storage, "storage_account_type"): + if hasattr(storage, "storage_account_type") and storage.storage_account_type is not None: storage_account_type = StorageAccountType( storage.storage_account_type.lower()) account = RestSystemCreatedStorageAccount( From 06cb64ca189c3d3106d5c269fa81ef1573203d93 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Tue, 27 Sep 2022 19:11:23 -0400 Subject: [PATCH 15/44] Add recording files. --- .../test_registry.pyTestRegistrytest_registry_list_and_get.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json new file mode 100644 index 000000000000..e69de29bb2d1 From 62a201adeaa15efc1c96f37792b0671ff23c33e5 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Tue, 27 Sep 2022 20:24:40 -0400 Subject: [PATCH 16/44] Set e2e test to use recording. --- .../azure-ai-ml/tests/registry/e2etests/test_registry.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py index f527cb1a4aeb..8d5353b395cc 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -8,17 +8,13 @@ from azure.ai.ml.constants._common import LROConfigurations from azure.ai.ml.entities._workspace.identity import ManagedServiceIdentityType from azure.core.paging import ItemPaged -from devtools_testutils import AzureRecordedTestCase +from devtools_testutils import AzureRecordedTestCase, recorded_by_proxy @pytest.mark.e2etest -@pytest.mark.mlc -@pytest.mark.usefixtures( - "recorded_test" -) class TestRegistry(AzureRecordedTestCase): @pytest.mark.e2etest - @pytest.mark.mlc + @recorded_by_proxy def test_registry_list_and_get( self, crud_registry_client: MLClient, From 73cc8d165c91b769e5f7c5a383e19aafa980ff36 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Wed, 28 Sep 2022 11:36:11 -0400 Subject: [PATCH 17/44] remove unused import --- .../azure/ai/ml/entities/_registry/registry_support_classes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 1828b82eeff5..3709af4fc155 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -7,7 +7,6 @@ from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails as RestAcrDetails from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId as RestArmResourceId from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryRegionArmDetails as RestRegistryRegionArmDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import SkuTier from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountDetails as RestStorageAccountDetails from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountType as RestStorageAccountType from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount as RestSystemCreatedAcrAccount From 7d831d29fe0f97907a8fb7f1c46cbf4803126844 Mon Sep 17 00:00:00 2001 From: gfitzgerald42 <55882575+gfitzgerald42@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:02:30 -0400 Subject: [PATCH 18/44] Apply suggestions from code review Co-authored-by: Neehar Duvvuri <40341266+needuv@users.noreply.github.com> --- sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py index 8d5353b395cc..2718486753fc 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -12,15 +12,15 @@ @pytest.mark.e2etest +@pytest.mark.usefixtures("recorded_test") class TestRegistry(AzureRecordedTestCase): @pytest.mark.e2etest - @recorded_by_proxy def test_registry_list_and_get( self, crud_registry_client: MLClient, randstr: Callable[[], str], ) -> None: - reg_name = f"e2etest_{randstr()}" + reg_name = f"e2etest_{randstr("reg_name")}" params_override = [ { "name": reg_name, From ddec867ebf59de68df1d924c2d808b9b43cba996 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Wed, 28 Sep 2022 12:41:23 -0400 Subject: [PATCH 19/44] display identity and sub-resource ids properly --- .../ai/ml/_schema/registry/arm_resource_id.py | 26 +++++++++++++++++++ .../azure/ai/ml/_schema/registry/registry.py | 3 ++- .../registry/registry_region_arm_details.py | 2 +- .../registry/system_created_acr_account.py | 14 +++++++--- .../system_created_storage_account.py | 14 +++++++--- .../azure/ai/ml/_schema/registry/util.py | 8 ++++++ .../ai/ml/entities/_registry/registry.py | 8 ++++-- 7 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py new file mode 100644 index 000000000000..f11c26b8bab0 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py @@ -0,0 +1,26 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +from marshmallow import ValidationError, fields, post_load, pre_dump + +from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta + + +class ArmResourceIdSchema(metaclass=PatchedSchemaMeta): + resource_id = fields.Str() + + @post_load + def make(self, data, **kwargs): + from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId + + data.pop("type", None) + return ArmResourceId(**data) + + @pre_dump + def predump(self, data, **kwargs): + from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId + + if not isinstance(data, ArmResourceId): + raise ValidationError("Cannot dump non-ArmResourceId object into ArmResourceId") + return data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py index 1f45c5fcbd35..3f4ad11725fb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py @@ -11,6 +11,7 @@ from azure.ai.ml.constants._registry import AcrAccountSku from azure.ai.ml.entities._registry.registry_support_classes import SystemCreatedAcrAccount +from azure.ai.ml._schema.workspace.identity import IdentitySchema from .registry_region_arm_details import RegistryRegionArmDetailsSchema from .system_created_acr_account import SystemCreatedAcrAccountSchema from .util import acr_format_validator @@ -43,7 +44,7 @@ class RegistrySchema(ResourceSchema): # Values that can only be set by return values from the system, never # set by the user. - identity = fields.Str(dump_only=True) + identity = NestedField(IdentitySchema, dump_only=True) kind = fields.Str(dump_only=True) sku = fields.Str(dump_only=True) managed_resource_group = fields.Str(dump_only=True) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py index a377f8a14c85..2adc49350adb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py @@ -11,7 +11,7 @@ from .system_created_acr_account import SystemCreatedAcrAccountSchema from .system_created_storage_account import SystemCreatedStorageAccountSchema -from .util import acr_format_validator, storage_account_validator +from .util import storage_account_validator # Differs from the swagger def in that the acr_details can only be supplied as a diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py index c0b6dee9693a..84fc2337780e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py @@ -2,15 +2,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from marshmallow import ValidationError, fields, post_load, pre_dump +from curses.has_key import has_key +from marshmallow import ValidationError, fields, post_load, pre_dump, post_dump -from azure.ai.ml._schema import StringTransformedEnum +from azure.ai.ml._schema import StringTransformedEnum, NestedField from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta from azure.ai.ml.constants._registry import AcrAccountSku +from .arm_resource_id import ArmResourceIdSchema +from .util import convert_arm_resource_id class SystemCreatedAcrAccountSchema(metaclass=PatchedSchemaMeta): - arm_resource_id = fields.Str(dump_only=True) + arm_resource_id = NestedField(ArmResourceIdSchema, dump_only=True) acr_account_sku = StringTransformedEnum( allowed_values=[sku.value for sku in AcrAccountSku], casing_transform=lambda x: x.lower() ) @@ -29,3 +32,8 @@ def predump(self, data, **kwargs): if not isinstance(data, SystemCreatedAcrAccount): raise ValidationError("Cannot dump non-SystemCreatedAcrAccount object into SystemCreatedAcrAccountSchema") return data + + @post_dump + def postdump(self, data, **kwargs): + convert_arm_resource_id(data) + return data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py index 762d2cd8d01d..99a0e9296d55 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py @@ -2,15 +2,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from marshmallow import ValidationError, fields, post_load, pre_dump +from marshmallow import ValidationError, fields, post_load, pre_dump, post_dump -from azure.ai.ml._schema import StringTransformedEnum +from azure.ai.ml._schema import StringTransformedEnum, NestedField from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta from azure.ai.ml.constants._registry import StorageAccountType - +from .arm_resource_id import ArmResourceIdSchema +from .util import convert_arm_resource_id class SystemCreatedStorageAccountSchema(metaclass=PatchedSchemaMeta): - arm_resource_id = fields.Str(dump_only=True) + arm_resource_id = NestedField(ArmResourceIdSchema, dump_only=True) storage_account_hns = fields.Bool() storage_account_type = StringTransformedEnum( allowed_values=[accountType.value for accountType in StorageAccountType], casing_transform=lambda x: x.lower() @@ -32,3 +33,8 @@ def predump(self, data, **kwargs): "Cannot dump non-SystemCreatedStorageAccount object into SystemCreatedStorageAccountSchema" ) return data + + @post_dump + def postdump(self, data, **kwargs): + convert_arm_resource_id(data) + return data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/util.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/util.py index 19c01e9a5633..7af84d4ddab8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/util.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/util.py @@ -4,6 +4,7 @@ # Simple helper methods to avoid re-using lambda's everywhere +from typing import OrderedDict from azure.ai.ml.constants._registry import ACR_ACCOUNT_FORMAT, STORAGE_ACCOUNT_FORMAT @@ -13,3 +14,10 @@ def storage_account_validator(storage_id: str): def acr_format_validator(acr_id: str): return ACR_ACCOUNT_FORMAT.match(acr_id) is not None + + +#Display resource id as string, rather than as object with sub-fields. +def convert_arm_resource_id(data: OrderedDict): + if "arm_resource_id" in data and "resource_id" in data["arm_resource_id"]: + data["arm_resource_id"] = data["arm_resource_id"]["resource_id"] + return data \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index 0be197bf59bc..5bf136564ec6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -91,14 +91,18 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]]) -> None: def _to_dict(self) -> Dict: # pylint: disable=no-member schema = RegistrySchema(context={BASE_PATH_CONTEXT_KEY: "./"}) - # Change name of region_details to user-shown name + + # Change name of region_details to user-shown name 'replication_locations' self.replication_locations = self.region_details + # Grab the first acr account of the first region and set that # as the system-wide container registry. if self.replication_locations and len(self.replication_locations) > 0: if self.replication_locations[0].acr_config and len(self.replication_locations[0].acr_config) > 0: self.container_registry = self.replication_locations[0].acr_config[0] - # Change single-list managed storage accounts to not be lists + + # Change single-list managed storage accounts to not be lists. + # (Since users enter managed storage accounts as non-list singletons) for region_detail in self.replication_locations: if region_detail.storage_config and isinstance( region_detail.storage_config[0], SystemCreatedStorageAccount From 0486f5f3b3e4dfc4c739a8c52950b742e4d42c1d Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Wed, 28 Sep 2022 14:00:08 -0400 Subject: [PATCH 20/44] Code review changes. --- ...estRegistrytest_registry_list_and_get.json | 559 ++++++++++++++++++ .../tests/registry/e2etests/test_registry.py | 2 +- 2 files changed, 560 insertions(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json index e69de29bb2d1..5a17f98714d2 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json @@ -0,0 +1,559 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "247", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:48:30 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "dcdd0723-ff84-4a5d-be8e-f43be387e55c", + "x-ms-failure-cause": "gateway", + "x-ms-routing-request-id": "CANADAEAST:20220928T174831Z:dcdd0723-ff84-4a5d-be8e-f43be387e55c" + }, + "ResponseBody": { + "error": { + "code": "ResourceNotFound", + "message": "The Resource \u0027Microsoft.MachineLearningServices/registries/e2etest_test_364305071722\u0027 under resource group \u002700000\u0027 was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722?api-version=2022-10-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Content-Length": "444", + "Content-Type": "application/json", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": { + "location": "WestCentralUS", + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "description": "This is a registry description", + "tags": {}, + "regionDetails": [ + { + "acrDetails": [ + { + "systemCreatedAcrAccount": { + "acrAccountSku": "Premium" + } + } + ], + "location": "WestCentralUS", + "storageAccountDetails": [ + { + "systemCreatedStorageAccount": { + "storageAccountType": "Standard_LRS" + } + }, + { + "systemCreatedStorageAccount": { + "storageAccountType": "Standard_LRS" + } + } + ] + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Wed, 28 Sep 2022 17:48:33 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=location", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "cac5fbe1-f588-4f3b-a3ad-d4210ba0862b", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174834Z:cac5fbe1-f588-4f3b-a3ad-d4210ba0862b", + "x-request-time": "0.168" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:48:38 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "9570b149-65f6-47bc-9d05-401d23b8873b", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174839Z:9570b149-65f6-47bc-9d05-401d23b8873b", + "x-request-time": "0.040" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:48:43 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "49d86177-3f98-4d60-aa85-18c6a3580197", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174844Z:49d86177-3f98-4d60-aa85-18c6a3580197", + "x-request-time": "0.152" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:48:49 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "f53cd59e-75ed-4e3b-95f7-5a834009f4e5", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174849Z:f53cd59e-75ed-4e3b-95f7-5a834009f4e5", + "x-request-time": "0.049" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:48:54 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "f097956b-acef-4cb4-a3e9-00e45dc5061b", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174854Z:f097956b-acef-4cb4-a3e9-00e45dc5061b", + "x-request-time": "0.043" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:48:59 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "8447d9f1-ec67-4887-9e2f-fd7940af2cdb", + "x-ms-ratelimit-remaining-subscription-reads": "11994", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174900Z:8447d9f1-ec67-4887-9e2f-fd7940af2cdb", + "x-request-time": "0.045" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:49:04 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "6cb59b53-2e23-4ee1-b160-72f504d58888", + "x-ms-ratelimit-remaining-subscription-reads": "11993", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174905Z:6cb59b53-2e23-4ee1-b160-72f504d58888", + "x-request-time": "0.043" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:49:10 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "856ad28b-59d8-45b2-9bfd-41b419280fba", + "x-ms-ratelimit-remaining-subscription-reads": "11992", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174910Z:856ad28b-59d8-45b2-9bfd-41b419280fba", + "x-request-time": "0.043" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:49:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "49be8491-1c10-4846-8050-5468940aa93f", + "x-ms-ratelimit-remaining-subscription-reads": "11991", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174915Z:49be8491-1c10-4846-8050-5468940aa93f", + "x-request-time": "0.074" + }, + "ResponseBody": { + "status": "Succeeded", + "percentComplete": 100.0 + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:49:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": [ + "Accept-Encoding", + "Accept-Encoding" + ], + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "285a4a06-3cfd-451a-81db-c0d4df0a155e", + "x-ms-ratelimit-remaining-subscription-reads": "11990", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174915Z:285a4a06-3cfd-451a-81db-c0d4df0a155e", + "x-request-time": "0.019" + }, + "ResponseBody": { + "tags": {}, + "location": "westcentralus", + "identity": { + "type": "SystemAssigned", + "principalId": "7509f540-dda0-48da-ad80-7c414fc4c2cc", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722", + "name": "e2etest_test_364305071722", + "type": "Microsoft.MachineLearningServices/registries", + "properties": { + "regionDetails": [ + { + "location": "westcentralus", + "storageAccountDetails": [ + { + "existingStorageAccount": null, + "newStorageAccount": null, + "userCreatedStorageAccount": null, + "systemCreatedStorageAccount": { + "storageAccountName": "e2ete6428ca01762a40c9a52", + "storageAccountType": "Standard_LRS", + "storageAccountHnsEnabled": false, + "armResourceId": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5/providers/Microsoft.Storage/storageAccounts/e2ete6428ca01762a40c9a52" + } + } + } + ], + "acrDetails": [ + { + "existingAcrAccount": null, + "newAcrAccount": null, + "userCreatedAcrAccount": null, + "systemCreatedAcrAccount": { + "acrAccountName": "e2ete5f4e409990d64ad8b3a", + "acrAccountSku": "Premium", + "armResourceId": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5/providers/Microsoft.ContainerRegistry/registries/e2ete5f4e409990d64ad8b3a" + } + } + } + ] + } + ], + "intellectualPropertyPublisher": null, + "publicNetworkAccess": "Enabled", + "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etest_test_364305071722/discovery", + "managedResourceGroup": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5" + }, + "managedResourceGroupTags": {}, + "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722" + }, + "systemData": null + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 17:49:15 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": [ + "Accept-Encoding", + "Accept-Encoding" + ], + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "ee252b7a-71b1-4670-b1d1-3fcc63864243", + "x-ms-ratelimit-remaining-subscription-reads": "11989", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T174916Z:ee252b7a-71b1-4670-b1d1-3fcc63864243", + "x-request-time": "0.020" + }, + "ResponseBody": { + "tags": {}, + "location": "westcentralus", + "identity": { + "type": "SystemAssigned", + "principalId": "7509f540-dda0-48da-ad80-7c414fc4c2cc", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722", + "name": "e2etest_test_364305071722", + "type": "Microsoft.MachineLearningServices/registries", + "properties": { + "regionDetails": [ + { + "location": "westcentralus", + "storageAccountDetails": [ + { + "existingStorageAccount": null, + "newStorageAccount": null, + "userCreatedStorageAccount": null, + "systemCreatedStorageAccount": { + "storageAccountName": "e2ete6428ca01762a40c9a52", + "storageAccountType": "Standard_LRS", + "storageAccountHnsEnabled": false, + "armResourceId": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5/providers/Microsoft.Storage/storageAccounts/e2ete6428ca01762a40c9a52" + } + } + } + ], + "acrDetails": [ + { + "existingAcrAccount": null, + "newAcrAccount": null, + "userCreatedAcrAccount": null, + "systemCreatedAcrAccount": { + "acrAccountName": "e2ete5f4e409990d64ad8b3a", + "acrAccountSku": "Premium", + "armResourceId": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5/providers/Microsoft.ContainerRegistry/registries/e2ete5f4e409990d64ad8b3a" + } + } + } + ] + } + ], + "intellectualPropertyPublisher": null, + "publicNetworkAccess": "Enabled", + "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etest_test_364305071722/discovery", + "managedResourceGroup": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5" + }, + "managedResourceGroupTags": {}, + "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722" + }, + "systemData": null + } + } + ], + "Variables": { + "reg_name": "test_364305071722" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py index 2718486753fc..e94d944768f2 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -20,7 +20,7 @@ def test_registry_list_and_get( crud_registry_client: MLClient, randstr: Callable[[], str], ) -> None: - reg_name = f"e2etest_{randstr("reg_name")}" + reg_name = f"e2etest_{randstr('reg_name')}" params_override = [ { "name": reg_name, From 5159cc99e3b4200944461a5c56c516520ab96f68 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Wed, 28 Sep 2022 14:16:50 -0400 Subject: [PATCH 21/44] Code review edits. --- .../tests/registry/unittests/test_registry_operations.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index d7dac0b02258..7f7dd1d54137 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -23,7 +23,6 @@ def mock_registry_operation( ) -@pytest.mark.unittest class TestRegistryOperation: def test_list(self, mock_registry_operation: RegistryOperations) -> None: mock_registry_operation.list() @@ -39,7 +38,7 @@ def test_check_registry_name(self, mock_registry_operation: RegistryOperations): mock_registry_operation._check_registry_name(None) def test_create(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: - reg_name = f"unittest_{randstr()}" + reg_name = f"unittest_{randstr('reg_name')}" params_override = [ { "name": reg_name From a442057cb54353521e1107b0dcc020c6c7d3f5c5 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Wed, 28 Sep 2022 15:10:38 -0400 Subject: [PATCH 22/44] Test migrate to git logic. --- .../ai/ml/operations/_registry_operations.py | 13 +- sdk/ml/azure-ai-ml/tests/conftest.py | 139 +++++++++++------- 2 files changed, 89 insertions(+), 63 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 99918846e013..d6ec6f5c9ff0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -119,23 +119,14 @@ def begin_create( :return: A poller to track the operation status. :rtype: LROPoller """ - existing_registry = None - try: - existing_registry = self.get(name=registry.name) - except Exception: # pylint: disable=broad-except - pass - - if existing_registry: - # for now return existing registries until UPDATE is implemented - return existing_registry - registry_data = registry._to_rest_object() poller = self._operation.begin_create_or_update( resource_group_name=self._resource_group_name, registry_name=registry.name, body=registry_data, polling=self._get_polling(registry.name), - cls=lambda response, deserialized, headers: Registry._from_rest_object(deserialized), + cls=lambda response, deserialized, headers: Registry._from_rest_object( + deserialized), ) return poller diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index a7f074129b29..96f79a8c3cff 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -10,36 +10,37 @@ from unittest.mock import Mock import pytest -from pytest_mock import MockFixture -from test_utilities.constants import Test_Registry_Name, Test_Resource_Group, Test_Subscription, Test_Workspace_Name - from azure.ai.ml import MLClient, load_component, load_job -from azure.ai.ml._restclient.registry_discovery import AzureMachineLearningWorkspaces as ServiceClientRegistryDiscovery -from azure.ai.ml._scope_dependent_operations import OperationScope, OperationConfig +from azure.ai.ml._restclient.registry_discovery import \ + AzureMachineLearningWorkspaces as ServiceClientRegistryDiscovery +from azure.ai.ml._scope_dependent_operations import (OperationConfig, + OperationScope) from azure.ai.ml._utils._asset_utils import get_object_hash from azure.ai.ml._utils.utils import hash_dict from azure.ai.ml.constants._common import GitProperties from azure.ai.ml.entities import AzureBlobDatastore, Component from azure.ai.ml.entities._assets import Data, Model -from azure.ai.ml.entities._component.parallel_component import ParallelComponent +from azure.ai.ml.entities._component.parallel_component import \ + ParallelComponent from azure.ai.ml.entities._datastore.credentials import NoneCredentials from azure.ai.ml.entities._job.job_name_generator import generate_job_name from azure.ai.ml.operations._run_history_constants import RunHistoryConstants from azure.core.exceptions import ResourceNotFoundError -from azure.identity import ClientSecretCredential, DefaultAzureCredential, AzureCliCredential - -from devtools_testutils import ( - test_proxy, - is_live, - add_general_string_sanitizer, - add_body_key_sanitizer, - add_remove_header_sanitizer, - set_custom_default_matcher, - add_general_regex_sanitizer, -) -from devtools_testutils.proxy_fixtures import VariableRecorder, variable_recorder +from azure.identity import (AzureCliCredential, ClientSecretCredential, + DefaultAzureCredential) +from devtools_testutils import (add_body_key_sanitizer, + add_general_regex_sanitizer, + add_general_string_sanitizer, + add_remove_header_sanitizer, is_live, + set_custom_default_matcher, test_proxy) from devtools_testutils.fake_credentials import FakeTokenCredential from devtools_testutils.helpers import is_live_and_not_recording +from devtools_testutils.proxy_fixtures import (VariableRecorder, + variable_recorder) +from pytest_mock import MockFixture + +from test_utilities.constants import (Test_Registry_Name, Test_Resource_Group, + Test_Subscription, Test_Workspace_Name) E2E_TEST_LOGGING_ENABLED = "E2E_TEST_LOGGING_ENABLED" test_folder = Path(os.path.abspath(__file__)).parent.absolute() @@ -60,19 +61,30 @@ def fake_datastore_key() -> str: @pytest.fixture(autouse=True) def add_sanitizers(test_proxy, fake_datastore_key): add_remove_header_sanitizer(headers="x-azureml-token,Log-URL") - set_custom_default_matcher(excluded_headers="x-ms-meta-name,x-ms-meta-version") + set_custom_default_matcher( + excluded_headers="x-ms-meta-name,x-ms-meta-version") add_body_key_sanitizer(json_path="$.key", value=fake_datastore_key) add_body_key_sanitizer(json_path="$....key", value=fake_datastore_key) - add_body_key_sanitizer(json_path="$.properties.properties.['mlflow.source.git.repoURL']", value="fake_git_url") - add_body_key_sanitizer(json_path="$.properties.properties.['mlflow.source.git.branch']", value="fake_git_branch") - add_body_key_sanitizer(json_path="$.properties.properties.['mlflow.source.git.commit']", value="fake_git_commit") - add_body_key_sanitizer(json_path="$.properties.properties.hash_sha256", value="0000000000000") - add_body_key_sanitizer(json_path="$.properties.properties.hash_version", value="0000000000000") - add_body_key_sanitizer(json_path="$.properties.properties.['azureml.git.dirty']", value="fake_git_dirty_value") - add_general_regex_sanitizer(value="", regex=f"\\u0026tid={os.environ.get('ML_TENANT_ID')}") - add_general_string_sanitizer(value="", target=f"&tid={os.environ.get('ML_TENANT_ID')}") - add_general_regex_sanitizer(value="00000000000000000000000000000000", regex="\\/LocalUpload\\/(\\S{32})\\/?", group_for_replace="1") - add_general_regex_sanitizer(value="00000000000000000000000000000000", regex="\\/az-ml-artifacts\\/(\\S{32})\\/", group_for_replace="1") + add_body_key_sanitizer( + json_path="$.properties.properties.['mlflow.source.git.repoURL']", value="fake_git_url") + add_body_key_sanitizer( + json_path="$.properties.properties.['mlflow.source.git.branch']", value="fake_git_branch") + add_body_key_sanitizer( + json_path="$.properties.properties.['mlflow.source.git.commit']", value="fake_git_commit") + add_body_key_sanitizer( + json_path="$.properties.properties.hash_sha256", value="0000000000000") + add_body_key_sanitizer( + json_path="$.properties.properties.hash_version", value="0000000000000") + add_body_key_sanitizer( + json_path="$.properties.properties.['azureml.git.dirty']", value="fake_git_dirty_value") + add_general_regex_sanitizer( + value="", regex=f"\\u0026tid={os.environ.get('ML_TENANT_ID')}") + add_general_string_sanitizer( + value="", target=f"&tid={os.environ.get('ML_TENANT_ID')}") + add_general_regex_sanitizer(value="00000000000000000000000000000000", + regex="\\/LocalUpload\\/(\\S{32})\\/?", group_for_replace="1") + add_general_regex_sanitizer(value="00000000000000000000000000000000", + regex="\\/az-ml-artifacts\\/(\\S{32})\\/", group_for_replace="1") def pytest_addoption(parser): @@ -95,10 +107,12 @@ def mock_workspace_scope() -> OperationScope: subscription_id=Test_Subscription, resource_group_name=Test_Resource_Group, workspace_name=Test_Workspace_Name ) + @pytest.fixture def mock_operation_config() -> OperationConfig: yield OperationConfig(True) + @pytest.fixture def sanitized_environment_variables(environment_variables, fake_datastore_key) -> dict: sanitizings = { @@ -125,7 +139,8 @@ def mock_registry_scope() -> OperationScope: @pytest.fixture def mock_machinelearning_client(mocker: MockFixture) -> MLClient: # TODO(1628638): remove when 2022_02 api is available in ARM - mocker.patch("azure.ai.ml.operations.JobOperations._get_workspace_url", return_value="xxx") + mocker.patch( + "azure.ai.ml.operations.JobOperations._get_workspace_url", return_value="xxx") yield MLClient( credential=Mock(spec_set=DefaultAzureCredential), subscription_id=Test_Subscription, @@ -250,10 +265,10 @@ def only_registry_client(e2e_ws_scope: OperationScope, auth: ClientSecretCredent @pytest.fixture -def crud_registry_client(e2e_ws_scope: OperationScope) -> MLClient: +def crud_registry_client(e2e_ws_scope: OperationScope, auth: ClientSecretCredential) -> MLClient: """return a machine learning client using default e2e testing workspace""" return MLClient( - credential=get_auth(), + credential=auth, subscription_id=e2e_ws_scope.subscription_id, resource_group_name=e2e_ws_scope.resource_group_name, logging_enable=getenv(E2E_TEST_LOGGING_ENABLED), @@ -290,7 +305,8 @@ def data_with_2_versions(client: MLClient) -> str: @pytest.fixture def batch_endpoint_model(client: MLClient) -> Model: name = "sklearn_regression_model" - model = Model(name=name, version="1", path="tests/test_configs/batch_setup/batch_endpoint_model") + model = Model(name=name, version="1", + path="tests/test_configs/batch_setup/batch_endpoint_model") try: model = client.models.get(name, "1") @@ -316,7 +332,8 @@ def light_gbm_model(client: MLClient) -> Model: job = client.jobs.create_or_update(job) job_status = job.status while job_status not in RunHistoryConstants.TERMINAL_STATUSES: - print(f"Job status is {job_status}, waiting for 30 seconds for the job to finish.") + print( + f"Job status is {job_status}, waiting for 30 seconds for the job to finish.") time.sleep(30) job_status = client.jobs.get(job_name).status @@ -346,21 +363,24 @@ def batch_inference(client: MLClient) -> ParallelComponent: @pytest.fixture def pipeline_samples_e2e_registered_train_components(client: MLClient) -> Component: return _load_or_create_component( - client, path=test_folder / "./test_configs/dsl_pipeline/e2e_registered_components/train.yml" + client, path=test_folder / + "./test_configs/dsl_pipeline/e2e_registered_components/train.yml" ) @pytest.fixture def pipeline_samples_e2e_registered_score_components(client: MLClient) -> Component: return _load_or_create_component( - client, path=test_folder / "./test_configs/dsl_pipeline/e2e_registered_components/score.yml" + client, path=test_folder / + "./test_configs/dsl_pipeline/e2e_registered_components/score.yml" ) @pytest.fixture def pipeline_samples_e2e_registered_eval_components(client: MLClient) -> Component: return _load_or_create_component( - client, path=test_folder / "./test_configs/dsl_pipeline/e2e_registered_components/eval.yml" + client, path=test_folder / + "./test_configs/dsl_pipeline/e2e_registered_components/eval.yml" ) @@ -371,9 +391,11 @@ def generate_hash(): return str(uuid.uuid4()) if is_live_and_not_recording(): - mocker.patch("azure.ai.ml._artifacts._artifact_utilities.get_object_hash", side_effect=generate_hash) + mocker.patch( + "azure.ai.ml._artifacts._artifact_utilities.get_object_hash", side_effect=generate_hash) elif not is_live(): - mocker.patch("azure.ai.ml._artifacts._artifact_utilities.get_object_hash", return_value="00000000000000000000000000000000") + mocker.patch("azure.ai.ml._artifacts._artifact_utilities.get_object_hash", + return_value="00000000000000000000000000000000") @pytest.fixture @@ -386,9 +408,11 @@ def generate_uuid(*args, **kwargs): return real_uuid if is_live(): - mocker.patch("azure.ai.ml.entities._assets.asset._get_random_name", side_effect=generate_uuid) + mocker.patch( + "azure.ai.ml.entities._assets.asset._get_random_name", side_effect=generate_uuid) else: - mocker.patch("azure.ai.ml.entities._assets.asset._get_random_name", return_value=fake_uuid) + mocker.patch( + "azure.ai.ml.entities._assets.asset._get_random_name", return_value=fake_uuid) @pytest.fixture @@ -397,13 +421,16 @@ def mock_component_hash(mocker: MockFixture): def generate_compononent_hash(*args, **kwargs): dict_hash = hash_dict(*args, **kwargs) - add_general_string_sanitizer(value=fake_component_hash, target=dict_hash) + add_general_string_sanitizer( + value=fake_component_hash, target=dict_hash) return dict_hash if is_live(): - mocker.patch("azure.ai.ml.entities._component.component.hash_dict", side_effect=generate_compononent_hash) + mocker.patch("azure.ai.ml.entities._component.component.hash_dict", + side_effect=generate_compononent_hash) else: - mocker.patch("azure.ai.ml.entities._component.component.hash_dict", return_value=fake_component_hash) + mocker.patch("azure.ai.ml.entities._component.component.hash_dict", + return_value=fake_component_hash) @pytest.fixture @@ -421,7 +448,8 @@ def generate_mock_workspace_deployment_name(name: str): @pytest.fixture def mock_workspace_dependent_resource_name_generator(mocker: MockFixture, variable_recorder: VariableRecorder): def generate_mock_workspace_dependent_resource_name(workspace_name: str, resource_type: str): - deployment_name = get_name_for_dependent_resource(workspace_name, resource_type) + deployment_name = get_name_for_dependent_resource( + workspace_name, resource_type) return variable_recorder.get_or_record(f"{resource_type}_name", deployment_name) mocker.patch( @@ -444,7 +472,8 @@ def generate_and_sanitize_job_name(*args, **kwargs): "azure.ai.ml.entities._job.to_rest_functions.generate_job_name", side_effect=generate_and_sanitize_job_name ) else: - mocker.patch("azure.ai.ml.entities._job.to_rest_functions.generate_job_name", return_value=fake_job_name) + mocker.patch("azure.ai.ml.entities._job.to_rest_functions.generate_job_name", + return_value=fake_job_name) def _load_or_create_component(client: MLClient, path: str) -> Component: @@ -496,7 +525,8 @@ def credentialless_datastore(client: MLClient, storage_account_name: str) -> Azu try: credentialless_ds = client.datastores.get(name=ds_name) except ResourceNotFoundError: - ds = AzureBlobDatastore(name=ds_name, account_name=storage_account_name, container_name=container_name) + ds = AzureBlobDatastore( + name=ds_name, account_name=storage_account_name, container_name=container_name) credentialless_ds = client.datastores.create_or_update(ds) assert isinstance(credentialless_ds.credentials, NoneCredentials) @@ -513,24 +543,29 @@ def credentialless_datastore(client: MLClient, storage_account_name: str) -> Azu @pytest.fixture() def enable_pipeline_private_preview_features(mocker: MockFixture): - mocker.patch("azure.ai.ml.entities._job.pipeline.pipeline_job.is_private_preview_enabled", return_value=True) - mocker.patch("azure.ai.ml.dsl._pipeline_component_builder.is_private_preview_enabled", return_value=True) + mocker.patch( + "azure.ai.ml.entities._job.pipeline.pipeline_job.is_private_preview_enabled", return_value=True) + mocker.patch( + "azure.ai.ml.dsl._pipeline_component_builder.is_private_preview_enabled", return_value=True) @pytest.fixture() def enable_environment_id_arm_expansion(mocker: MockFixture): - mocker.patch("azure.ai.ml.operations._operation_orchestrator.is_private_preview_enabled", return_value=False) + mocker.patch( + "azure.ai.ml.operations._operation_orchestrator.is_private_preview_enabled", return_value=False) @pytest.fixture(autouse=True) def remove_git_props(mocker: MockFixture): - mocker.patch("azure.ai.ml.operations._job_operations.get_git_properties", return_value={}) + mocker.patch( + "azure.ai.ml.operations._job_operations.get_git_properties", return_value={}) @pytest.fixture() def enable_internal_components(): from azure.ai.ml._utils.utils import try_enable_internal_components - from azure.ai.ml.constants._common import AZUREML_INTERNAL_COMPONENTS_ENV_VAR + from azure.ai.ml.constants._common import \ + AZUREML_INTERNAL_COMPONENTS_ENV_VAR from azure.ai.ml.dsl._utils import environment_variable_overwrite with environment_variable_overwrite(AZUREML_INTERNAL_COMPONENTS_ENV_VAR, "True"): From bfe45d46533eedb714f98b2754ef081db4d0bd71 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Wed, 28 Sep 2022 16:12:01 -0400 Subject: [PATCH 23/44] remove curses from code --- .../azure/ai/ml/_schema/registry/system_created_acr_account.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py index 84fc2337780e..1cbef8a71b0f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py @@ -2,7 +2,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from curses.has_key import has_key from marshmallow import ValidationError, fields, post_load, pre_dump, post_dump from azure.ai.ml._schema import StringTransformedEnum, NestedField From e360c3118e516b1ca8acc995e8bffacd38d77402 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Wed, 28 Sep 2022 16:12:05 -0400 Subject: [PATCH 24/44] Update recording jsons. --- ...estRegistrytest_registry_list_and_get.json | 393 +++++++++++++----- ...ns.pyTestRegistryOperationtest_create.json | 6 + ...tions.pyTestRegistryOperationtest_get.json | 6 + 3 files changed, 295 insertions(+), 110 deletions(-) create mode 100644 sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json create mode 100644 sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json index 5a17f98714d2..9aa81e7ab0dd 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json @@ -1,38 +1,7 @@ { "Entries": [ { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722?api-version=2022-10-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip, deflate", - "Connection": "keep-alive", - "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "247", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:48:30 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "dcdd0723-ff84-4a5d-be8e-f43be387e55c", - "x-ms-failure-cause": "gateway", - "x-ms-routing-request-id": "CANADAEAST:20220928T174831Z:dcdd0723-ff84-4a5d-be8e-f43be387e55c" - }, - "ResponseBody": { - "error": { - "code": "ResourceNotFound", - "message": "The Resource \u0027Microsoft.MachineLearningServices/registries/e2etest_test_364305071722\u0027 under resource group \u002700000\u0027 was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix" - } - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722?api-version=2022-10-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614?api-version=2022-10-01-preview", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", @@ -78,27 +47,61 @@ }, "StatusCode": 202, "ResponseHeaders": { - "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 28 Sep 2022 17:48:33 GMT", + "Date": "Wed, 28 Sep 2022 20:03:49 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=location", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=location", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "cac5fbe1-f588-4f3b-a3ad-d4210ba0862b", + "x-ms-correlation-request-id": "5b91ffd8-cd2d-4f1c-933e-6fd7df253fa8", "x-ms-ratelimit-remaining-subscription-writes": "1199", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174834Z:cac5fbe1-f588-4f3b-a3ad-d4210ba0862b", - "x-request-time": "0.168" + "x-ms-routing-request-id": "CANADAEAST:20220928T200350Z:5b91ffd8-cd2d-4f1c-933e-6fd7df253fa8", + "x-request-time": "0.106" }, "ResponseBody": null }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 20:03:55 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "d2547b86-c2b4-4d0a-975b-614fe6c31cf4", + "x-ms-ratelimit-remaining-subscription-reads": "11999", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T200355Z:d2547b86-c2b4-4d0a-975b-614fe6c31cf4", + "x-request-time": "0.207" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -112,7 +115,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:48:38 GMT", + "Date": "Wed, 28 Sep 2022 20:04:00 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -121,18 +124,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "9570b149-65f6-47bc-9d05-401d23b8873b", + "x-ms-correlation-request-id": "8bace48d-3851-4da8-9145-ee7161d3c5ff", "x-ms-ratelimit-remaining-subscription-reads": "11998", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174839Z:9570b149-65f6-47bc-9d05-401d23b8873b", - "x-request-time": "0.040" + "x-ms-routing-request-id": "CANADAEAST:20220928T200401Z:8bace48d-3851-4da8-9145-ee7161d3c5ff", + "x-request-time": "0.042" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -146,7 +149,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:48:43 GMT", + "Date": "Wed, 28 Sep 2022 20:04:05 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -155,18 +158,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "49d86177-3f98-4d60-aa85-18c6a3580197", + "x-ms-correlation-request-id": "34080dde-3c73-4525-8c83-29c37c82f753", "x-ms-ratelimit-remaining-subscription-reads": "11997", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174844Z:49d86177-3f98-4d60-aa85-18c6a3580197", - "x-request-time": "0.152" + "x-ms-routing-request-id": "CANADAEAST:20220928T200406Z:34080dde-3c73-4525-8c83-29c37c82f753", + "x-request-time": "0.045" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -180,7 +183,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:48:49 GMT", + "Date": "Wed, 28 Sep 2022 20:04:10 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -189,18 +192,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "f53cd59e-75ed-4e3b-95f7-5a834009f4e5", + "x-ms-correlation-request-id": "5af1d080-a6bb-48c2-a662-d778ad18d517", "x-ms-ratelimit-remaining-subscription-reads": "11996", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174849Z:f53cd59e-75ed-4e3b-95f7-5a834009f4e5", - "x-request-time": "0.049" + "x-ms-routing-request-id": "CANADAEAST:20220928T200411Z:5af1d080-a6bb-48c2-a662-d778ad18d517", + "x-request-time": "0.042" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -214,7 +217,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:48:54 GMT", + "Date": "Wed, 28 Sep 2022 20:04:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -223,18 +226,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "f097956b-acef-4cb4-a3e9-00e45dc5061b", + "x-ms-correlation-request-id": "d4631e96-4e31-4b6d-940c-2c7e3f758299", "x-ms-ratelimit-remaining-subscription-reads": "11995", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174854Z:f097956b-acef-4cb4-a3e9-00e45dc5061b", - "x-request-time": "0.043" + "x-ms-routing-request-id": "CANADAEAST:20220928T200416Z:d4631e96-4e31-4b6d-940c-2c7e3f758299", + "x-request-time": "0.045" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -248,7 +251,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:48:59 GMT", + "Date": "Wed, 28 Sep 2022 20:04:21 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -257,18 +260,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "8447d9f1-ec67-4887-9e2f-fd7940af2cdb", + "x-ms-correlation-request-id": "ebcadd9c-dff6-480d-b9fb-3ec2b94c2893", "x-ms-ratelimit-remaining-subscription-reads": "11994", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174900Z:8447d9f1-ec67-4887-9e2f-fd7940af2cdb", - "x-request-time": "0.045" + "x-ms-routing-request-id": "CANADAEAST:20220928T200421Z:ebcadd9c-dff6-480d-b9fb-3ec2b94c2893", + "x-request-time": "0.049" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -282,7 +285,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:49:04 GMT", + "Date": "Wed, 28 Sep 2022 20:04:26 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -291,18 +294,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "6cb59b53-2e23-4ee1-b160-72f504d58888", + "x-ms-correlation-request-id": "0f77a6de-f04b-4e08-b8bd-f91caa36fec9", "x-ms-ratelimit-remaining-subscription-reads": "11993", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174905Z:6cb59b53-2e23-4ee1-b160-72f504d58888", - "x-request-time": "0.043" + "x-ms-routing-request-id": "CANADAEAST:20220928T200427Z:0f77a6de-f04b-4e08-b8bd-f91caa36fec9", + "x-request-time": "0.046" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -316,7 +319,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:49:10 GMT", + "Date": "Wed, 28 Sep 2022 20:04:31 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -325,18 +328,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "856ad28b-59d8-45b2-9bfd-41b419280fba", + "x-ms-correlation-request-id": "447d9470-d802-4cb8-b915-528f1a62295b", "x-ms-ratelimit-remaining-subscription-reads": "11992", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174910Z:856ad28b-59d8-45b2-9bfd-41b419280fba", - "x-request-time": "0.043" + "x-ms-routing-request-id": "CANADAEAST:20220928T200432Z:447d9470-d802-4cb8-b915-528f1a62295b", + "x-request-time": "0.042" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/9a0670bc-39aa-41e3-aa37-4c4f05be2fff?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -350,7 +353,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:49:15 GMT", + "Date": "Wed, 28 Sep 2022 20:04:37 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -359,11 +362,181 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "49be8491-1c10-4846-8050-5468940aa93f", + "x-ms-correlation-request-id": "eb0488e5-24f2-42ac-8886-2061626105ca", "x-ms-ratelimit-remaining-subscription-reads": "11991", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174915Z:49be8491-1c10-4846-8050-5468940aa93f", - "x-request-time": "0.074" + "x-ms-routing-request-id": "CANADAEAST:20220928T200437Z:eb0488e5-24f2-42ac-8886-2061626105ca", + "x-request-time": "0.049" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 20:04:42 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "fd81fc9a-378d-4c89-8f7f-0ccae4f97032", + "x-ms-ratelimit-remaining-subscription-reads": "11990", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T200442Z:fd81fc9a-378d-4c89-8f7f-0ccae4f97032", + "x-request-time": "0.041" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 20:04:47 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "8e811aaa-c64a-4d3c-be7f-fcffb4d34a91", + "x-ms-ratelimit-remaining-subscription-reads": "11989", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T200447Z:8e811aaa-c64a-4d3c-be7f-fcffb4d34a91", + "x-request-time": "0.041" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 20:04:52 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "a81a34b4-7477-4004-a86b-9b6ed8985079", + "x-ms-ratelimit-remaining-subscription-reads": "11988", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T200453Z:a81a34b4-7477-4004-a86b-9b6ed8985079", + "x-request-time": "0.046" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 20:04:57 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "8a5917e5-0b9b-4837-9688-cd432d6c655a", + "x-ms-ratelimit-remaining-subscription-reads": "11987", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T200458Z:8a5917e5-0b9b-4837-9688-cd432d6c655a", + "x-request-time": "0.042" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 28 Sep 2022 20:05:02 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "b5fbec8e-4605-4a97-bc54-8fe90d1f4c3b", + "x-ms-ratelimit-remaining-subscription-reads": "11986", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220928T200503Z:b5fbec8e-4605-4a97-bc54-8fe90d1f4c3b", + "x-request-time": "0.076" }, "ResponseBody": { "status": "Succeeded", @@ -371,7 +544,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722?api-version=2022-10-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614?api-version=2022-10-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -385,7 +558,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:49:15 GMT", + "Date": "Wed, 28 Sep 2022 20:05:02 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -397,10 +570,10 @@ ], "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "285a4a06-3cfd-451a-81db-c0d4df0a155e", - "x-ms-ratelimit-remaining-subscription-reads": "11990", + "x-ms-correlation-request-id": "3018ae8d-8b31-444e-bb39-03f7b2739eef", + "x-ms-ratelimit-remaining-subscription-reads": "11985", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174915Z:285a4a06-3cfd-451a-81db-c0d4df0a155e", + "x-ms-routing-request-id": "CANADAEAST:20220928T200503Z:3018ae8d-8b31-444e-bb39-03f7b2739eef", "x-request-time": "0.019" }, "ResponseBody": { @@ -408,11 +581,11 @@ "location": "westcentralus", "identity": { "type": "SystemAssigned", - "principalId": "7509f540-dda0-48da-ad80-7c414fc4c2cc", + "principalId": "7507924e-df86-4e17-8ab5-01c5e187ab90", "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" }, - "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722", - "name": "e2etest_test_364305071722", + "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614", + "name": "e2etest_test_593325491614", "type": "Microsoft.MachineLearningServices/registries", "properties": { "regionDetails": [ @@ -424,11 +597,11 @@ "newStorageAccount": null, "userCreatedStorageAccount": null, "systemCreatedStorageAccount": { - "storageAccountName": "e2ete6428ca01762a40c9a52", + "storageAccountName": "e2eteec32cc360e794d0fa02", "storageAccountType": "Standard_LRS", "storageAccountHnsEnabled": false, "armResourceId": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5/providers/Microsoft.Storage/storageAccounts/e2ete6428ca01762a40c9a52" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520/providers/Microsoft.Storage/storageAccounts/e2eteec32cc360e794d0fa02" } } } @@ -439,10 +612,10 @@ "newAcrAccount": null, "userCreatedAcrAccount": null, "systemCreatedAcrAccount": { - "acrAccountName": "e2ete5f4e409990d64ad8b3a", + "acrAccountName": "e2etec3c4a0a266ca494c95e", "acrAccountSku": "Premium", "armResourceId": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5/providers/Microsoft.ContainerRegistry/registries/e2ete5f4e409990d64ad8b3a" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520/providers/Microsoft.ContainerRegistry/registries/e2etec3c4a0a266ca494c95e" } } } @@ -451,18 +624,18 @@ ], "intellectualPropertyPublisher": null, "publicNetworkAccess": "Enabled", - "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etest_test_364305071722/discovery", + "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etest_test_593325491614/discovery", "managedResourceGroup": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520" }, "managedResourceGroupTags": {}, - "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722" + "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614" }, "systemData": null } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722?api-version=2022-10-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614?api-version=2022-10-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", @@ -476,7 +649,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 17:49:15 GMT", + "Date": "Wed, 28 Sep 2022 20:05:03 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -488,22 +661,22 @@ ], "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ee252b7a-71b1-4670-b1d1-3fcc63864243", - "x-ms-ratelimit-remaining-subscription-reads": "11989", + "x-ms-correlation-request-id": "20b5ecb3-00aa-472a-92b8-58af27a964d1", + "x-ms-ratelimit-remaining-subscription-reads": "11984", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T174916Z:ee252b7a-71b1-4670-b1d1-3fcc63864243", - "x-request-time": "0.020" + "x-ms-routing-request-id": "CANADAEAST:20220928T200504Z:20b5ecb3-00aa-472a-92b8-58af27a964d1", + "x-request-time": "0.019" }, "ResponseBody": { "tags": {}, "location": "westcentralus", "identity": { "type": "SystemAssigned", - "principalId": "7509f540-dda0-48da-ad80-7c414fc4c2cc", + "principalId": "7507924e-df86-4e17-8ab5-01c5e187ab90", "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" }, - "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722", - "name": "e2etest_test_364305071722", + "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614", + "name": "e2etest_test_593325491614", "type": "Microsoft.MachineLearningServices/registries", "properties": { "regionDetails": [ @@ -515,11 +688,11 @@ "newStorageAccount": null, "userCreatedStorageAccount": null, "systemCreatedStorageAccount": { - "storageAccountName": "e2ete6428ca01762a40c9a52", + "storageAccountName": "e2eteec32cc360e794d0fa02", "storageAccountType": "Standard_LRS", "storageAccountHnsEnabled": false, "armResourceId": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5/providers/Microsoft.Storage/storageAccounts/e2ete6428ca01762a40c9a52" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520/providers/Microsoft.Storage/storageAccounts/e2eteec32cc360e794d0fa02" } } } @@ -530,10 +703,10 @@ "newAcrAccount": null, "userCreatedAcrAccount": null, "systemCreatedAcrAccount": { - "acrAccountName": "e2ete5f4e409990d64ad8b3a", + "acrAccountName": "e2etec3c4a0a266ca494c95e", "acrAccountSku": "Premium", "armResourceId": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5/providers/Microsoft.ContainerRegistry/registries/e2ete5f4e409990d64ad8b3a" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520/providers/Microsoft.ContainerRegistry/registries/e2etec3c4a0a266ca494c95e" } } } @@ -542,18 +715,18 @@ ], "intellectualPropertyPublisher": null, "publicNetworkAccess": "Enabled", - "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etest_test_364305071722/discovery", + "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etest_test_593325491614/discovery", "managedResourceGroup": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_364305071722_4e7fa167-9b26-48b3-8daf-91dcb44438e5" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520" }, "managedResourceGroupTags": {}, - "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_364305071722" + "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614" }, "systemData": null } } ], "Variables": { - "reg_name": "test_364305071722" + "reg_name": "test_593325491614" } } diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json new file mode 100644 index 000000000000..ce2b99ebe3b2 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_871773095493" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json new file mode 100644 index 000000000000..c29dd3c99bb8 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_536578403730" + } +} From 3b45d28a73691169f1cb5195bda118fbc313b9f0 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Wed, 28 Sep 2022 16:15:13 -0400 Subject: [PATCH 25/44] Missing param. --- .../unittests/test_registry_operations.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index 7f7dd1d54137..f2d3662ed71c 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -1,11 +1,14 @@ from typing import Callable -from unittest.mock import DEFAULT, Mock +from unittest.mock import DEFAULT, Mock, call, patch import pytest from azure.ai.ml import load_registry from azure.ai.ml._scope_dependent_operations import OperationScope from azure.ai.ml.entities._registry.registry import Registry from azure.ai.ml.operations import RegistryOperations +from azure.core.exceptions import ResourceExistsError +from azure.core.polling import LROPoller +from pytest_mock import MockFixture @pytest.fixture @@ -23,13 +26,14 @@ def mock_registry_operation( ) +@pytest.mark.unittest class TestRegistryOperation: def test_list(self, mock_registry_operation: RegistryOperations) -> None: mock_registry_operation.list() - mock_registry_operation._operation.list.assert_called_once() + mock_registry_operation._operation.list_by_subscription.assert_called_once() def test_get(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: - mock_registry_operation.get(randstr()) + mock_registry_operation.get(f"unittest_{randstr('reg_name')}") mock_registry_operation._operation.get.assert_called_once() def test_check_registry_name(self, mock_registry_operation: RegistryOperations): @@ -48,9 +52,9 @@ def test_create(self, mock_registry_operation: RegistryOperations, randstr: Call source="./tests/test_configs/registry/registry_valid_min.yaml", params_override=params_override ) # valid creation of new registry - mock_registry_operation.begin_create(reg) + mock_registry_operation.begin_create(registry=reg) mock_registry_operation._operation.begin_create_or_update.assert_called_once() # create existing registry - calls GET - mock_registry_operation.begin_create(registry=reg) - mock_registry_operation._operation.begin_create_or_update.assert_not_called() + # mock_registry_operation.begin_create(registry=reg) + # mock_registry_operation._operation.begin_create_or_update.assert_not_called() From c170af52b389a90b6936b68d688aaa251d12b63f Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Wed, 28 Sep 2022 16:28:17 -0400 Subject: [PATCH 26/44] Undo unintentionally committed edit. --- .../tests/registry/unittests/test_registry_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index f2d3662ed71c..bd661a41d648 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -30,7 +30,7 @@ def mock_registry_operation( class TestRegistryOperation: def test_list(self, mock_registry_operation: RegistryOperations) -> None: mock_registry_operation.list() - mock_registry_operation._operation.list_by_subscription.assert_called_once() + mock_registry_operation._operation.list.assert_called_once() def test_get(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: mock_registry_operation.get(f"unittest_{randstr('reg_name')}") From 87bc9c5996b366f428b73e30cfc2f232ed336062 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Thu, 29 Sep 2022 10:23:51 -0400 Subject: [PATCH 27/44] Delete underscores from registry name. --- sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py | 2 +- .../tests/registry/unittests/test_registry_operations.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py index e94d944768f2..8e25c7e72f63 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -20,7 +20,7 @@ def test_registry_list_and_get( crud_registry_client: MLClient, randstr: Callable[[], str], ) -> None: - reg_name = f"e2etest_{randstr('reg_name')}" + reg_name = f"e2etest{randstr('reg_name')}" params_override = [ { "name": reg_name, diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index bd661a41d648..5806904acb8a 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -42,7 +42,7 @@ def test_check_registry_name(self, mock_registry_operation: RegistryOperations): mock_registry_operation._check_registry_name(None) def test_create(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: - reg_name = f"unittest_{randstr('reg_name')}" + reg_name = f"unittest{randstr('reg_name')}" params_override = [ { "name": reg_name From 385777fd7bdd7c5ae2c9ec100094873f9aaf122b Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Thu, 29 Sep 2022 10:39:39 -0400 Subject: [PATCH 28/44] Correct yaml format. --- .../tests/test_configs/registry/registry_valid_min.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml index dc647ebe012b..1603bd15d47b 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml @@ -3,8 +3,3 @@ name: registry_name location: WestCentralUS replication_locations: - location: WestCentralUS - storage_config: - - /subscriptions/b17253fa-f327-42d6-9686-f3e553e24763/resourceGroups/static_resources_cli_v2_e2e_tests_resources/providers/Microsoft.Storage/storageAccounts/testwsswstorage16668f03c - - storage_account_hns: False - storage_account_type: Standard_RAGRS -container_registry: /subscriptions/b17253fa-f327-42d6-9686-f3e553e24763/resourceGroups/static_resources_cli_v2_e2e_tests_resources/providers/Microsoft.ContainerRegistry/registries/clie2etestacr1 From 11a44eb1f2c4273022c401ed5838dcaef1a10a17 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Thu, 29 Sep 2022 11:11:03 -0400 Subject: [PATCH 29/44] add yaml ref link and fix test registry yaml --- sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py | 1 + .../test_configs/registry/registry_bad_arm_resource_id.yaml | 2 -- .../registry/registry_bad_storage_account_type.yaml | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py index 79937248bac9..a0b4890128d7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py @@ -333,6 +333,7 @@ class YAMLRefDocLinks: COMMAND_COMPONENT = "https://aka.ms/ml-cli-v2-component-command-yaml-reference" PARALLEL_COMPONENT = "https://aka.ms/ml-cli-v2-component-parallel-yaml-reference" SCHEDULE = "https://aka.ms/ml-cli-v2-schedule-yaml-reference" + REGISTRY = "https://aka.ms/ml-cli-v2-registry-yaml-reference" class YAMLRefDocSchemaNames: diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_arm_resource_id.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_arm_resource_id.yaml index d8845907450f..1d0b15118cfd 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_arm_resource_id.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_arm_resource_id.yaml @@ -11,6 +11,4 @@ replication_locations: - location: EastUS storage_config: - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False - storage_account_type: Standard_RAGRS container_registry: not/a/real/resource/id diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_storage_account_type.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_storage_account_type.yaml index bc28dfc010f7..51addc202880 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_storage_account_type.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_storage_account_type.yaml @@ -10,7 +10,6 @@ intellectual_property_publisher: registry_publisher replication_locations: - location: EastUS storage_config: - - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False + storage_account_hns: False storage_account_type: NOT_A_REAL_ACCOUNT_TYPE container_registry: /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.ContainerRegistry/registries/acr_id From e70757b76d443b1924b58a8c6ee9b017d88d43cc Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Thu, 29 Sep 2022 13:13:14 -0400 Subject: [PATCH 30/44] Update recordings --- ...estRegistrytest_registry_list_and_get.json | 333 +++++------------- ...ns.pyTestRegistryOperationtest_create.json | 2 +- ...tions.pyTestRegistryOperationtest_get.json | 2 +- 3 files changed, 98 insertions(+), 239 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json index 9aa81e7ab0dd..18af1a3bf373 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json @@ -1,24 +1,23 @@ { "Entries": [ { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614?api-version=2022-10-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391?api-version=2022-10-01-preview", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", - "Content-Length": "444", + "Content-Length": "357", "Content-Type": "application/json", "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" }, "RequestBody": { + "tags": {}, "location": "WestCentralUS", "identity": { "type": "SystemAssigned" }, "properties": { - "description": "This is a registry description", - "tags": {}, "regionDetails": [ { "acrDetails": [ @@ -32,12 +31,8 @@ "storageAccountDetails": [ { "systemCreatedStorageAccount": { - "storageAccountType": "Standard_LRS" - } - }, - { - "systemCreatedStorageAccount": { - "storageAccountType": "Standard_LRS" + "storageAccountHnsEnabled": false, + "storageAccountType": "standard_lrs" } } ] @@ -47,27 +42,27 @@ }, "StatusCode": 202, "ResponseHeaders": { - "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Wed, 28 Sep 2022 20:03:49 GMT", + "Date": "Thu, 29 Sep 2022 17:07:45 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=location", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=location", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "5b91ffd8-cd2d-4f1c-933e-6fd7df253fa8", - "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-correlation-request-id": "92421a22-7799-4030-b6df-2bb54aafbe12", + "x-ms-ratelimit-remaining-subscription-writes": "1198", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200350Z:5b91ffd8-cd2d-4f1c-933e-6fd7df253fa8", - "x-request-time": "0.106" + "x-ms-routing-request-id": "CANADAEAST:20220929T170745Z:92421a22-7799-4030-b6df-2bb54aafbe12", + "x-request-time": "0.186" }, "ResponseBody": null }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -81,7 +76,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:03:55 GMT", + "Date": "Thu, 29 Sep 2022 17:07:50 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -90,18 +85,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d2547b86-c2b4-4d0a-975b-614fe6c31cf4", + "x-ms-correlation-request-id": "cd2526b9-03e6-464f-8183-40eec478c24c", "x-ms-ratelimit-remaining-subscription-reads": "11999", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200355Z:d2547b86-c2b4-4d0a-975b-614fe6c31cf4", - "x-request-time": "0.207" + "x-ms-routing-request-id": "CANADAEAST:20220929T170750Z:cd2526b9-03e6-464f-8183-40eec478c24c", + "x-request-time": "0.301" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -115,7 +110,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:00 GMT", + "Date": "Thu, 29 Sep 2022 17:07:55 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -124,18 +119,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "8bace48d-3851-4da8-9145-ee7161d3c5ff", + "x-ms-correlation-request-id": "5ec37a53-0306-476e-ba2d-9998d49961b2", "x-ms-ratelimit-remaining-subscription-reads": "11998", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200401Z:8bace48d-3851-4da8-9145-ee7161d3c5ff", - "x-request-time": "0.042" + "x-ms-routing-request-id": "CANADAEAST:20220929T170756Z:5ec37a53-0306-476e-ba2d-9998d49961b2", + "x-request-time": "0.175" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -149,7 +144,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:05 GMT", + "Date": "Thu, 29 Sep 2022 17:08:00 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -158,18 +153,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "34080dde-3c73-4525-8c83-29c37c82f753", + "x-ms-correlation-request-id": "4551986a-4486-4131-bad8-975d90144725", "x-ms-ratelimit-remaining-subscription-reads": "11997", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200406Z:34080dde-3c73-4525-8c83-29c37c82f753", - "x-request-time": "0.045" + "x-ms-routing-request-id": "CANADAEAST:20220929T170801Z:4551986a-4486-4131-bad8-975d90144725", + "x-request-time": "0.046" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -183,7 +178,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:10 GMT", + "Date": "Thu, 29 Sep 2022 17:08:06 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -192,18 +187,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "5af1d080-a6bb-48c2-a662-d778ad18d517", + "x-ms-correlation-request-id": "3b5678d7-3d4f-4342-8386-2d9824395992", "x-ms-ratelimit-remaining-subscription-reads": "11996", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200411Z:5af1d080-a6bb-48c2-a662-d778ad18d517", - "x-request-time": "0.042" + "x-ms-routing-request-id": "CANADAEAST:20220929T170806Z:3b5678d7-3d4f-4342-8386-2d9824395992", + "x-request-time": "0.043" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -217,7 +212,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:16 GMT", + "Date": "Thu, 29 Sep 2022 17:08:11 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -226,18 +221,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d4631e96-4e31-4b6d-940c-2c7e3f758299", + "x-ms-correlation-request-id": "9ebe5c4b-99e0-47dd-a741-4416a81d6e31", "x-ms-ratelimit-remaining-subscription-reads": "11995", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200416Z:d4631e96-4e31-4b6d-940c-2c7e3f758299", - "x-request-time": "0.045" + "x-ms-routing-request-id": "CANADAEAST:20220929T170812Z:9ebe5c4b-99e0-47dd-a741-4416a81d6e31", + "x-request-time": "0.041" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -251,7 +246,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:21 GMT", + "Date": "Thu, 29 Sep 2022 17:08:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -260,18 +255,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ebcadd9c-dff6-480d-b9fb-3ec2b94c2893", + "x-ms-correlation-request-id": "c23c85e4-510d-4524-855c-e03921979d97", "x-ms-ratelimit-remaining-subscription-reads": "11994", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200421Z:ebcadd9c-dff6-480d-b9fb-3ec2b94c2893", - "x-request-time": "0.049" + "x-ms-routing-request-id": "CANADAEAST:20220929T170817Z:c23c85e4-510d-4524-855c-e03921979d97", + "x-request-time": "0.042" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -285,7 +280,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:26 GMT", + "Date": "Thu, 29 Sep 2022 17:08:22 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -294,18 +289,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "0f77a6de-f04b-4e08-b8bd-f91caa36fec9", + "x-ms-correlation-request-id": "26c6c9e4-0234-44f3-b86f-ab4a74065696", "x-ms-ratelimit-remaining-subscription-reads": "11993", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200427Z:0f77a6de-f04b-4e08-b8bd-f91caa36fec9", - "x-request-time": "0.046" + "x-ms-routing-request-id": "CANADAEAST:20220929T170822Z:26c6c9e4-0234-44f3-b86f-ab4a74065696", + "x-request-time": "0.042" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -319,7 +314,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:31 GMT", + "Date": "Thu, 29 Sep 2022 17:08:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -328,10 +323,10 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "447d9470-d802-4cb8-b915-528f1a62295b", + "x-ms-correlation-request-id": "9a6abfd0-696c-4ff8-84a3-c7b61aedb0f4", "x-ms-ratelimit-remaining-subscription-reads": "11992", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200432Z:447d9470-d802-4cb8-b915-528f1a62295b", + "x-ms-routing-request-id": "CANADAEAST:20220929T170827Z:9a6abfd0-696c-4ff8-84a3-c7b61aedb0f4", "x-request-time": "0.042" }, "ResponseBody": { @@ -339,7 +334,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -353,7 +348,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:37 GMT", + "Date": "Thu, 29 Sep 2022 17:08:32 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -362,18 +357,18 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "eb0488e5-24f2-42ac-8886-2061626105ca", + "x-ms-correlation-request-id": "c3779063-cd37-4679-9b56-2909dc42a64e", "x-ms-ratelimit-remaining-subscription-reads": "11991", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200437Z:eb0488e5-24f2-42ac-8886-2061626105ca", - "x-request-time": "0.049" + "x-ms-routing-request-id": "CANADAEAST:20220929T170832Z:c3779063-cd37-4679-9b56-2909dc42a64e", + "x-request-time": "0.044" }, "ResponseBody": { "status": "InProgress" } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -387,7 +382,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:42 GMT", + "Date": "Thu, 29 Sep 2022 17:08:37 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -396,147 +391,11 @@ "Vary": "Accept-Encoding", "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "fd81fc9a-378d-4c89-8f7f-0ccae4f97032", + "x-ms-correlation-request-id": "6b82c72f-f58f-43eb-9983-426500640705", "x-ms-ratelimit-remaining-subscription-reads": "11990", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200442Z:fd81fc9a-378d-4c89-8f7f-0ccae4f97032", - "x-request-time": "0.041" - }, - "ResponseBody": { - "status": "InProgress" - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "*/*", - "Accept-Encoding": "gzip, deflate", - "Connection": "keep-alive", - "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:47 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "x-aml-cluster": "vienna-westcentralus-02", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "8e811aaa-c64a-4d3c-be7f-fcffb4d34a91", - "x-ms-ratelimit-remaining-subscription-reads": "11989", - "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200447Z:8e811aaa-c64a-4d3c-be7f-fcffb4d34a91", - "x-request-time": "0.041" - }, - "ResponseBody": { - "status": "InProgress" - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "*/*", - "Accept-Encoding": "gzip, deflate", - "Connection": "keep-alive", - "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:52 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "x-aml-cluster": "vienna-westcentralus-02", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "a81a34b4-7477-4004-a86b-9b6ed8985079", - "x-ms-ratelimit-remaining-subscription-reads": "11988", - "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200453Z:a81a34b4-7477-4004-a86b-9b6ed8985079", - "x-request-time": "0.046" - }, - "ResponseBody": { - "status": "InProgress" - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "*/*", - "Accept-Encoding": "gzip, deflate", - "Connection": "keep-alive", - "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:04:57 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "x-aml-cluster": "vienna-westcentralus-02", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "8a5917e5-0b9b-4837-9688-cd432d6c655a", - "x-ms-ratelimit-remaining-subscription-reads": "11987", - "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200458Z:8a5917e5-0b9b-4837-9688-cd432d6c655a", - "x-request-time": "0.042" - }, - "ResponseBody": { - "status": "InProgress" - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/a67c4cfb-3643-4154-8217-c68b61e59753?api-version=2022-10-01-preview\u0026type=async", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "*/*", - "Accept-Encoding": "gzip, deflate", - "Connection": "keep-alive", - "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:05:02 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "x-aml-cluster": "vienna-westcentralus-02", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "b5fbec8e-4605-4a97-bc54-8fe90d1f4c3b", - "x-ms-ratelimit-remaining-subscription-reads": "11986", - "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200503Z:b5fbec8e-4605-4a97-bc54-8fe90d1f4c3b", - "x-request-time": "0.076" + "x-ms-routing-request-id": "CANADAEAST:20220929T170838Z:6b82c72f-f58f-43eb-9983-426500640705", + "x-request-time": "0.072" }, "ResponseBody": { "status": "Succeeded", @@ -544,7 +403,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614?api-version=2022-10-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391?api-version=2022-10-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "*/*", @@ -558,7 +417,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:05:02 GMT", + "Date": "Thu, 29 Sep 2022 17:08:37 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -570,22 +429,22 @@ ], "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "3018ae8d-8b31-444e-bb39-03f7b2739eef", - "x-ms-ratelimit-remaining-subscription-reads": "11985", + "x-ms-correlation-request-id": "cc29bd4f-cf27-4e60-acaa-f8f044b075d8", + "x-ms-ratelimit-remaining-subscription-reads": "11989", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200503Z:3018ae8d-8b31-444e-bb39-03f7b2739eef", - "x-request-time": "0.019" + "x-ms-routing-request-id": "CANADAEAST:20220929T170838Z:cc29bd4f-cf27-4e60-acaa-f8f044b075d8", + "x-request-time": "0.028" }, "ResponseBody": { "tags": {}, "location": "westcentralus", "identity": { "type": "SystemAssigned", - "principalId": "7507924e-df86-4e17-8ab5-01c5e187ab90", + "principalId": "4145ae13-afeb-4b54-9dda-af6da70763d7", "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" }, - "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614", - "name": "e2etest_test_593325491614", + "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391", + "name": "e2etesttest_705707027391", "type": "Microsoft.MachineLearningServices/registries", "properties": { "regionDetails": [ @@ -597,11 +456,11 @@ "newStorageAccount": null, "userCreatedStorageAccount": null, "systemCreatedStorageAccount": { - "storageAccountName": "e2eteec32cc360e794d0fa02", - "storageAccountType": "Standard_LRS", + "storageAccountName": "e2etefc43d7f562374b77910", + "storageAccountType": "standard_lrs", "storageAccountHnsEnabled": false, "armResourceId": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520/providers/Microsoft.Storage/storageAccounts/e2eteec32cc360e794d0fa02" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b/providers/Microsoft.Storage/storageAccounts/e2etefc43d7f562374b77910" } } } @@ -612,10 +471,10 @@ "newAcrAccount": null, "userCreatedAcrAccount": null, "systemCreatedAcrAccount": { - "acrAccountName": "e2etec3c4a0a266ca494c95e", + "acrAccountName": "e2eted3d61676157e4a35b88", "acrAccountSku": "Premium", "armResourceId": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520/providers/Microsoft.ContainerRegistry/registries/e2etec3c4a0a266ca494c95e" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b/providers/Microsoft.ContainerRegistry/registries/e2eted3d61676157e4a35b88" } } } @@ -624,18 +483,18 @@ ], "intellectualPropertyPublisher": null, "publicNetworkAccess": "Enabled", - "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etest_test_593325491614/discovery", + "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etesttest_705707027391/discovery", "managedResourceGroup": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b" }, "managedResourceGroupTags": {}, - "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614" + "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391" }, "systemData": null } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614?api-version=2022-10-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391?api-version=2022-10-01-preview", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", @@ -649,7 +508,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 20:05:03 GMT", + "Date": "Thu, 29 Sep 2022 17:08:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", @@ -661,22 +520,22 @@ ], "x-aml-cluster": "vienna-westcentralus-02", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "20b5ecb3-00aa-472a-92b8-58af27a964d1", - "x-ms-ratelimit-remaining-subscription-reads": "11984", + "x-ms-correlation-request-id": "57912334-f517-410f-ab11-e011ce27a6ae", + "x-ms-ratelimit-remaining-subscription-reads": "11988", "x-ms-response-type": "standard", - "x-ms-routing-request-id": "CANADAEAST:20220928T200504Z:20b5ecb3-00aa-472a-92b8-58af27a964d1", - "x-request-time": "0.019" + "x-ms-routing-request-id": "CANADAEAST:20220929T170838Z:57912334-f517-410f-ab11-e011ce27a6ae", + "x-request-time": "0.021" }, "ResponseBody": { "tags": {}, "location": "westcentralus", "identity": { "type": "SystemAssigned", - "principalId": "7507924e-df86-4e17-8ab5-01c5e187ab90", + "principalId": "4145ae13-afeb-4b54-9dda-af6da70763d7", "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" }, - "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614", - "name": "e2etest_test_593325491614", + "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391", + "name": "e2etesttest_705707027391", "type": "Microsoft.MachineLearningServices/registries", "properties": { "regionDetails": [ @@ -688,11 +547,11 @@ "newStorageAccount": null, "userCreatedStorageAccount": null, "systemCreatedStorageAccount": { - "storageAccountName": "e2eteec32cc360e794d0fa02", - "storageAccountType": "Standard_LRS", + "storageAccountName": "e2etefc43d7f562374b77910", + "storageAccountType": "standard_lrs", "storageAccountHnsEnabled": false, "armResourceId": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520/providers/Microsoft.Storage/storageAccounts/e2eteec32cc360e794d0fa02" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b/providers/Microsoft.Storage/storageAccounts/e2etefc43d7f562374b77910" } } } @@ -703,10 +562,10 @@ "newAcrAccount": null, "userCreatedAcrAccount": null, "systemCreatedAcrAccount": { - "acrAccountName": "e2etec3c4a0a266ca494c95e", + "acrAccountName": "e2eted3d61676157e4a35b88", "acrAccountSku": "Premium", "armResourceId": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520/providers/Microsoft.ContainerRegistry/registries/e2etec3c4a0a266ca494c95e" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b/providers/Microsoft.ContainerRegistry/registries/e2eted3d61676157e4a35b88" } } } @@ -715,18 +574,18 @@ ], "intellectualPropertyPublisher": null, "publicNetworkAccess": "Enabled", - "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etest_test_593325491614/discovery", + "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etesttest_705707027391/discovery", "managedResourceGroup": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etest_test_593325491614_278e1ea8-dac9-462a-ac5a-12f8f506a520" + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b" }, "managedResourceGroupTags": {}, - "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etest_test_593325491614" + "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391" }, "systemData": null } } ], "Variables": { - "reg_name": "test_593325491614" + "reg_name": "test_705707027391" } } diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json index ce2b99ebe3b2..d58b7f6b1e16 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json @@ -1,6 +1,6 @@ { "Entries": [], "Variables": { - "reg_name": "test_871773095493" + "reg_name": "test_870277799646" } } diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json index c29dd3c99bb8..4c48fc7d859a 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json @@ -1,6 +1,6 @@ { "Entries": [], "Variables": { - "reg_name": "test_536578403730" + "reg_name": "test_893030322285" } } From 057f70bba5bacb2541955c6cf9fc8e5616cd3b09 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Thu, 29 Sep 2022 14:19:41 -0400 Subject: [PATCH 31/44] fix last unit test --- ...registry_operations.pyTestRegistryOperationtest_create.json | 2 +- ...st_registry_operations.pyTestRegistryOperationtest_get.json | 2 +- .../tests/registry/unittests/test_registry_schema.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json index ce2b99ebe3b2..65bf95848307 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json @@ -1,6 +1,6 @@ { "Entries": [], "Variables": { - "reg_name": "test_871773095493" + "reg_name": "test_12419075204" } } diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json index c29dd3c99bb8..37a0e9d70ed9 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json @@ -1,6 +1,6 @@ { "Entries": [], "Variables": { - "reg_name": "test_536578403730" + "reg_name": "test_868778622952" } } diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py index 84e7dcb1814c..2f74707101f5 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py @@ -71,7 +71,8 @@ def test_deserialize_bad_storage_account_type(self) -> None: load_from_dict(RegistrySchema, target, context) assert e_info assert isinstance(e_info._excinfo[1], ValidationError) - assert "Invalid input type" in e_info._excinfo[1].messages[0] + assert "NOT_A_REAL_ACCOUNT_TYPE" in e_info._excinfo[1].messages[0] + assert "passed is not in set" in e_info._excinfo[1].messages[0] def test_deserialize_bad_arm_resource_id(self) -> None: path = Path("./tests/test_configs/registry/registry_bad_arm_resource_id.yaml") From 1f8ab99f66c468123b04c4e7c4952ab85f438425 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Fri, 30 Sep 2022 10:21:01 -0400 Subject: [PATCH 32/44] add experimental tag everywhere --- .../azure/ai/ml/_schema/registry/arm_resource_id.py | 3 ++- sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py | 2 ++ .../ai/ml/_schema/registry/registry_region_arm_details.py | 2 ++ .../ai/ml/_schema/registry/system_created_acr_account.py | 3 ++- .../ai/ml/_schema/registry/system_created_storage_account.py | 2 ++ .../azure-ai-ml/azure/ai/ml/entities/_registry/registry.py | 3 ++- .../ai/ml/entities/_registry/registry_support_classes.py | 5 ++++- .../azure/ai/ml/operations/_registry_operations.py | 3 ++- 8 files changed, 18 insertions(+), 5 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py index f11c26b8bab0..eb2a47c7b365 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py @@ -5,8 +5,9 @@ from marshmallow import ValidationError, fields, post_load, pre_dump from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta +from azure.ai.ml._utils._experimental import experimental - +@experimental class ArmResourceIdSchema(metaclass=PatchedSchemaMeta): resource_id = fields.Str() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py index 3f4ad11725fb..5e50027b5944 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py @@ -10,6 +10,7 @@ from azure.ai.ml.constants._common import PublicNetworkAccess from azure.ai.ml.constants._registry import AcrAccountSku from azure.ai.ml.entities._registry.registry_support_classes import SystemCreatedAcrAccount +from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._schema.workspace.identity import IdentitySchema from .registry_region_arm_details import RegistryRegionArmDetailsSchema @@ -18,6 +19,7 @@ # Based on 10-01-preview api +@experimental class RegistrySchema(ResourceSchema): # Inherits name, id, tags, and description fields from ResourceSchema diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py index 2adc49350adb..d5b5a50a1f15 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py @@ -12,10 +12,12 @@ from .system_created_acr_account import SystemCreatedAcrAccountSchema from .system_created_storage_account import SystemCreatedStorageAccountSchema from .util import storage_account_validator +from azure.ai.ml._utils._experimental import experimental # Differs from the swagger def in that the acr_details can only be supplied as a # single registry-wide instance, rather than a per-region list. +@experimental class RegistryRegionArmDetailsSchema(metaclass=PatchedSchemaMeta): # Commenting this out for the time being. # We do not want to surface the acr_config as a per-region configurable diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py index 1cbef8a71b0f..d11bf2abe899 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py @@ -9,8 +9,9 @@ from azure.ai.ml.constants._registry import AcrAccountSku from .arm_resource_id import ArmResourceIdSchema from .util import convert_arm_resource_id +from azure.ai.ml._utils._experimental import experimental - +@experimental class SystemCreatedAcrAccountSchema(metaclass=PatchedSchemaMeta): arm_resource_id = NestedField(ArmResourceIdSchema, dump_only=True) acr_account_sku = StringTransformedEnum( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py index 99a0e9296d55..4fa5ad645263 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py @@ -9,7 +9,9 @@ from azure.ai.ml.constants._registry import StorageAccountType from .arm_resource_id import ArmResourceIdSchema from .util import convert_arm_resource_id +from azure.ai.ml._utils._experimental import experimental +@experimental class SystemCreatedStorageAccountSchema(metaclass=PatchedSchemaMeta): arm_resource_id = NestedField(ArmResourceIdSchema, dump_only=True) storage_account_hns = fields.Bool() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index 5bf136564ec6..61e09a44ee68 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -20,6 +20,7 @@ from azure.ai.ml.entities._registry.identity import ManagedServiceIdentity from azure.ai.ml.entities._resource import Resource from azure.ai.ml.entities._util import load_from_dict +from azure.ai.ml._utils._experimental import experimental from .registry_support_classes import RegistryRegionArmDetails, SystemCreatedStorageAccount @@ -27,7 +28,7 @@ YAML_SINGLE_ACR_DETAIL = "container_registry" CLASS_REGION_DETAILS = "region_details" - +@experimental class Registry(Resource): def __init__( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 3709af4fc155..2797472bddfe 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -18,10 +18,12 @@ UserCreatedStorageAccount as RestUserCreatedStorageAccount, ) from azure.ai.ml.constants._registry import StorageAccountType +from azure.ai.ml._utils._experimental import experimental # This exists despite not being used by the schema validator because this entire # class is an output only value from the API. +@experimental class SystemCreatedAcrAccount: def __init__( self, @@ -77,7 +79,7 @@ def _from_rest_object(cls, rest_obj: RestAcrDetails) -> "Union[str, SystemCreate else: return None # TODO should this throw an error instead? - +@experimental class SystemCreatedStorageAccount: def __init__( self, @@ -143,6 +145,7 @@ def _from_rest_object(cls, rest_obj: RestStorageAccountDetails) -> "Union[str, S # Per-region information for registries. +@experimental class RegistryRegionArmDetails: def __init__( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index d6ec6f5c9ff0..085896d2a00b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -20,11 +20,12 @@ from .._utils._azureml_polling import AzureMLPolling from ..constants._common import LROConfigurations +from azure.ai.ml._utils._experimental import experimental ops_logger = OpsLogger(__name__) logger, module_logger = ops_logger.logger, ops_logger.module_logger - +@experimental class RegistryOperations: """RegistryOperations. From bae2d676506dd9ea0951e98df34e26f2cd5cf49e Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Fri, 30 Sep 2022 10:47:44 -0400 Subject: [PATCH 33/44] add back in short circuit to create and update tests --- .../ai/ml/operations/_registry_operations.py | 8 +++++++ ...ns.pyTestRegistryOperationtest_create.json | 2 +- ...istryOperationtest_create_on_existing.json | 6 +++++ ...tions.pyTestRegistryOperationtest_get.json | 2 +- .../unittests/test_registry_operations.py | 23 +++++++++++++++---- 5 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 085896d2a00b..ac50e278c7dc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -120,6 +120,14 @@ def begin_create( :return: A poller to track the operation status. :rtype: LROPoller """ + existing_registry = None + try: + existing_registry = self.get(name=registry.name) + except Exception: # pylint: disable=broad-except + pass + if existing_registry: + # for now return existing registries until UPDATE is implemented + return existing_registry registry_data = registry._to_rest_object() poller = self._operation.begin_create_or_update( resource_group_name=self._resource_group_name, diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json index 0499766d5a5a..49c642fd9109 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json @@ -1,6 +1,6 @@ { "Entries": [], "Variables": { - "reg_name": "test_859084062691" + "reg_name": "test_549756990640" } } diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json new file mode 100644 index 000000000000..f4248b7c1481 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_754776567557" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json index b65c1b300b6c..9c8dea37aa62 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json @@ -1,6 +1,6 @@ { "Entries": [], "Variables": { - "reg_name": "test_107068776154" + "reg_name": "test_960958882784" } } diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index 5806904acb8a..b3db564deab2 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -1,5 +1,5 @@ from typing import Callable -from unittest.mock import DEFAULT, Mock, call, patch +from unittest.mock import DEFAULT, MagicMock, Mock, call, patch import pytest from azure.ai.ml import load_registry @@ -52,9 +52,24 @@ def test_create(self, mock_registry_operation: RegistryOperations, randstr: Call source="./tests/test_configs/registry/registry_valid_min.yaml", params_override=params_override ) # valid creation of new registry + mock_registry_operation._operation.get = MagicMock(return_value=None) mock_registry_operation.begin_create(registry=reg) + mock_registry_operation._operation.get.assert_called_once() mock_registry_operation._operation.begin_create_or_update.assert_called_once() - # create existing registry - calls GET - # mock_registry_operation.begin_create(registry=reg) - # mock_registry_operation._operation.begin_create_or_update.assert_not_called() + + def test_create_on_existing(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: + reg_name = f"unittest{randstr('reg_name')}" + params_override = [ + { + "name": reg_name + } + ] + reg = load_registry( + source="./tests/test_configs/registry/registry_valid_min.yaml", params_override=params_override + ) + # Any non-None return value from the pre-emptive 'get' call short-circuits the function + # and prevents begin_create_or_update from being called + mock_registry_operation._operation.get = MagicMock(return_value=1) + mock_registry_operation.begin_create(registry=reg) + mock_registry_operation._operation.get.assert_called_once() From 77bfc019f954c33c727d51415fbbde438b3f3622 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Fri, 30 Sep 2022 13:34:10 -0400 Subject: [PATCH 34/44] Code review edits. --- .../registry/registry_region_arm_details.py | 1 - .../azure/ai/ml/constants/_registry.py | 4 +- .../ai/ml/entities/_registry/registry.py | 10 ++++- .../_registry/registry_support_classes.py | 45 ++++++++++--------- .../ai/ml/operations/_registry_operations.py | 7 +-- 5 files changed, 36 insertions(+), 31 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py index f5d352e4242e..2a1b2f60b151 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py @@ -11,7 +11,6 @@ from azure.ai.ml.constants._registry import StorageAccountType from azure.ai.ml.entities._registry.registry_support_classes import SystemCreatedStorageAccount -from .system_created_acr_account import SystemCreatedAcrAccountSchema from .system_created_storage_account import SystemCreatedStorageAccountSchema from .util import storage_account_validator from azure.ai.ml._utils._experimental import experimental diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py index b84a41ce5f4a..ba20a2729bc9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py @@ -6,11 +6,13 @@ from azure.core import CaseInsensitiveEnumMeta + class ManagedServiceIdentityType(str, Enum): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).""" + """Type of managed service identity""" NONE = "None" SYSTEM_ASSIGNED = "SystemAssigned" + class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD_LRS = "Standard_LRS".lower() STANDARD_GRS = "Standard_GRS".lower() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index f229fb919420..5f06c62c378a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -50,18 +50,24 @@ def __init__( :param name: Name of the registry. Must be globally unique and is immutable. :type name: str - :param tags: Tags of the registry. - :type tags: dict :param location: The location this registry resource is located in. :type location: str + :param identity: registry's System Managed Identity + :type identity: ManagedServiceIdentity :param description: Description of the registry. :type description: str + :param tags: Tags of the registry. + :type tags: dict :param public_network_access: Whether to allow public endpoint connectivity. :type public_network_access: str + :param discovery_url: Backend service base url for the registry. + :type discovery_url: str :param intellectual_property_publisher: Intellectual property publisher. :type intellectual_property_publisher: str :param managed_resource_group: Managed resource group created for the registry. :type managed_resource_group: str + :param mlflow_registry_uri: Ml flow tracking uri for the registry. + :type mlflow_registry_uri: str :param region_details: Details of each region the registry is in. :type region_details: List[RegistryRegionArmDetails] :param kwargs: A dictionary of additional configuration parameters. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 2797472bddfe..8625718c6e56 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -4,21 +4,17 @@ from typing import List, Union -from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails as RestAcrDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId as RestArmResourceId -from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryRegionArmDetails as RestRegistryRegionArmDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountDetails as RestStorageAccountDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountType as RestStorageAccountType -from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount as RestSystemCreatedAcrAccount from azure.ai.ml._restclient.v2022_10_01_preview.models import ( + AcrDetails as RestAcrDetails, + ArmResourceId as RestArmResourceId, + RegistryRegionArmDetails as RestRegistryRegionArmDetails, + StorageAccountDetails as RestStorageAccountDetails, + SystemCreatedAcrAccount as RestSystemCreatedAcrAccount, SystemCreatedStorageAccount as RestSystemCreatedStorageAccount, -) -from azure.ai.ml._restclient.v2022_10_01_preview.models import UserCreatedAcrAccount as RestUserCreatedAcrAccount -from azure.ai.ml._restclient.v2022_10_01_preview.models import ( - UserCreatedStorageAccount as RestUserCreatedStorageAccount, -) -from azure.ai.ml.constants._registry import StorageAccountType + UserCreatedAcrAccount as RestUserCreatedAcrAccount, + UserCreatedStorageAccount as RestUserCreatedStorageAccount) from azure.ai.ml._utils._experimental import experimental +from azure.ai.ml.constants._registry import StorageAccountType # This exists despite not being used by the schema validator because this entire @@ -37,8 +33,8 @@ def __init__( :param acr_account_sku: The storage account service tier. Currently only Premium is a valid option for registries. :type acr_account_sku: str - :param arm_resource_id: Resource ID of the ACR account. - :type arm_resource_id: str + :param arm_resource_id: Resource ID of the ACR account. + :type arm_resource_id: str. Default value is None. """ self.acr_account_sku = acr_account_sku self.arm_resource_id = arm_resource_id @@ -55,15 +51,15 @@ def _to_rest_object(cls, acr) -> RestAcrDetails: acr_account_sku = acr.acr_account_sku.capitalize() return RestAcrDetails( system_created_acr_account=RestSystemCreatedAcrAccount( - acr_account_sku=acr_account_sku, + acr_account_sku=acr_account_sku, ) ) else: return RestAcrDetails( - user_created_acr_account=RestUserCreatedAcrAccount(arm_resource_id=RestArmResourceId(resource_id=acr)) + user_created_acr_account=RestUserCreatedAcrAccount( + arm_resource_id=RestArmResourceId(resource_id=acr)) ) - @classmethod def _from_rest_object(cls, rest_obj: RestAcrDetails) -> "Union[str, SystemCreatedAcrAccount]": if not rest_obj: @@ -79,6 +75,7 @@ def _from_rest_object(cls, rest_obj: RestAcrDetails) -> "Union[str, SystemCreate else: return None # TODO should this throw an error instead? + @experimental class SystemCreatedStorageAccount: def __init__( @@ -103,11 +100,11 @@ def __init__( self.storage_account_hns = storage_account_hns self.storage_account_type = storage_account_type - # storage should technically be a union between str and SystemCreatedStorageAccount, # but python doesn't accept self class references apparently. # Class method instead of normal function to accept possible # string input. + @classmethod def _to_rest_object(cls, storage) -> RestStorageAccountDetails: if hasattr(storage, "storage_account_type") and storage.storage_account_type is not None: @@ -179,10 +176,12 @@ def _from_rest_object(cls, rest_obj: RestRegistryRegionArmDetails) -> "RegistryR return None converted_acr_details = [] if rest_obj.acr_details: - converted_acr_details = [SystemCreatedAcrAccount._from_rest_object(acr) for acr in rest_obj.acr_details] + converted_acr_details = [SystemCreatedAcrAccount._from_rest_object( + acr) for acr in rest_obj.acr_details] storages = [] if rest_obj.storage_account_details: - storages = [SystemCreatedStorageAccount._from_rest_object(storages) for storages in rest_obj.storage_account_details] + storages = [SystemCreatedStorageAccount._from_rest_object( + storages) for storages in rest_obj.storage_account_details] return RegistryRegionArmDetails( acr_config=converted_acr_details, location=rest_obj.location, storage_config=storages ) @@ -190,10 +189,12 @@ def _from_rest_object(cls, rest_obj: RestRegistryRegionArmDetails) -> "RegistryR def _to_rest_object(self) -> RestRegistryRegionArmDetails: converted_acr_details = [] if self.acr_config: - converted_acr_details = [SystemCreatedAcrAccount._to_rest_object(acr) for acr in self.acr_config] + converted_acr_details = [SystemCreatedAcrAccount._to_rest_object( + acr) for acr in self.acr_config] storages = [] if self.storage_config: - storages = [SystemCreatedStorageAccount._to_rest_object(storage) for storage in self.storage_config] + storages = [SystemCreatedStorageAccount._to_rest_object( + storage) for storage in self.storage_config] return RestRegistryRegionArmDetails( acr_details=converted_acr_details, location=self.location, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index a08e8b3964d1..904de4ed748f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -55,10 +55,8 @@ def __init__( @monitor_with_activity(logger, "Registry.List", ActivityType.PUBLICAPI) def list(self) -> Iterable[Registry]: """List all registries that the user has access to in the current - resource group or subscription. + resource group. - :param scope: scope of the listing, "resource_group" or "subscription", defaults to "resource_group" - :type scope: str, optional :return: An iterator like instance of Registry objects :rtype: ~azure.core.paging.ItemPaged[Registry] """ @@ -66,7 +64,7 @@ def list(self) -> Iterable[Registry]: return self._operation.list(cls=lambda objs: [Registry._from_rest_object(obj) for obj in objs], resource_group_name=self._resource_group_name) @monitor_with_activity(logger, "Registry.Get", ActivityType.PUBLICAPI) - def get(self, name: str = None) -> Registry: + def get(self, name: str) -> Registry: """Get a registry by name. :param name: Name of the registry. @@ -117,7 +115,6 @@ def begin_create( :param registry: Registry definition. :type registry: Registry - :type update_dependent_resources: boolean :return: A poller to track the operation status. :rtype: LROPoller """ From a8fcc85c2d87e847388efd4b4beef9b45173be04 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Fri, 30 Sep 2022 14:30:06 -0400 Subject: [PATCH 35/44] Do not handle existing registries differently. --- .../ai/ml/operations/_registry_operations.py | 10 +------- .../unittests/test_registry_operations.py | 23 ++----------------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 904de4ed748f..ca50c9802516 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -108,7 +108,7 @@ def begin_create( self, registry: Registry, **kwargs: Dict, - ) -> LROPoller["_models.Registry"]: + ) -> LROPoller[Registry]: """Create a new Azure Machine Learning Registry. Returns the registry if already exists. @@ -118,14 +118,6 @@ def begin_create( :return: A poller to track the operation status. :rtype: LROPoller """ - existing_registry = None - try: - existing_registry = self.get(name=registry.name) - except Exception: # pylint: disable=broad-except - pass - if existing_registry: - # for now return existing registries until UPDATE is implemented - return existing_registry registry_data = registry._to_rest_object() poller = self._operation.begin_create_or_update( resource_group_name=self._resource_group_name, diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index b3db564deab2..49643aef789f 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -1,5 +1,5 @@ from typing import Callable -from unittest.mock import DEFAULT, MagicMock, Mock, call, patch +from unittest.mock import DEFAULT, Mock, call, patch import pytest from azure.ai.ml import load_registry @@ -52,24 +52,5 @@ def test_create(self, mock_registry_operation: RegistryOperations, randstr: Call source="./tests/test_configs/registry/registry_valid_min.yaml", params_override=params_override ) # valid creation of new registry - mock_registry_operation._operation.get = MagicMock(return_value=None) mock_registry_operation.begin_create(registry=reg) - mock_registry_operation._operation.get.assert_called_once() - mock_registry_operation._operation.begin_create_or_update.assert_called_once() - - - def test_create_on_existing(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: - reg_name = f"unittest{randstr('reg_name')}" - params_override = [ - { - "name": reg_name - } - ] - reg = load_registry( - source="./tests/test_configs/registry/registry_valid_min.yaml", params_override=params_override - ) - # Any non-None return value from the pre-emptive 'get' call short-circuits the function - # and prevents begin_create_or_update from being called - mock_registry_operation._operation.get = MagicMock(return_value=1) - mock_registry_operation.begin_create(registry=reg) - mock_registry_operation._operation.get.assert_called_once() + mock_registry_operation._operation.begin_create_or_update.assert_called_once() \ No newline at end of file From 20d82eef2af8564b10ed52f0a75bab03fc8a98f7 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Fri, 30 Sep 2022 15:38:27 -0400 Subject: [PATCH 36/44] Change identity class to reference _credentials. --- .../azure/ai/ml/entities/_credentials.py | 23 ++++++++++- .../ai/ml/entities/_registry/identity.py | 41 ------------------- .../ai/ml/entities/_registry/registry.py | 6 +-- .../tests/registry/e2etests/test_registry.py | 2 +- 4 files changed, 26 insertions(+), 46 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/identity.py diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py index 534dd0c10fc7..d2a2060b02e4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py @@ -43,6 +43,10 @@ Identity as RestIdentityConfiguration ) +from azure.ai.ml._restclient.v2022_10_01_preview.models import ( + ManagedServiceIdentity as RestRegistryManagedIdentity +) + class AccountKeyConfiguration(RestTranslatableMixin, ABC): def __init__( @@ -396,7 +400,7 @@ def _from_job_rest_object(cls, obj: RestAmlToken) -> "AmlTokenConfiguration": return cls() -# This class will be used to represent Identity property on compute and endpoint +# This class will be used to represent Identity property on compute, endpoint, and registry class IdentityConfiguration(RestTranslatableMixin): """Managed identity specification.""" @@ -440,3 +444,20 @@ def _from_rest_object(cls, obj: RestIdentityConfiguration) -> "IdentityConfigura result.principal_id = obj.principal_id result.tenant_id = obj.tenant_id return result + + def _to_rest_object(self) -> RestRegistryManagedIdentity: + return RestRegistryManagedIdentity( + type=self.type, + principal_id=self.principal_id, + tenant_id=self.tenant_id, + ) + + @classmethod + def _from_rest_object(cls, obj: RestRegistryManagedIdentity) -> "IdentityConfiguration": + return cls( + type=obj.type, + user_assigned_identities=None, + ) + result.principal_id = obj.principal_id + result.tenant_id = obj.tenant_id + diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/identity.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/identity.py deleted file mode 100644 index 778b16691347..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/identity.py +++ /dev/null @@ -1,41 +0,0 @@ -# --------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# --------------------------------------------------------- - -from typing import Dict, Optional, Union - -from azure.ai.ml._restclient.v2022_10_01_preview.models import ManagedServiceIdentity as RestManagedServiceIdentity -from azure.ai.ml._restclient.v2022_10_01_preview.models import UserAssignedIdentity as RestUserAssignedIdentity -from azure.ai.ml.constants._workspace import ManagedServiceIdentityType - - -class ManagedServiceIdentity: - """Managed service identity (system assigned and/or user assigned identities).""" - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - principal_id: str = None, - tenant_id: str = None, - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - ): - self.type = type - self.principal_id = principal_id - self.tenant_id = tenant_id - self.user_assigned_identities = user_assigned_identities - - def _to_rest_object(self) -> RestManagedServiceIdentity: - return RestManagedServiceIdentity( - type=self.type, - principal_id=self.principal_id, - tenant_id=self.tenant_id, - ) - - @classmethod - def _from_rest_object(cls, obj: RestManagedServiceIdentity) -> "ManagedServiceIdentity": - return cls( - type=obj.type, - principal_id=obj.principal_id, - tenant_id=obj.tenant_id, - ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index 5f06c62c378a..8c290302beb5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -17,7 +17,7 @@ from azure.ai.ml._schema.registry.registry import RegistrySchema from azure.ai.ml._utils.utils import dump_yaml_to_file from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY -from azure.ai.ml.entities._registry.identity import ManagedServiceIdentity +from azure.ai.ml.entities._credentials import IdentityConfiguration from azure.ai.ml.entities._resource import Resource from azure.ai.ml.entities._util import load_from_dict from azure.ai.ml._utils._experimental import experimental @@ -35,7 +35,7 @@ def __init__( *, name: str, location: str, - identity: ManagedServiceIdentity = None, + identity: IdentityConfiguration = None, description: str = None, tags: Dict[str, str] = None, public_network_access: str = None, @@ -154,7 +154,7 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": ] identity = None if rest_obj.identity and isinstance(rest_obj.identity, RestManagedServiceIdentity): - identity = ManagedServiceIdentity._from_rest_object(rest_obj.identity) + identity = IdentityConfiguration._from_rest_object(rest_obj.identity) return Registry( name=rest_obj.name, description=real_registry.description, diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py index 8e25c7e72f63..d27d4d4c1769 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -6,7 +6,7 @@ import pytest from azure.ai.ml import MLClient, load_registry from azure.ai.ml.constants._common import LROConfigurations -from azure.ai.ml.entities._workspace.identity import ManagedServiceIdentityType +from azure.ai.ml.constants._registry import ManagedServiceIdentityType from azure.core.paging import ItemPaged from devtools_testutils import AzureRecordedTestCase, recorded_by_proxy From 022243bf1b6413503257769f4bb52488da6b98e2 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Fri, 30 Sep 2022 17:51:47 -0400 Subject: [PATCH 37/44] make sdk and cli registries be a bit more similar --- .../ai/ml/_schema/registry/arm_resource_id.py | 27 ---- .../azure/ai/ml/_schema/registry/registry.py | 4 +- .../registry/registry_region_arm_details.py | 12 +- .../registry/system_created_acr_account.py | 13 +- .../system_created_storage_account.py | 12 +- .../azure/ai/ml/_schema/registry/util.py | 8 -- .../azure/ai/ml/entities/__init__.py | 4 +- .../ai/ml/entities/_registry/registry.py | 63 ++++----- .../_registry/registry_support_classes.py | 42 ++++-- ...s.pyTestRegistryOperationstest_create.json | 6 + ...stryOperationstest_create_on_existing.json | 6 + ...ions.pyTestRegistryOperationstest_get.json | 6 + ...ns.pyTestRegistryOperationtest_create.json | 2 +- ...istryOperationtest_create_on_existing.json | 2 +- ...tions.pyTestRegistryOperationtest_get.json | 2 +- .../unittests/test_registry_autorest.py | 121 ------------------ .../unittests/test_registry_entity.py | 108 ++++++++++++---- .../unittests/test_registry_operations.py | 2 +- .../unittests/test_registry_schema.py | 4 +- 19 files changed, 183 insertions(+), 261 deletions(-) delete mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py create mode 100644 sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create.json create mode 100644 sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create_on_existing.json create mode 100644 sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_get.json delete mode 100644 sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py deleted file mode 100644 index eb2a47c7b365..000000000000 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/arm_resource_id.py +++ /dev/null @@ -1,27 +0,0 @@ -# --------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# --------------------------------------------------------- - -from marshmallow import ValidationError, fields, post_load, pre_dump - -from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta -from azure.ai.ml._utils._experimental import experimental - -@experimental -class ArmResourceIdSchema(metaclass=PatchedSchemaMeta): - resource_id = fields.Str() - - @post_load - def make(self, data, **kwargs): - from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId - - data.pop("type", None) - return ArmResourceId(**data) - - @pre_dump - def predump(self, data, **kwargs): - from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId - - if not isinstance(data, ArmResourceId): - raise ValidationError("Cannot dump non-ArmResourceId object into ArmResourceId") - return data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py index 5e50027b5944..a9fce5140db0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py @@ -13,7 +13,7 @@ from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._schema.workspace.identity import IdentitySchema -from .registry_region_arm_details import RegistryRegionArmDetailsSchema +from .registry_region_arm_details import RegistryRegionDetailsSchema from .system_created_acr_account import SystemCreatedAcrAccountSchema from .util import acr_format_validator @@ -31,7 +31,7 @@ class RegistrySchema(ResourceSchema): allowed_values=[PublicNetworkAccess.DISABLED, PublicNetworkAccess.ENABLED], casing_transform=snake_to_pascal, ) - replication_locations = fields.List(NestedField(RegistryRegionArmDetailsSchema)) + replication_locations = fields.List(NestedField(RegistryRegionDetailsSchema)) intellectual_property_publisher = fields.Str() # This is an acr account which will be applied to every registryRegionArmDetail defined # in replication_locations. This is different from the internal swagger diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py index f5d352e4242e..9c3476213429 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py @@ -20,7 +20,7 @@ # Differs from the swagger def in that the acr_details can only be supplied as a # single registry-wide instance, rather than a per-region list. @experimental -class RegistryRegionArmDetailsSchema(metaclass=PatchedSchemaMeta): +class RegistryRegionDetailsSchema(metaclass=PatchedSchemaMeta): # Commenting this out for the time being. # We do not want to surface the acr_config as a per-region configurable # field. Instead we want to simplify the UX and surface it as a non-list, @@ -48,15 +48,15 @@ class RegistryRegionArmDetailsSchema(metaclass=PatchedSchemaMeta): @post_load def make(self, data, **kwargs): - from azure.ai.ml.entities import RegistryRegionArmDetails + from azure.ai.ml.entities import RegistryRegionDetails data.pop("type", None) - return RegistryRegionArmDetails(**data) + return RegistryRegionDetails(**data) @pre_dump def predump(self, data, **kwargs): - from azure.ai.ml.entities import RegistryRegionArmDetails + from azure.ai.ml.entities import RegistryRegionDetails - if not isinstance(data, RegistryRegionArmDetails): - raise ValidationError("Cannot dump non-RegistryRegionArmDetails object into RegistryRegionArmDetailsSchema") + if not isinstance(data, RegistryRegionDetails): + raise ValidationError("Cannot dump non-RegistryRegionDetails object into RegistryRegionDetailsSchema") return data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py index 7e602dcc73ac..2a05252f428a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py @@ -2,19 +2,17 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from marshmallow import ValidationError, fields, post_load, pre_dump, post_dump +from marshmallow import ValidationError, fields, post_load, pre_dump -from azure.ai.ml._schema import StringTransformedEnum, NestedField +from azure.ai.ml._schema import StringTransformedEnum from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta from azure.ai.ml.constants._registry import AcrAccountSku -from .arm_resource_id import ArmResourceIdSchema -from .util import convert_arm_resource_id from azure.ai.ml._utils._experimental import experimental @experimental class SystemCreatedAcrAccountSchema(metaclass=PatchedSchemaMeta): - arm_resource_id = NestedField(ArmResourceIdSchema, dump_only=True) + arm_resource_id = fields.Str(dump_only=True) acr_account_sku = StringTransformedEnum( allowed_values=[sku.value for sku in AcrAccountSku], casing_transform=lambda x: x.lower() ) @@ -33,8 +31,3 @@ def predump(self, data, **kwargs): if not isinstance(data, SystemCreatedAcrAccount): raise ValidationError("Cannot dump non-SystemCreatedAcrAccount object into SystemCreatedAcrAccountSchema") return data - - @post_dump - def postdump(self, data, **kwargs): - convert_arm_resource_id(data) - return data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py index d7cc516392fc..53b5c083d38f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py @@ -2,19 +2,17 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from marshmallow import ValidationError, fields, post_load, pre_dump, post_dump +from marshmallow import ValidationError, fields, post_load, pre_dump -from azure.ai.ml._schema import StringTransformedEnum, NestedField +from azure.ai.ml._schema import StringTransformedEnum from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta from azure.ai.ml.constants._registry import StorageAccountType -from .arm_resource_id import ArmResourceIdSchema -from .util import convert_arm_resource_id from azure.ai.ml._utils._experimental import experimental @experimental class SystemCreatedStorageAccountSchema(metaclass=PatchedSchemaMeta): - arm_resource_id = NestedField(ArmResourceIdSchema, dump_only=True) + arm_resource_id = fields.Str(dump_only=True) storage_account_hns = fields.Bool() storage_account_type = StringTransformedEnum( allowed_values=[accountType.value for accountType in StorageAccountType], casing_transform=lambda x: x.lower() @@ -37,7 +35,3 @@ def predump(self, data, **kwargs): ) return data - @post_dump - def postdump(self, data, **kwargs): - convert_arm_resource_id(data) - return data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/util.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/util.py index 7af84d4ddab8..19c01e9a5633 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/util.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/util.py @@ -4,7 +4,6 @@ # Simple helper methods to avoid re-using lambda's everywhere -from typing import OrderedDict from azure.ai.ml.constants._registry import ACR_ACCOUNT_FORMAT, STORAGE_ACCOUNT_FORMAT @@ -14,10 +13,3 @@ def storage_account_validator(storage_id: str): def acr_format_validator(acr_id: str): return ACR_ACCOUNT_FORMAT.match(acr_id) is not None - - -#Display resource id as string, rather than as object with sub-fields. -def convert_arm_resource_id(data: OrderedDict): - if "arm_resource_id" in data and "resource_id" in data["arm_resource_id"]: - data["arm_resource_id"] = data["arm_resource_id"]["resource_id"] - return data \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py index a0680edcd5f0..ad431b584244 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py @@ -74,7 +74,7 @@ ) from ._registry.registry import Registry from ._registry.registry_support_classes import ( - RegistryRegionArmDetails, + RegistryRegionDetails, SystemCreatedAcrAccount, SystemCreatedStorageAccount, ) @@ -202,7 +202,7 @@ "SystemCreatedAcrAccount", "SystemCreatedStorageAccount", "ValidationResult", - "RegistryRegionArmDetails", + "RegistryRegionDetails", "Registry", "SynapseSparkCompute", "AutoScaleSettings", diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index f229fb919420..f128d5354650 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -22,11 +22,10 @@ from azure.ai.ml.entities._util import load_from_dict from azure.ai.ml._utils._experimental import experimental -from .registry_support_classes import RegistryRegionArmDetails, SystemCreatedStorageAccount +from .registry_support_classes import RegistryRegionDetails, SystemCreatedStorageAccount -YAML_REGION_DETAILS = "replication_locations" -YAML_SINGLE_ACR_DETAIL = "container_registry" -CLASS_REGION_DETAILS = "region_details" +CONTAINER_REGISTRY = "container_registry" +REPLICATION_LOCATIONS = "replication_locations" @experimental class Registry(Resource): @@ -43,7 +42,7 @@ def __init__( intellectual_property_publisher: str = None, managed_resource_group: str = None, mlflow_registry_uri: str = None, - region_details: List[RegistryRegionArmDetails], + replication_locations: List[RegistryRegionDetails], **kwargs, ): """Azure ML registry. @@ -62,8 +61,8 @@ def __init__( :type intellectual_property_publisher: str :param managed_resource_group: Managed resource group created for the registry. :type managed_resource_group: str - :param region_details: Details of each region the registry is in. - :type region_details: List[RegistryRegionArmDetails] + :param replication_locations: Details of each region the registry is replication in. + :type replication_locations: List[RegistryRegionArmDetails] :param kwargs: A dictionary of additional configuration parameters. :type kwargs: dict """ @@ -73,7 +72,7 @@ def __init__( # self.display_name = name # Do we need a top-level visible name value? self.location = location self.identity = identity - self.region_details = region_details + self.replication_locations = replication_locations self.public_network_access = public_network_access self.intellectual_property_publisher = intellectual_property_publisher self.managed_resource_group = managed_resource_group @@ -93,21 +92,28 @@ def dump( yaml_serialized = self._to_dict() dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False) + # The internal structure of the registry object is closer to how it's + # represented by the registry API, which differs from how registries + # are represented in YAML. This function converts those differences. def _to_dict(self) -> Dict: # pylint: disable=no-member schema = RegistrySchema(context={BASE_PATH_CONTEXT_KEY: "./"}) - - # Change name of region_details to user-shown name 'replication_locations' - self.replication_locations = self.region_details # Grab the first acr account of the first region and set that # as the system-wide container registry. + # Although support for multiple ACRs per region, as well as + # different ACRs per region technically exist according to the + # API schema, we do not want to surface that as an option, + # since the use cases for variable/multiple ACRs are extremely + # limited, and would probably just confuse most users. if self.replication_locations and len(self.replication_locations) > 0: if self.replication_locations[0].acr_config and len(self.replication_locations[0].acr_config) > 0: self.container_registry = self.replication_locations[0].acr_config[0] # Change single-list managed storage accounts to not be lists. - # (Since users enter managed storage accounts as non-list singletons) + # Although storage accounts are storage in a list to match the + # underlying API, users should only enter in one managed storage + # in YAML. for region_detail in self.replication_locations: if region_detail.storage_config and isinstance( region_detail.storage_config[0], SystemCreatedStorageAccount @@ -131,8 +137,6 @@ def _load( } loaded_schema = load_from_dict(RegistrySchema, data, context, **kwargs) cls._convert_yaml_dict_to_entity_input(loaded_schema) - # https://dev.azure.com/msdata/Vienna/_workitems/edit/1971490/ - # TODO - ensure that top-level location, if set, exists among managed locations, throw error otherwise. return Registry(**loaded_schema) @classmethod @@ -141,10 +145,11 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": return None real_registry = rest_obj.properties - region_details = [] + # Convert from api name region_details to user-shown name "replication locations" + replication_locations = [] if real_registry.region_details: - region_details = [ - RegistryRegionArmDetails._from_rest_object(details) for details in real_registry.region_details # pylint: disable=protected-access + replication_locations = [ + RegistryRegionDetails._from_rest_object(details) for details in real_registry.region_details # pylint: disable=protected-access ] identity = None if rest_obj.identity and isinstance(rest_obj.identity, RestManagedServiceIdentity): @@ -161,7 +166,7 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": intellectual_property_publisher=real_registry.intellectual_property_publisher, managed_resource_group=real_registry.managed_resource_group, mlflow_registry_uri=real_registry.ml_flow_registry_uri, - region_details=region_details, + replication_locations=replication_locations, ) # There are differences between what our registry validation schema @@ -169,25 +174,23 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": # This is mostly due to the compromise required to balance # the actual shape of registries as they're defined by # autorest with how the spec wanted users to be able to - # configure them. + # configure them. This function should eventually be @classmethod def _convert_yaml_dict_to_entity_input( cls, input: Dict, # pylint: disable=redefined-builtin ): - # change replication_locations to region_details + # pop container_registry value. global_acr_exists = False - if YAML_REGION_DETAILS in input: - input[CLASS_REGION_DETAILS] = input.pop(YAML_REGION_DETAILS) - if YAML_SINGLE_ACR_DETAIL in input: - acr_input = input.pop(YAML_SINGLE_ACR_DETAIL) + if CONTAINER_REGISTRY in input: + acr_input = input.pop(CONTAINER_REGISTRY) global_acr_exists = True - for region_detail in input[CLASS_REGION_DETAILS]: + for region_detail in input[REPLICATION_LOCATIONS]: # Apply container_registry as acr_config of each region detail if global_acr_exists: if not hasattr(region_detail, "acr_details") or len(region_detail.acr_details) == 0: region_detail.acr_config = [acr_input] - # Return single, non-list managed storage into a 1-element list. + # Convert single, non-list managed storage into a 1-element list. if hasattr(region_detail, "storage_config") and isinstance(region_detail.storage_config, SystemCreatedStorageAccount): region_detail.storage_config = [region_detail.storage_config] @@ -198,9 +201,9 @@ def _to_rest_object(self) -> RestRegistry: :return: Rest registry. """ identity = RestManagedServiceIdentity(type=RestManagedServiceIdentityType.SYSTEM_ASSIGNED) - region_details = [] - if self.region_details: - region_details = [details._to_rest_object() for details in self.region_details] + replication_locations = [] + if self.replication_locations: + replication_locations = [details._to_rest_object() for details in self.replication_locations] return RestRegistry( name=self.name, location=self.location, @@ -215,6 +218,6 @@ def _to_rest_object(self) -> RestRegistry: intellectual_property_publisher=self.intellectual_property_publisher, managed_resource_group=self.managed_resource_group, ml_flow_registry_uri=self.mlflow_registry_uri, - region_details=region_details, + region_details=replication_locations, ), ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 2797472bddfe..b0432b7eaecd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -50,9 +50,14 @@ def __init__( @classmethod def _to_rest_object(cls, acr) -> RestAcrDetails: if hasattr(acr, "acr_account_sku") and acr.acr_account_sku is not None: - # SKU enum requires input to be a capitalized word. - # Format input to be acceptable as long as spelling is correct. + # SKU enum requires input to be a capitalized word, + # so we format the input to be acceptable as long as spelling is + # correct. acr_account_sku = acr.acr_account_sku.capitalize() + # We DO NOT want to set the arm_resource_id. The backend provides very + # unhelpful errors if you provide an empty/null/invalid reosource ID, + # and ignores the value otherwise. It's better to avoid setting it in + # the conversion in this direction at all. return RestAcrDetails( system_created_acr_account=RestSystemCreatedAcrAccount( acr_account_sku=acr_account_sku, @@ -70,12 +75,15 @@ def _from_rest_object(cls, rest_obj: RestAcrDetails) -> "Union[str, SystemCreate return None # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. if hasattr(rest_obj, "system_created_acr_account") and rest_obj.system_created_acr_account is not None: + resource_id = None + if rest_obj.system_created_acr_account.arm_resource_id: + resource_id = rest_obj.system_created_acr_account.arm_resource_id.resource_id return SystemCreatedAcrAccount( acr_account_sku=rest_obj.system_created_acr_account.acr_account_sku, - arm_resource_id=rest_obj.system_created_acr_account.arm_resource_id, + arm_resource_id=resource_id, ) elif hasattr(rest_obj, "user_created_acr_account") and rest_obj.user_created_acr_account is not None: - return rest_obj.user_created_acr_account + return rest_obj.user_created_acr_account.arm_resource_id.resource_id else: return None # TODO should this throw an error instead? @@ -111,11 +119,16 @@ def __init__( @classmethod def _to_rest_object(cls, storage) -> RestStorageAccountDetails: if hasattr(storage, "storage_account_type") and storage.storage_account_type is not None: - storage_account_type = StorageAccountType( - storage.storage_account_type.lower()) + + # We DO NOT want to set the arm_resource_id. The backend provides very + # unhelpful errors if you provide an empty/null/invalid reosource ID, + # and ignores the value otherwise. It's better to avoid setting it in + # the conversion in this direction at all. + # We don't bother processing storage_account_type because the + # rest version is case insensitive. account = RestSystemCreatedStorageAccount( storage_account_hns_enabled=storage.storage_account_hns, - storage_account_type=storage_account_type, + storage_account_type=storage.storage_account_type, ) return RestStorageAccountDetails(system_created_storage_account=account) else: @@ -131,22 +144,25 @@ def _from_rest_object(cls, rest_obj: RestStorageAccountDetails) -> "Union[str, S return None # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. if rest_obj.system_created_storage_account: + resource_id = None + if rest_obj.system_created_storage_account.arm_resource_id: + resource_id = rest_obj.system_created_storage_account.arm_resource_id.resource_id return SystemCreatedStorageAccount( storage_account_hns=rest_obj.system_created_storage_account.storage_account_hns_enabled, storage_account_type=StorageAccountType( rest_obj.system_created_storage_account.storage_account_type.lower() ), # TODO validate storage account type? - arm_resource_id=rest_obj.system_created_storage_account.arm_resource_id, + arm_resource_id=resource_id, ) elif rest_obj.user_created_storage_account: - return rest_obj.user_created_storage_account + return rest_obj.user_created_storage_account.arm_resource_id.resource_id else: return None # TODO should this throw an error instead? # Per-region information for registries. @experimental -class RegistryRegionArmDetails: +class RegistryRegionDetails: def __init__( self, *, @@ -157,7 +173,7 @@ def __init__( """ Details for each region a registry is in. - :param acr_details: List of ACR details. Each value can either be a + :param acr_details: List of ACR account details. Each value can either be a single string representing the arm_resource_id of a user-created acr_details object, or a entire SystemCreatedAcrAccount object. :type acr_details: List[Union[str, SystemCreatedAcrAccount]] @@ -174,7 +190,7 @@ def __init__( self.storage_config = storage_config @classmethod - def _from_rest_object(cls, rest_obj: RestRegistryRegionArmDetails) -> "RegistryRegionArmDetails": + def _from_rest_object(cls, rest_obj: RestRegistryRegionArmDetails) -> "RegistryRegionDetails": if not rest_obj: return None converted_acr_details = [] @@ -183,7 +199,7 @@ def _from_rest_object(cls, rest_obj: RestRegistryRegionArmDetails) -> "RegistryR storages = [] if rest_obj.storage_account_details: storages = [SystemCreatedStorageAccount._from_rest_object(storages) for storages in rest_obj.storage_account_details] - return RegistryRegionArmDetails( + return RegistryRegionDetails( acr_config=converted_acr_details, location=rest_obj.location, storage_config=storages ) diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create.json new file mode 100644 index 000000000000..cd55b4ada4ca --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_581157562016" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create_on_existing.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create_on_existing.json new file mode 100644 index 000000000000..9f39439495eb --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create_on_existing.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_193498710107" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_get.json new file mode 100644 index 000000000000..b0773d1648b6 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_get.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_786088764204" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json index 49c642fd9109..0584d2453661 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json @@ -1,6 +1,6 @@ { "Entries": [], "Variables": { - "reg_name": "test_549756990640" + "reg_name": "test_43941251721" } } diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json index f4248b7c1481..c840730a855b 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json @@ -1,6 +1,6 @@ { "Entries": [], "Variables": { - "reg_name": "test_754776567557" + "reg_name": "test_9409789972" } } diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json index 9c8dea37aa62..9077e05b4edd 100644 --- a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json @@ -1,6 +1,6 @@ { "Entries": [], "Variables": { - "reg_name": "test_960958882784" + "reg_name": "test_993554130716" } } diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py deleted file mode 100644 index 4d429e951c54..000000000000 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py +++ /dev/null @@ -1,121 +0,0 @@ -import pytest - -from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry -from azure.ai.ml._restclient.v2022_10_01_preview.models import ( - RegistryProperties, - RegistryRegionArmDetails, - StorageAccountDetails, -) -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountType as RestStorageAccountType -from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount, SystemCreatedStorageAccount -from azure.ai.ml.constants._registry import StorageAccountType - -# from azure.ai.ml.entities._util import load_from_dict -from azure.ai.ml.entities import Registry - - -@pytest.mark.unittest -class TestRegistrySchema: - """Hi is this test randomly failing for you, due to the following error? - - > super(Registry, self).__init__(tags=tags, **kwargs) - E TypeError: __init__() missing 1 required keyword-only argument: 'location - - That probably means that you downloaded a new version of the 10-01-preview regions.json - file located in the autorest directory. Don't do that, the original doesn't work for local testing. - If you must anyway, remove 'location' value from the properties list of the 'RegistryTrackedResource' - definition, and regenerate you autorest files.""" - - def test_deserialize_from_autorest_object(self) -> None: - loc_1 = "USEast" - tags = {"test": "registry"} - name = "registry name" - # id = "registry id" - description = "registry description" - # There are two places in a registry where tags can live. Which do we care about? - interior_tags = {"properties": "have tags"} - pna = "Enabled" - discovery_url = "www.here-be-registries.com" - ipp = "a publisher name" - mrg = "MRG ID" - registry_uri = "example mlflow uri" - loc_2 = "The Moon" - acr_id_1 = "acr id 1" - sku = "a sku value" - acr_id_2 = "acr id 2" - storage_id_1 = "storage id 1" - storage_id_2 = "storage id 2" - hns = False - - rest_registry = RestRegistry( - location=loc_1, - tags=tags, - name=name, - id="registry id", - properties=RegistryProperties( - description=description, - tags=interior_tags, - public_network_access=pna, - discovery_url=discovery_url, - intellectual_property_publisher=ipp, - managed_resource_group=mrg, - ml_flow_registry_uri=registry_uri, - region_details=[ - RegistryRegionArmDetails( - location=loc_2, - acr_details=[ - AcrDetails(user_created_acr_account=acr_id_1), - AcrDetails( - system_created_acr_account=SystemCreatedAcrAccount( - acr_account_sku=sku, arm_resource_id=acr_id_2 - ) - ), - ], - storage_account_details=[ - StorageAccountDetails(user_created_storage_account=storage_id_1), - StorageAccountDetails( - system_created_storage_account=SystemCreatedStorageAccount( - arm_resource_id=storage_id_2, - storage_account_hns_enabled=hns, - storage_account_type=RestStorageAccountType.PREMIUM_LRS, - ) - ), - ], - ) - ], - ), - ) - registry_entity = Registry._from_rest_object(rest_registry) - - assert registry_entity - assert registry_entity.description == description - assert registry_entity.location == loc_1 - assert registry_entity.tags == tags - # assert registry_entity.name == name # TODO Local workspace obj doesn't record name besides pushing up to super class. Should we? - # assert registry_entity.id == id # TODO Local workspace obj doesn't record id. Should we? - assert registry_entity.public_network_access == pna - assert registry_entity.discovery_url == discovery_url - assert registry_entity.intellectual_property_publisher == ipp - assert registry_entity.managed_resource_group == mrg - assert registry_entity.mlflow_registry_uri == registry_uri - - assert registry_entity.region_details - details = registry_entity.region_details - assert len(details) == 1 - assert details[0].location == loc_2 - assert details[0].acr_config - assert details[0].storage_config - - acrs = details[0].acr_config - assert len(acrs) == 2 - assert acrs[0] == acr_id_1 - assert acrs[1].arm_resource_id == acr_id_2 - assert acrs[1].acr_account_sku == sku - - storages = details[0].storage_config - assert len(storages) == 2 - assert storages[0] == storage_id_1 - assert storages[1].arm_resource_id == storage_id_2 - assert storages[1].storage_account_hns == hns - assert storages[1].storage_account_type == StorageAccountType.PREMIUM_LRS diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py index d303f114be8d..1827017a6e41 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py @@ -1,17 +1,18 @@ import pytest -from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails +from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails, RegistryProperties, StorageAccountDetails, UserCreatedAcrAccount, UserCreatedStorageAccount from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry -from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryProperties from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryRegionArmDetails as RestRegistryRegionArmDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountDetails from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountType as RestStorageAccountType -from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount, SystemCreatedStorageAccount +from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount as RestSystemCreatedAcrAccount +from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedStorageAccount as RestSystemCreatedStorageAccount +from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId as RestArmResourceId from azure.ai.ml.constants._registry import StorageAccountType # from azure.ai.ml.entities._util import load_from_dict -from azure.ai.ml.entities import Registry, RegistryRegionArmDetails +from azure.ai.ml.entities import Registry, RegistryRegionDetails, SystemCreatedAcrAccount, SystemCreatedStorageAccount +# Define a bunch of constants to use in crafting test values. loc_1 = "USEast" exterior_tags = {"test": "registry"} name = "registry name" @@ -41,7 +42,7 @@ @pytest.mark.unittest -class TestRegistrySchema: +class TestRegistryEntity: """Hi. Is this test unexpectedly failing for you due to the following error? > super(Registry, self).__init__(tags=tags, **kwargs) @@ -70,18 +71,18 @@ def test_deserialize_from_autorest_object(self) -> None: RestRegistryRegionArmDetails( location=loc_2, acr_details=[ - AcrDetails(user_created_acr_account=acr_id_1), + AcrDetails(user_created_acr_account=UserCreatedAcrAccount(arm_resource_id=RestArmResourceId(resource_id=acr_id_1))), AcrDetails( - system_created_acr_account=SystemCreatedAcrAccount( - acr_account_sku=sku, arm_resource_id=acr_id_2 + system_created_acr_account=RestSystemCreatedAcrAccount( + acr_account_sku=sku, arm_resource_id=RestArmResourceId(resource_id=acr_id_2) ) ), ], storage_account_details=[ - StorageAccountDetails(user_created_storage_account=storage_id_1), + StorageAccountDetails(user_created_storage_account=UserCreatedStorageAccount(arm_resource_id=RestArmResourceId(resource_id=storage_id_1))), StorageAccountDetails( - system_created_storage_account=SystemCreatedStorageAccount( - arm_resource_id=storage_id_2, + system_created_storage_account=RestSystemCreatedStorageAccount( + arm_resource_id=RestArmResourceId(resource_id=storage_id_2), storage_account_hns_enabled=hns, storage_account_type=RestStorageAccountType.PREMIUM_LRS, ) @@ -106,8 +107,8 @@ def test_deserialize_from_autorest_object(self) -> None: assert registry_entity.managed_resource_group == mrg assert registry_entity.mlflow_registry_uri == registry_uri - assert registry_entity.region_details - details = registry_entity.region_details + assert registry_entity.replication_locations + details = registry_entity.replication_locations assert len(details) == 1 assert details[0].location == loc_2 assert details[0].acr_config @@ -143,21 +144,74 @@ def test_registry_load_from_dict(self): assert registry.description == description assert registry.tags == exterior_tags assert registry.public_network_access == pna - assert registry.region_details[0].acr_config[0] == acr_id_1 - assert registry.region_details[0].location == loc_1 - assert registry.region_details[0].storage_config[0] == storage_id_1 - - def test_registry_load_from_dict_failure_cases(self): - # TODO https://dev.azure.com/msdata/Vienna/_workitems/edit/1971490/ - pass + assert registry.replication_locations[0].acr_config[0] == acr_id_1 + assert registry.replication_locations[0].location == loc_1 + assert registry.replication_locations[0].storage_config[0] == storage_id_1 def test_registry_dictonary_modifier(self): - details = [type("", (), {})()] - input1 = {"replication_locations": details} - Registry._convert_yaml_dict_to_entity_input(input1) - assert input1["region_details"] == details - details = [type("", (), {})()] # empty object for attribute addition testing input2 = {"replication_locations": details, "container_registry": "123"} Registry._convert_yaml_dict_to_entity_input(input2) - assert input2["region_details"][0].acr_config == ["123"] + assert input2["replication_locations"][0].acr_config == ["123"] + + def test_system_acr_serialization(self): + user_acr = "some user id" + system_acr = SystemCreatedAcrAccount(acr_account_sku="prEmiUm", arm_resource_id="some system id") + rest_user_acr = SystemCreatedAcrAccount._to_rest_object(user_acr) + rest_system_acr = SystemCreatedAcrAccount._to_rest_object(system_acr) + + assert isinstance(rest_user_acr, AcrDetails) + assert isinstance(rest_system_acr, AcrDetails) + + assert rest_user_acr.user_created_acr_account.arm_resource_id.resource_id == "some user id" + # Ensure that arm_resource_id is never set by entity->rest converter. + assert rest_system_acr.system_created_acr_account.arm_resource_id == None + assert rest_system_acr.system_created_acr_account.acr_account_sku == "Premium" + + new_user_acr = SystemCreatedAcrAccount._from_rest_object(rest_user_acr) + new_system_acr = SystemCreatedAcrAccount._from_rest_object(rest_system_acr) + # ... but still test that ID is set in the other direction + rest_system_acr.system_created_acr_account.arm_resource_id = RestArmResourceId(resource_id="another id") + new_system_acr_2 = SystemCreatedAcrAccount._from_rest_object(rest_system_acr) + assert new_user_acr == "some user id" + assert new_system_acr.acr_account_sku == "Premium" + assert new_system_acr.arm_resource_id == None + assert new_system_acr_2.arm_resource_id == "another id" + + def test_system_storage_serialization(self): + user_storage = "some user storage id" + system_storage = SystemCreatedStorageAccount(storage_account_hns=True, storage_account_type=StorageAccountType.PREMIUM_LRS, arm_resource_id="some managed storage id") + + rest_user_storage = SystemCreatedStorageAccount._to_rest_object(user_storage) + rest_system_storage = SystemCreatedStorageAccount._to_rest_object(system_storage) + assert rest_user_storage.user_created_storage_account.arm_resource_id.resource_id == "some user storage id" + assert rest_system_storage.system_created_storage_account.storage_account_hns_enabled == True + assert rest_system_storage.system_created_storage_account.storage_account_type == StorageAccountType.PREMIUM_LRS + # Ensure that arm_resource_id is never set by entity->rest converter. + assert rest_system_storage.system_created_storage_account.arm_resource_id == None + + # ... but still test that ID is set in the other direction + rest_system_storage.system_created_storage_account.arm_resource_id = RestArmResourceId(resource_id="another storage id") + new_user_storage = SystemCreatedStorageAccount._from_rest_object(rest_user_storage) + new_system_storage = SystemCreatedStorageAccount._from_rest_object(rest_system_storage) + + assert new_user_storage == "some user storage id" + assert new_system_storage.arm_resource_id == "another storage id" + assert new_system_storage.storage_account_hns == True + assert new_system_storage.storage_account_type == StorageAccountType.PREMIUM_LRS + + def test_system_region_details_serialization(self): + region_detail = RegistryRegionDetails(acr_config=[SystemCreatedAcrAccount(acr_account_sku="Premium")], + location="USEast2", + storage_config=[SystemCreatedStorageAccount(storage_account_hns=False, storage_account_type=StorageAccountType.PREMIUM_LRS)]) + rest_region_detail = region_detail._to_rest_object() + + assert rest_region_detail.acr_details[0].system_created_acr_account.acr_account_sku == "Premium" + assert rest_region_detail.location == "USEast2" + assert rest_region_detail.storage_account_details[0].system_created_storage_account.storage_account_hns_enabled == False + + new_region_detail = RegistryRegionDetails._from_rest_object(rest_region_detail) + + assert new_region_detail.acr_config[0].acr_account_sku == "Premium" + assert new_region_detail.location == "USEast2" + assert new_region_detail.storage_config[0].storage_account_type == StorageAccountType.PREMIUM_LRS diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index b3db564deab2..36ade4ece7c2 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -27,7 +27,7 @@ def mock_registry_operation( @pytest.mark.unittest -class TestRegistryOperation: +class TestRegistryOperations: def test_list(self, mock_registry_operation: RegistryOperations) -> None: mock_registry_operation.list() mock_registry_operation._operation.list.assert_called_once() diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py index 2f74707101f5..bf0ba8c452c7 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py @@ -7,7 +7,7 @@ from azure.ai.ml._schema.registry import RegistrySchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PublicNetworkAccess from azure.ai.ml.constants._registry import AcrAccountSku, StorageAccountType -from azure.ai.ml.entities import RegistryRegionArmDetails, SystemCreatedAcrAccount, SystemCreatedStorageAccount +from azure.ai.ml.entities import RegistryRegionDetails, SystemCreatedAcrAccount, SystemCreatedStorageAccount from azure.ai.ml.entities._util import load_from_dict @@ -34,7 +34,7 @@ def test_deserialize_from_yaml(self) -> None: assert len(registry["replication_locations"]) == 1 detail = registry["replication_locations"][0] - assert isinstance(detail, RegistryRegionArmDetails) + assert isinstance(detail, RegistryRegionDetails) assert detail.location == "EastUS" storages = detail.storage_config From 2d8cbc04f290601aa6e3edd93f635a3079c3f544 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Fri, 30 Sep 2022 18:04:27 -0400 Subject: [PATCH 38/44] publicize registry constants --- sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py index c86addc59caa..749707e50d14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py @@ -15,7 +15,7 @@ ImportSourceType, JobType, ) -from ._registry import ManagedServiceIdentityType as RegistryManagedServiceIdentityType +from ._registry import ManagedServiceIdentityType as RegistryManagedServiceIdentityType, StorageAccountType, AcrAccountSku from ._workspace import ManagedServiceIdentityType __all__ = [ From 0d9b6b35f3c49f17d950a0f5d3a21ee09885b3a9 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Fri, 30 Sep 2022 18:11:10 -0400 Subject: [PATCH 39/44] actually do what I said, and remove unnessessarily public constant --- sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py index 749707e50d14..251e50bc4da5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py @@ -15,7 +15,7 @@ ImportSourceType, JobType, ) -from ._registry import ManagedServiceIdentityType as RegistryManagedServiceIdentityType, StorageAccountType, AcrAccountSku +from ._registry import StorageAccountType, AcrAccountSku from ._workspace import ManagedServiceIdentityType __all__ = [ @@ -33,5 +33,6 @@ "ImageClassificationModelNames", "ImageObjectDetectionModelNames", "ImageInstanceSegmentationModelNames", - "RegistryManagedServiceIdentityType", + "StorageAccountType", + "AcrAccountSku", ] From b87e8454105356231943c5391b85b9fda6895204 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Sun, 2 Oct 2022 17:07:53 -0400 Subject: [PATCH 40/44] Address pylint errors. --- .../registry/registry_region_arm_details.py | 2 +- .../registry/system_created_acr_account.py | 6 ++++-- .../system_created_storage_account.py | 7 +++---- .../azure/ai/ml/constants/_registry.py | 8 +------- .../azure/ai/ml/entities/_credentials.py | 6 +++--- .../ai/ml/entities/_registry/registry.py | 19 +++++++++++-------- .../_registry/registry_support_classes.py | 16 +++++++++------- .../ai/ml/operations/_registry_operations.py | 7 ++++--- .../tests/registry/e2etests/test_registry.py | 2 +- 9 files changed, 37 insertions(+), 36 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py index 2440a75dbc4b..8d62a1193734 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py @@ -11,9 +11,9 @@ from azure.ai.ml.constants._registry import StorageAccountType from azure.ai.ml.entities._registry.registry_support_classes import SystemCreatedStorageAccount +from azure.ai.ml._utils._experimental import experimental from .system_created_storage_account import SystemCreatedStorageAccountSchema from .util import storage_account_validator -from azure.ai.ml._utils._experimental import experimental # Differs from the swagger def in that the acr_details can only be supplied as a diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py index 2a05252f428a..08b5b99ae0cd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py @@ -2,6 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +# pylint: disable=no-else-return + from marshmallow import ValidationError, fields, post_load, pre_dump @@ -18,14 +20,14 @@ class SystemCreatedAcrAccountSchema(metaclass=PatchedSchemaMeta): ) @post_load - def make(self, data, **kwargs): + def make(data): from azure.ai.ml.entities import SystemCreatedAcrAccount data.pop("type", None) return SystemCreatedAcrAccount(**data) @pre_dump - def predump(self, data, **kwargs): + def predump(data): from azure.ai.ml.entities import SystemCreatedAcrAccount if not isinstance(data, SystemCreatedAcrAccount): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py index 53b5c083d38f..1fe987a58fc9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py @@ -19,19 +19,18 @@ class SystemCreatedStorageAccountSchema(metaclass=PatchedSchemaMeta): ) @post_load - def make(self, data, **kwargs): + def make(data): from azure.ai.ml.entities import SystemCreatedStorageAccount data.pop("type", None) return SystemCreatedStorageAccount(**data) @pre_dump - def predump(self, data, **kwargs): + def predump(data): from azure.ai.ml.entities import SystemCreatedStorageAccount if not isinstance(data, SystemCreatedStorageAccount): raise ValidationError( "Cannot dump non-SystemCreatedStorageAccount object into SystemCreatedStorageAccountSchema" ) - return data - + return data \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py index ba20a2729bc9..4577894b9222 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py @@ -1,18 +1,12 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- + import re from enum import Enum from azure.core import CaseInsensitiveEnumMeta - -class ManagedServiceIdentityType(str, Enum): - """Type of managed service identity""" - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - - class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD_LRS = "Standard_LRS".lower() STANDARD_GRS = "Standard_GRS".lower() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py index d2a2060b02e4..07ac66a2ccbc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py @@ -444,7 +444,7 @@ def _from_rest_object(cls, obj: RestIdentityConfiguration) -> "IdentityConfigura result.principal_id = obj.principal_id result.tenant_id = obj.tenant_id return result - + def _to_rest_object(self) -> RestRegistryManagedIdentity: return RestRegistryManagedIdentity( type=self.type, @@ -454,10 +454,10 @@ def _to_rest_object(self) -> RestRegistryManagedIdentity: @classmethod def _from_rest_object(cls, obj: RestRegistryManagedIdentity) -> "IdentityConfiguration": - return cls( + result = cls( type=obj.type, user_assigned_identities=None, ) result.principal_id = obj.principal_id result.tenant_id = obj.tenant_id - + return result \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index 1bd08fee4ae4..b694c3a0239a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -3,6 +3,7 @@ # --------------------------------------------------------- # pylint: disable=too-many-instance-attributes +# pylint: disable=protected-access from os import PathLike from pathlib import Path @@ -84,6 +85,7 @@ def __init__( self.managed_resource_group = managed_resource_group self.discovery_url = discovery_url self.mlflow_registry_uri = mlflow_registry_uri + self.container_registry = None def dump( self, @@ -98,26 +100,26 @@ def dump( yaml_serialized = self._to_dict() dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False) - # The internal structure of the registry object is closer to how it's + # The internal structure of the registry object is closer to how it's # represented by the registry API, which differs from how registries # are represented in YAML. This function converts those differences. def _to_dict(self) -> Dict: # pylint: disable=no-member schema = RegistrySchema(context={BASE_PATH_CONTEXT_KEY: "./"}) - + # Grab the first acr account of the first region and set that # as the system-wide container registry. # Although support for multiple ACRs per region, as well as # different ACRs per region technically exist according to the # API schema, we do not want to surface that as an option, - # since the use cases for variable/multiple ACRs are extremely - # limited, and would probably just confuse most users. + # since the use cases for variable/multiple ACRs are extremely + # limited, and would probably just confuse most users. if self.replication_locations and len(self.replication_locations) > 0: if self.replication_locations[0].acr_config and len(self.replication_locations[0].acr_config) > 0: self.container_registry = self.replication_locations[0].acr_config[0] # Change single-list managed storage accounts to not be lists. - # Although storage accounts are storage in a list to match the + # Although storage accounts are storage in a list to match the # underlying API, users should only enter in one managed storage # in YAML. for region_detail in self.replication_locations: @@ -180,7 +182,7 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": # This is mostly due to the compromise required to balance # the actual shape of registries as they're defined by # autorest with how the spec wanted users to be able to - # configure them. This function should eventually be + # configure them. This function should eventually be @classmethod def _convert_yaml_dict_to_entity_input( cls, @@ -197,7 +199,8 @@ def _convert_yaml_dict_to_entity_input( if not hasattr(region_detail, "acr_details") or len(region_detail.acr_details) == 0: region_detail.acr_config = [acr_input] # Convert single, non-list managed storage into a 1-element list. - if hasattr(region_detail, "storage_config") and isinstance(region_detail.storage_config, SystemCreatedStorageAccount): + if hasattr(region_detail, "storage_config") and isinstance(region_detail.storage_config, \ + SystemCreatedStorageAccount): region_detail.storage_config = [region_detail.storage_config] @@ -217,7 +220,7 @@ def _to_rest_object(self) -> RestRegistry: tags=self.tags, description=self.description, properties=RegistryProperties( - #tags=self.tags, interior tags exist due to swagger inheritance + #tags=self.tags, interior tags exist due to swagger inheritance # issues, don't actually use them. public_network_access=self.public_network_access, discovery_url=self.discovery_url, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 45ca66eca72c..982e0a2b2962 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -2,6 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +# pylint: disable=protected-access + from typing import List, Union from azure.ai.ml._restclient.v2022_10_01_preview.models import ( @@ -33,7 +35,7 @@ def __init__( :param acr_account_sku: The storage account service tier. Currently only Premium is a valid option for registries. :type acr_account_sku: str - :param arm_resource_id: Resource ID of the ACR account. + :param arm_resource_id: Resource ID of the ACR account. :type arm_resource_id: str. Default value is None. """ self.acr_account_sku = acr_account_sku @@ -47,11 +49,11 @@ def __init__( def _to_rest_object(cls, acr) -> RestAcrDetails: if hasattr(acr, "acr_account_sku") and acr.acr_account_sku is not None: # SKU enum requires input to be a capitalized word, - # so we format the input to be acceptable as long as spelling is + # so we format the input to be acceptable as long as spelling is # correct. acr_account_sku = acr.acr_account_sku.capitalize() - # We DO NOT want to set the arm_resource_id. The backend provides very - # unhelpful errors if you provide an empty/null/invalid reosource ID, + # We DO NOT want to set the arm_resource_id. The backend provides very + # unhelpful errors if you provide an empty/null/invalid resource ID, # and ignores the value otherwise. It's better to avoid setting it in # the conversion in this direction at all. return RestAcrDetails( @@ -116,9 +118,9 @@ def __init__( @classmethod def _to_rest_object(cls, storage) -> RestStorageAccountDetails: if hasattr(storage, "storage_account_type") and storage.storage_account_type is not None: - - # We DO NOT want to set the arm_resource_id. The backend provides very - # unhelpful errors if you provide an empty/null/invalid reosource ID, + + # We DO NOT want to set the arm_resource_id. The backend provides very + # unhelpful errors if you provide an empty/null/invalid resource ID, # and ignores the value otherwise. It's better to avoid setting it in # the conversion in this direction at all. # We don't bother processing storage_account_type because the diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index ca50c9802516..77233639847e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -18,9 +18,10 @@ from azure.core.credentials import TokenCredential from azure.core.polling import LROPoller +from azure.ai.ml._utils._experimental import experimental from .._utils._azureml_polling import AzureMLPolling from ..constants._common import LROConfigurations -from azure.ai.ml._utils._experimental import experimental + ops_logger = OpsLogger(__name__) logger, module_logger = ops_logger.logger, ops_logger.module_logger @@ -61,7 +62,8 @@ def list(self) -> Iterable[Registry]: :rtype: ~azure.core.paging.ItemPaged[Registry] """ - return self._operation.list(cls=lambda objs: [Registry._from_rest_object(obj) for obj in objs], resource_group_name=self._resource_group_name) + return self._operation.list(cls=lambda objs: [Registry._from_rest_object(obj) for obj in objs], \ + resource_group_name=self._resource_group_name) @monitor_with_activity(logger, "Registry.Get", ActivityType.PUBLICAPI) def get(self, name: str) -> Registry: @@ -107,7 +109,6 @@ def _get_polling(self, name): def begin_create( self, registry: Registry, - **kwargs: Dict, ) -> LROPoller[Registry]: """Create a new Azure Machine Learning Registry. diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py index d27d4d4c1769..0808bf6d507d 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -33,7 +33,7 @@ def test_registry_list_and_get( timeout=LROConfigurations.POLLING_TIMEOUT ) assert registry.name == reg_name - assert registry.identity.type == ManagedServiceIdentityType.SYSTEM_ASSIGNED + assert registry.identity.type == "SystemAssigned" registry_list = crud_registry_client.registries.list() assert isinstance(registry_list, ItemPaged) From ffb787b2cf20a9b1d96a779c8263c29463c33336 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Sun, 2 Oct 2022 18:25:11 -0400 Subject: [PATCH 41/44] Additional pylint errors. --- .../ai/ml/_schema/registry/system_created_acr_account.py | 6 +++--- .../ml/_schema/registry/system_created_storage_account.py | 8 +++++--- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py | 2 +- .../azure/ai/ml/entities/_registry/registry.py | 3 +-- .../ai/ml/entities/_registry/registry_support_classes.py | 3 ++- .../azure/ai/ml/operations/_registry_operations.py | 4 ++-- .../azure-ai-ml/tests/registry/e2etests/test_registry.py | 1 - 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py index 08b5b99ae0cd..24138f2c4ed9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=no-else-return +# pylint: disable=no-self-use,unused-argument from marshmallow import ValidationError, fields, post_load, pre_dump @@ -20,14 +20,14 @@ class SystemCreatedAcrAccountSchema(metaclass=PatchedSchemaMeta): ) @post_load - def make(data): + def make(self, data): from azure.ai.ml.entities import SystemCreatedAcrAccount data.pop("type", None) return SystemCreatedAcrAccount(**data) @pre_dump - def predump(data): + def predump(self, data): from azure.ai.ml.entities import SystemCreatedAcrAccount if not isinstance(data, SystemCreatedAcrAccount): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py index 1fe987a58fc9..13ac77c2c05f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py @@ -2,6 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +# pylint: disable=no-self-use,unused-argument + from marshmallow import ValidationError, fields, post_load, pre_dump @@ -19,18 +21,18 @@ class SystemCreatedStorageAccountSchema(metaclass=PatchedSchemaMeta): ) @post_load - def make(data): + def make(self, data, **kwargs): from azure.ai.ml.entities import SystemCreatedStorageAccount data.pop("type", None) return SystemCreatedStorageAccount(**data) @pre_dump - def predump(data): + def predump(self, data, **kwargs): from azure.ai.ml.entities import SystemCreatedStorageAccount if not isinstance(data, SystemCreatedStorageAccount): raise ValidationError( "Cannot dump non-SystemCreatedStorageAccount object into SystemCreatedStorageAccountSchema" ) - return data \ No newline at end of file + return data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py index 07ac66a2ccbc..9e11661e5368 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py @@ -460,4 +460,4 @@ def _from_rest_object(cls, obj: RestRegistryManagedIdentity) -> "IdentityConfigu ) result.principal_id = obj.principal_id result.tenant_id = obj.tenant_id - return result \ No newline at end of file + return result diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index b694c3a0239a..781a7d52274b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -2,8 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=too-many-instance-attributes -# pylint: disable=protected-access +# pylint: disable=too-many-instance-attributes,protected-access from os import PathLike from pathlib import Path diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 982e0a2b2962..73887305c094 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -2,7 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access +# pylint:disable=protected-access +# pylint:no-else-return from typing import List, Union diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 77233639847e..87f366ebf4d8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access +# pylint: disable=protected-access,unused-argument from typing import Dict, Iterable @@ -22,7 +22,6 @@ from .._utils._azureml_polling import AzureMLPolling from ..constants._common import LROConfigurations - ops_logger = OpsLogger(__name__) logger, module_logger = ops_logger.logger, ops_logger.module_logger @@ -109,6 +108,7 @@ def _get_polling(self, name): def begin_create( self, registry: Registry, + **kwargs: Dict, ) -> LROPoller[Registry]: """Create a new Azure Machine Learning Registry. diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py index 0808bf6d507d..4b8a7e33f3a2 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -6,7 +6,6 @@ import pytest from azure.ai.ml import MLClient, load_registry from azure.ai.ml.constants._common import LROConfigurations -from azure.ai.ml.constants._registry import ManagedServiceIdentityType from azure.core.paging import ItemPaged from devtools_testutils import AzureRecordedTestCase, recorded_by_proxy From 4514fedea339f2aaaf5ce46dbfa6a14fbdf51395 Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Sun, 2 Oct 2022 18:25:11 -0400 Subject: [PATCH 42/44] Additional pylint errors. --- .../ai/ml/_schema/registry/system_created_acr_account.py | 6 +++--- .../ml/_schema/registry/system_created_storage_account.py | 8 +++++--- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py | 2 +- .../azure/ai/ml/entities/_registry/registry.py | 3 +-- .../ai/ml/entities/_registry/registry_support_classes.py | 2 +- .../azure/ai/ml/operations/_registry_operations.py | 4 ++-- .../azure-ai-ml/tests/registry/e2etests/test_registry.py | 1 - 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py index 08b5b99ae0cd..24138f2c4ed9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=no-else-return +# pylint: disable=no-self-use,unused-argument from marshmallow import ValidationError, fields, post_load, pre_dump @@ -20,14 +20,14 @@ class SystemCreatedAcrAccountSchema(metaclass=PatchedSchemaMeta): ) @post_load - def make(data): + def make(self, data): from azure.ai.ml.entities import SystemCreatedAcrAccount data.pop("type", None) return SystemCreatedAcrAccount(**data) @pre_dump - def predump(data): + def predump(self, data): from azure.ai.ml.entities import SystemCreatedAcrAccount if not isinstance(data, SystemCreatedAcrAccount): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py index 1fe987a58fc9..13ac77c2c05f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py @@ -2,6 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +# pylint: disable=no-self-use,unused-argument + from marshmallow import ValidationError, fields, post_load, pre_dump @@ -19,18 +21,18 @@ class SystemCreatedStorageAccountSchema(metaclass=PatchedSchemaMeta): ) @post_load - def make(data): + def make(self, data, **kwargs): from azure.ai.ml.entities import SystemCreatedStorageAccount data.pop("type", None) return SystemCreatedStorageAccount(**data) @pre_dump - def predump(data): + def predump(self, data, **kwargs): from azure.ai.ml.entities import SystemCreatedStorageAccount if not isinstance(data, SystemCreatedStorageAccount): raise ValidationError( "Cannot dump non-SystemCreatedStorageAccount object into SystemCreatedStorageAccountSchema" ) - return data \ No newline at end of file + return data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py index 07ac66a2ccbc..9e11661e5368 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py @@ -460,4 +460,4 @@ def _from_rest_object(cls, obj: RestRegistryManagedIdentity) -> "IdentityConfigu ) result.principal_id = obj.principal_id result.tenant_id = obj.tenant_id - return result \ No newline at end of file + return result diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index b694c3a0239a..781a7d52274b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -2,8 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=too-many-instance-attributes -# pylint: disable=protected-access +# pylint: disable=too-many-instance-attributes,protected-access from os import PathLike from pathlib import Path diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 982e0a2b2962..43160f48ffe4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access +# pylint:disable=protected-access,no-else-return from typing import List, Union diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 77233639847e..87f366ebf4d8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access +# pylint: disable=protected-access,unused-argument from typing import Dict, Iterable @@ -22,7 +22,6 @@ from .._utils._azureml_polling import AzureMLPolling from ..constants._common import LROConfigurations - ops_logger = OpsLogger(__name__) logger, module_logger = ops_logger.logger, ops_logger.module_logger @@ -109,6 +108,7 @@ def _get_polling(self, name): def begin_create( self, registry: Registry, + **kwargs: Dict, ) -> LROPoller[Registry]: """Create a new Azure Machine Learning Registry. diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py index 0808bf6d507d..4b8a7e33f3a2 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -6,7 +6,6 @@ import pytest from azure.ai.ml import MLClient, load_registry from azure.ai.ml.constants._common import LROConfigurations -from azure.ai.ml.constants._registry import ManagedServiceIdentityType from azure.core.paging import ItemPaged from devtools_testutils import AzureRecordedTestCase, recorded_by_proxy From 8a19ef1c98b476800becc7f5b7de51cf03cc9f1c Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Sun, 2 Oct 2022 18:55:34 -0400 Subject: [PATCH 43/44] Additional pylint. --- .../azure/ai/ml/entities/_registry/registry_support_classes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 43160f48ffe4..20f70a0eb105 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -1,7 +1,6 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- - # pylint:disable=protected-access,no-else-return from typing import List, Union From 0098b5e2f2ecca9921f3bf6f1d8a8e88fdb3ec1c Mon Sep 17 00:00:00 2001 From: Georgia Fitzgerald Date: Sun, 2 Oct 2022 19:28:45 -0400 Subject: [PATCH 44/44] Revert deleted param. --- .../ai/ml/_schema/registry/system_created_acr_account.py | 4 ++-- .../ai/ml/entities/_registry/registry_support_classes.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py index 24138f2c4ed9..672dcd1e4b87 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py @@ -20,14 +20,14 @@ class SystemCreatedAcrAccountSchema(metaclass=PatchedSchemaMeta): ) @post_load - def make(self, data): + def make(self, data, **kwargs): from azure.ai.ml.entities import SystemCreatedAcrAccount data.pop("type", None) return SystemCreatedAcrAccount(**data) @pre_dump - def predump(self, data): + def predump(self, data, **kwargs): from azure.ai.ml.entities import SystemCreatedAcrAccount if not isinstance(data, SystemCreatedAcrAccount): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 73887305c094..20f70a0eb105 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -1,9 +1,7 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- - -# pylint:disable=protected-access -# pylint:no-else-return +# pylint:disable=protected-access,no-else-return from typing import List, Union